How to move some changeset to a new branch in mercurial

后端 未结 4 1654
暗喜
暗喜 2020-12-12 19:13

I want to move a changeset from one branch to another. Basically, I currently have:

A -> B -> C -> D # default branch

And I want:<

4条回答
  •  忘掉有多难
    2020-12-12 19:37

    With Mercurial Queue:

    # mark revisions as draft in case they were already shared
    #hg phase --draft --force B:D
    # make changesets a patch queue commits
    # (patches are stored .hg/patches)
    hg qimport -r B:D
    # pop changesets from current branch
    hg qpop -a
    # 
    hg branch some_new_branch
    # push changesets to new branch
    hg qpush -a
    # and make them commits
    hg qfinish -a
    

    Without comments:

    hg qimport -r B:D
    hg qpop -a
    hg branch some_new_branch
    hg qpush -a
    hg qfinish -a
    

提交回复
热议问题