How do I check for potential merge/rebase conflicts in Mercurial?

后端 未结 3 849
甜味超标
甜味超标 2020-12-17 16:30

Is there a simple way to check if a merge/rebase will yield file conflicts, without actually performing the merge/rebase?

I want to be able to decide whether to:

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-17 17:25

    There is no reason to use hg merge if the changes overlap and hg rebase otherwise since hg rebase make a merge internally and will let you resolve it using the same tools as hg merge.

    As for testing if a merge or rebase will cause conflicts, then you can use

    $ hg merge --tool internal:merge
    

    in Mercurial 1.7 to override your normal merge tool configuration. (The --tool internal:merge part is new, use --config ui.merge=internal:merge in earlier versions of Mercurial.)

    Following the merge,

    $ hg resolve --list
    

    will tell you the results and you will get back to where you started with

    $ hg update --clean .
    

提交回复
热议问题