tags:

views:

50

answers:

2

Right now I'm at rev 1307. I want to undo the changes of the changesets 1276-1284 and 1286-1294. Basically, it's all the changesets 1276-1294, excluding 1285. I would also like to keep my latest changes, which are unlikely to conflict with the changes that I want to undo.

Can anybody give me some hints?

A: 

In general terms, you can apply a reverse diff for each range you want to undo. For example:

svn diff -r1276:1285 > first.patch

to create the diff (note the ending version is one revision number more than the last one you want to undo), then

patch -R < first.patch

The -R switch tells patch to apply the patch in reverse. svn diff tells you what you did, so patch -R undoes that. You may, of course, have conflicts that you must resolve manually.

Greg Hewgill
The other answer to the question has "svn merge -r 1294:1285". I used the patch creation described here to solve my question at it worked. Why does this svn diff doesn't have the numbers reversed?
Costi
As Greg says - that's what the `-R` to `patch` is for :-)
psmears
+1  A: 

I think you can just do a couple of merge commands with the revision numbers reversed. Try this:

svn merge -r 1294:1285
svn merge -r 1284:1275

I'd recommend you commit your current changes before trying this, or at least create a patch file to back them up.

Don Kirkby