Mercurial - backout an old merge

前端 未结 6 1644
礼貌的吻别
礼貌的吻别 2021-02-13 02:24

I have a branch that looks like this:

A->B->C->D->...->Z
     ^
1->2-^

where C is a merge from 2 an

6条回答
  •  我在风中等你
    2021-02-13 03:10

    Mercurial does allow backing out a merge revision; however, the functionality is deprecated. The danger is that backout does nothing but perform a reverse commit; if you change your mind and want to re-add the removed merge, you can't do this by merging the branch again. (Hg will refuse to perform a merge with an ancestor of the current revision; or, if there were some other commits on the branch after the merge, it will only merge the following commits.)

    The command syntax is:

    hg backout --rev MergeRevision --parent ParentRevision

    Where ParentRevision is the parent of the merge revision on the original branch (i.e. not on the merged branch); usually, this is the first parent of the merge.

    The command is not available in TortoiseHg Workbench.

    After performing the backout (and resolving potential conflicts), make sure to review the new revision and amend it if necessary.

提交回复
热议问题