Mercurial premerge = false only for specific files, = true for all others?

走远了吗. 提交于 2019-12-11 13:39:34

问题


Is it possible for Mercurial to automatically merge all changes except for specifically nominated files? For the specific files there are some lines that may be overwritten so I want it to force a manual merge with the visual merge tool.

The use-case for this is pulling from a parent repo and building a different version of an app form the same code. The specific files would include the Visual Studio project file & AssemblyInfo file - I want to retain the version-specific references and .NET framework to build against. For more background of my scenario see http://kiln.stackexchange.com/questions/2320/best-practice-to-maintain-different-build-configs-for-the-same-code


回答1:


Yes, you can configure separate merge tools on a per-file basis, and they could differ only by pre-merge flag if you wanted:

[merge-tools]
mymergetool.priority = 100
mymergetool.premerge = True
mymergetool.args = $local $other $base -o $output
mymergetool.executable = /path/to/mergetool

manualmerge.priority = 100
manualmerge.premerge = False
manualmerge.args = $local $other $base -o $output
manualmerge.executable = /path/to/mergetool


[merge-patterns]
filename_to_never_automerge = manualmerge

Full details: https://www.mercurial-scm.org/wiki/MergeToolConfiguration



来源:https://stackoverflow.com/questions/3919709/mercurial-premerge-false-only-for-specific-files-true-for-all-others

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