views:

46

answers:

1

First, I used "update to revision" to update one of my directories to an old revision because we had to undo some changes.

However, when I go to commit now, It is stating that items of my project are out of date and that I should try updating.

However, I really don't want my current files to be replaced by any "newer" files in the revision.

I would like this commit to jump ahead and be the head revision.

Any tips?

Thanks

+5  A: 

What you want to do is called a "reverse merge". Update your working copy to head, then perform a reverse merge to the revision you desire. There is a section in the SVN book about it here, under the "Undoing Changes" section.

For example, if you are at revision 412, but you want to back up to the contents of revision 410, use something like the following:

svn merge -r 412:410 http://yourrepository/trunk

This will get your working copy to reflect the state at 410, and then you can do a commit.

Matt Dillard
Thanks for the info! Now I know how to undo changes. Any idea how to get out of my current situation? (That resulted from me doing an "update to revision") I've since put in quite a few hours on the project in this "reverted" state.
hamlin11
Try `svn diff > changes.diff` into a file, then update, reverse merge, and `patch -p 0 -i changes.diff`
Anton Tykhyy
Thanks for the information Anton. I'm sure that would have worked fine... however, I have zero experience with direct subversion commands. I did figure out a rather tedious solution to my problem. Using Tortoise SVN, I went ahead and updated the entire directory in question resulting in many files being in conflict. I went to "Edit Conflicts" On each file and told it to use "Mine" in each case. I then right clicked each file and marked them as resolved. Then, I committed each file. It's not the most elegant solution but it got the job done for me. Thanks for all of the help!
hamlin11