Mercurial - Exceptions to internal:local merge-patterns?

十年热恋 提交于 2019-12-23 02:43:41

问题


To ensure we use the trunk version of some files when merging we use internal:local:

[merge-patterns]
.hgtags = internal:local
pom.xml = internal:local

It seems in some cases, the merge does NOT use the local file, it does actually merge the changes from the remote repository. Why would this be happening?


回答1:


The Mercurial "premerge" internal merge is actually successfully resolving merge conflicts for certain files before even launching a merge tool.

If the chosen merge tools premerge is True then an internal merge is attempted, and if it seems successful then the result it will silently be used without running the actual merge tool

Check out this article on merge tool configuration for more info. Turning off premerge for a particular type of file (or directory) can be done using these modifications to your Mercurial.ini file:

[merge-tools]
<name>.premerge = False
<name>.args = --auto $base $other $other -o $output
<name>.executable = kdiff3

[merge-patterns]
**.xml = <name>
.hgtags = <name>

Note that kdiff3 should come with TortoiseHg by default, and <name> can be anything you want; call it, 'localFilesOnly' or something like that.



来源:https://stackoverflow.com/questions/5656112/mercurial-exceptions-to-internallocal-merge-patterns

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!