Mercurial合并执行程序脚本

时间:2014-11-11 15:10:47

标签: mercurial codecompare

当2个头冲突并且需要人类合并时,如何配置Mercurial以弹出一个合并程序?

我在Visual Studio中使用Mercurial和HgSccPackage。 使用Devart的CodeCompare进行合并和比较。

日志显示:

[Pull started]

pulling from http://localhost:8000/
[Error: warning: conflicts during merge.]
searching for changes
[Error: merging JackPot/JackPotViewer/Application/FrameRender.cpp incomplete! (edit conflicts,       then use 'hg resolve --mark')]
all local heads known remotely
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
resolving manifests
calling hook preupdate.eol: <function preupdate at 0x023DA4F0>
couldn't find merge tool codecompare_merge
couldn't find merge tool codecompare_merge
couldn't find merge tool ecmerge
couldn't find merge tool filemerge
couldn't find merge tool gpyfm
couldn't find merge tool kdiff3
couldn't find merge tool meld
couldn't find merge tool bcompare
couldn't find merge tool UltraCompare
couldn't find merge tool araxis
couldn't find merge tool beyondcompare3
couldn't find merge tool diffuse
couldn't find merge tool diffmerge
couldn't find merge tool p4merge
couldn't find merge tool tkdiff
couldn't find merge tool tortoisemerge
couldn't find merge tool xxdiff
couldn't find merge tool gvimdiff
couldn't find merge tool vimdiff
couldn't find merge tool winmerge
couldn't find merge tool merge
couldn't find merge tool hgmerge
merging JackPot/JackPotViewer/Application/FrameRender.cpp
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges

[Operation completed. Exit code: 1]

我的Mercurial.ini是:

[ui]
username=diego martinez <diego.martinez@pictel.es>
ignore=C:\Users\diego\Documents\hgignore_global.txt
merge=codecompare_merge

[extensions]
eol=
extdiff=

[merge-tools]
codecompare_merge.regkey=SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\CodeCompare_is1
codecompare_merge.regname=InstallLocation
codecompare_merge.regappend=CodeMerge.exe
codecompare_merge.args=/SC=Hg /TF=$other /MF=$local /RF=$output /BF=$base /TT="Other: $other"     /MT="Local: $local" /RT="Output: $output" /BT="Base: $base"
codecompare_merge.binary=False
codecompare_merge.gui=True
codecompare_merge.checkconflicts=True
codecompare_merge.premerge=Keep


[extdiff]
cmd.codecompare=C:\Program Files\Devart\Code Compare\CodeCompare.exe
opts.codecompare=/SC=Hg /W /title1="$plabel1" /title2="$clabel" $parent $child

[merge-patterns]
*.*=codecompare_merge

[http_proxy]
host=
no=
user=
passwd=

1 个答案:

答案 0 :(得分:1)

在您的设置中,您要定义两个工具,但只是成功指定了一个工具的路径。

您已将codecompare定义为外部差异工具。我假设当你试图查看文件的两个版本之间的差异时,它正常工作,例如hg codecompare -r "tip^:tip" file.txt

第二个工具是codecompare_merge,您已使用该组键定义了安装位置:

codecompare_merge.regkey=SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\CodeCompare_is1
codecompare_merge.regname=InstallLocation
codecompare_merge.regappend=CodeMerge.exe

这告诉hg在注册表HKEY_CURRENT_USER(然后是HKEY_LOCAL_MACHINE)查找注册表Install Location,然后将CodeMerge.exe附加到它以获取可执行路径。我的猜测是那里某处出现了错误。

您应该可以使用以下内容替换这三个设置,以匹配diff部分中的设置:

codecompare_merge.executeable=C:\Program Files\Devart\Code Compare\CodeCompare.exe

在Selenic网站上查看more details