Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Unfortunately, I cannot explain exactly what happened. The result is the following: In my repository I have a file foo.bar for which the correct version is HEAD-1. How can I create a new revision, such that the only difference between HEAD and HEAD+1 is that foo.bar in HEAD+1 is the one from HEAD-1. All other elements of the repository should be identical in HEAD+1 to those of HEAD.

By invoking

svn update -rHEAD-1 foo.bar

I obtain a working copy which is the one I want to become HEAD+1. However, svn status doesn't show anything.

I hope my question make some sense...

share|improve this question

1 Answer 1

up vote 1 down vote accepted

From what I understand, although the rest of the changes in your HEAD revision are fine, you did a mistake in foo.bar and you want to retrieve that for your next revision. Here's how:

Take a snapshot of your foo.bar from the previous revision, using the command you have specified

svn update -r HEAD-1 foo.bar

Then, make a copy of this file and save it as foo.correct.bar

cp foo.bar foo.correct.bar

Restore the file to your current revision

svn update -r HEAD foo.bar

Then, copy over your saved (and correct version of) foo.bar to overwrite the current messed-up version

mv foo.correct.bar foo.bar

Commit it back in as revision HEAD+1

svn commit foo.bar -m "Restoring foo.bar from older revision HEAD-1"

Hope that helps, Sudipta

share|improve this answer
    
I guess this is a classical example of KISS (=Keep It Stupid Simple). I thought I should use some fancy-svn-trick... Thanks a lot! –  Dror Aug 12 '11 at 5:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.