简体   繁体   中英

In SVN, how to roll back to previous revision instead of merge

I have seen other similar post and answers. But my situation is more restricted as following:

Branch repo/A has child branches repo/B and repo/C. C pushed/merged new foo.c to A. Then B pull/merged to get foo.c then pushed/merged other changes. Let's say B's revision changed from 10 to 11 after the pull. Now everything is messed up for branch B so I want B to go back to revision 10 and take as the pull never happened.

So I looked through those post and figured out to solve the problem by following step:

  1. svnadmin dump $(repo/B) -r 0:10 | svnadmin load $(newRepo/B)
  2. now I want to use the original repo url so:

    2.1) back up to prevent anything messing up: svnadmin copy $(repo/B) $(repo/B_backup)

    2.2) copy over new: svnadmin copy $(newRepo/B) $(repo/B);

  3. Now I want the UUID to be the same and I don't have the svnadmin setuuid because the svn version is 1.4. So:

    3.1)Before step 1, svn info $(repo/B) to record original UUID

    3.2)After step 2, open log of $(repo/B) somewhere then copy the original UUID to it

Now $(repo/B) has revision 10 and same UUID.

My question is

  1. After all this done, will branch A and C change also?

  2. Is there anything missing in my solution cause I don't want to mess it up again? Or better way to do so?

Thanks

Instead of using svnadmin to dump and restore the entire repo(!), you should simply delete/copy the subtree:

C:\>svn delete -m "this version went bad" svn://server/repo/B

Committed revision 12.

C:\>svn copy -m "restore good version" svn://server/repo/B@10 svn://server/repo/B

Committed revision 13.

In general, don't use svnadmin if you can avoid it. It's really for administration tasks - not normal source control operations like branch/merge/rollback.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM