Question

I have some changes commited a few commits back in my svn repository. Let's say HEAD is at r750 and I want to revert r745 without losing r746-r750. Is this possible?

And, can I somehow save r745 and reapply it later (as a new revision)?

Was it helpful?

Solution

Supposing you get a clean backwards merge, you could do this...

svn merge -r 745:744 <source>

Then when you want to re-apply it, you could forward merge it back in:

svn merge --ignore-ancestry -r 744:745 <source>

For more info, check out the "Common Use-Cases for Merging."

OTHER TIPS

Yes, this is definitely possible.

When you revert a change, it still creates a new revision in the repository. So you would do something like this:

1) Check out current copy r750.

2) Specify a revert on the working copy using svn merge -r. Your working copy will have the old version merged in.

3) Check in the working copy as r751.

Now you'll have two revisions in the history. The new one (r751) which does not include r745, since you rolled it back. But r745 will still be there if you ever want to reapply it. You can simply check out a copy of r745, merge it into your working copy, and check it back in (say as r752).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top