如何检查Mercurial中潜在的合并/重新设置冲突? [英] How do I check for potential merge/rebase conflicts in Mercurial?

查看:48
本文介绍了如何检查Mercurial中潜在的合并/重新设置冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法来检查合并/重新设置是否会产生文件冲突,而无需实际执行合并/重新设置?

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

我希望能够决定是否:

  • 如果触摸的文件集(我的vs.他们的)不同,则重新设置
  • 如果我们一直在处理相同的文件,则合并.

由于错误合并(由于人为错误而以错误方式解决了冲突),如果我合并两个记录头而不是进行变基,则更易于检测和反转.尤其是当我推动更改并随后意识到有些事情搞砸了.

Since a bad merge (caused by resolving conflicts the wrong way by human error) is easier to detect and reverse if I do a merge of two heads, rather than having done rebase. Especially if I push my changes and than later realized that something was messed up.

(由于我们没有一个全面的测试套件,因此不可能总是事先检查所有内容.)

(It's not possible to always check everything beforehand, as we don't have a totally comprehensive test-suite.).

然后..我正在运行Windows. :)

And.. I'm running Windows. :)

推荐答案

因此,在Martin的帮助下,我提出了rebaseif扩展名,该扩展名可以满足我的要求.

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.

请参见 https://bitbucket.org/marcusl/ml-hgext /src/tip/rebaseif.py 了解详情.

更新

最近几个月,我回过头来只进行合并,因为它本质上是安全的.由于从属文件可能会影响更改,因此无冲突的基准调整可能仍会失败. (即,重新存储会丢失有关合并前代码外观的信息).

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).

作为rebaseif的作者,我建议改用普通的旧合并. :)

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

这篇关于如何检查Mercurial中潜在的合并/重新设置冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆