开发者

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

开发者 https://www.devze.com 2023-01-19 22:37 出处:网络
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 s开发者_如何学编程o I want

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 s开发者_如何学编程o 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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消