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

后端 未结 3 858
甜味超标
甜味超标 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:29

    So, with some aid from Martin's answer, I've come up with the rebaseif extension, which does what I want.

    Essentially, it tries to rebase using the internal merge tool, if that fails (which it does for any conflict), it aborts and does a merge with the user's preferred tool.

    See https://bitbucket.org/marcusl/ml-hgext/src/tip/rebaseif.py for details.

    Update

    In recent months, I've gone back to just do a merge, since it's inherently safe. A non-conflict rebase might still muck things up since dependent files can affect the change. (i.e. a rebase loses information of how the code looked before merge).

    As the rebaseif author, I recommend to use plain old merge instead. :)

提交回复
热议问题