views:

257

answers:

3

Hi,

suppose you update your code to revision 10 which is broken. You want to go back to revision 9, work on the code and wait until someone will fix the build.

How?

svn merge -rHEAD:9 .

won't work. You know why ;).

Thanks in advance, Etam.

+5  A: 

If you simply want to go back to an other revision, update it's what you are looking for.

svn update -r 9

You can work on the code but you can't commit changes. Well, if revision 10 didn't change the same file you changed, you could commit but it's better if you wait for revision 10 to be fixed.

Insteadn if you want to go ahead and work on the code, you might consider to create a branch from r9, go ahead in the branch and reintegrate the branch into trunk when r 10 is fixed.

Simone Carletti
+1  A: 

If you really don't want to revert using the merge command, you could always just check out a previous version by passing the -r option to checkout.

svn checkout http://yoursite/svn -r 9

When someone fixes revision 10 and commits 11, you can update normally and merge in your changes from your local copy of r9. Just resolve conflicts normally and then commit 12.

Zachary Murray
+1  A: 

Your best bet is to create a branch from revision 9 and continue working on that branch. When you are confident that the trunk is ready for your changes (i.e. it is fixed), merge your branch back in.

Adam Batkin