Mercurial Out of Bad Merge

I just merged branch A into B, and for some reason the merge did not work. I want to bring B back to where it was before the merger, and try again like never before. I thought just doing

hg clone myrepo newrepo -r A -r 12345

where 12345 is the revision number before B fails to merge

I think this works, but I have many other branches (most of which are closed with commit -close-branch) and this returns these branches to an inactive state.

Is there a way to clone everything except version 123456 or something else? (where 123456 is a bad fix on B)

+5
source share
4 answers

, - , hg strip, Mercurial Queues (i. mq).

wiki:

hg strip rev rev . , . , hg strip .hg/strip-backup/. , hg unbundle .hg/strip-backup/filename.

+10

, hg rollback, , , - A, B, , , dummy-merge .

+2

I hope I understand your situation correctly. If I am, then you should be able to upgrade to version B before merging, give this revision a new branch name, merge A into it, and continue. You probably want to mark the source branch B as closed.

$ hg up 12345  #12345 is the revision of B prior to the merge
$ hg branch B-take2
$ hg merge A
$ hg commit -m 'merge A in to B-take2'

$ hg up B
$ hg commit --close-branch -m 'mark original B branch as closed'
+1
source

Is it too late to use the hg rollback command ? If so, try the hg backout command .

+1
source

All Articles