문제

I have 2 branches in my Mercurial repository. 'default' and 'other'

default branch A - B - C - D

other branch E - F

I need to move B changeset to other branch. So it will look like this:

default branch A - C - D

other branch E - F - B

Is it possible?

Thanks in advance!

도움이 되었습니까?

해결책

Graft-based solution

  • Graft (hg help graft) B to target branch
  • Remove (histed extension) B from source branch (graft only make copy of changeset, without removing original)

Rebase-based solution

  • Rebase B to other branch
  • Because rebase move also descendants of rebased changeset - rebase C back to default

다른 팁

The following solution doesn't require enabling any extensions. It does assume the existence of the patch utility, though.

On default:

$ hg diff -c B > diff.out
$ hg backout --merge -r B
$ hg merge
$ hg ci

On other branch:

$ patch -p1 < diff.out
$ hg ci
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top