2010-10-12 15 views
1

Mercurial是否可以自動合併除特定指定文件之外的所有更改?對於特定的文件,有一些行可能會被覆蓋,所以我希望它強制手動合併可視合併工具。Mercurial premerge =僅對特定文件爲false,對所有其他文件都爲true =

用於此的用例是從父回購協議中提取並構建相同代碼的不同版本的應用程序。具體的文件將包括Visual Studio項目文件& AssemblyInfo文件 - 我想保留特定於版本的引用和.NET框架來構建。對於我的方案的更多背景看http://kiln.stackexchange.com/questions/2320/best-practice-to-maintain-different-build-configs-for-the-same-code

回答

4

是的,你可以在每個文件的基礎配置單獨的合併工具,如果你想他們只能通過預合併標誌不同:

[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 

全部細節:https://www.mercurial-scm.org/wiki/MergeToolConfiguration

+0

spot-on!謝謝。 :) – 2010-10-13 19:50:01

相關問題