1

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

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

日志显示:

[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=
4

1 回答 1

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)查找 regkey Install Location,然后附加CodeMerge.exe到它以获取可执行路径。我的猜测是那里的某个地方有错误。

您应该能够将这三个设置替换为以下内容以匹配该diff部分中的设置:

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

在 Selenic 网站上查看更多详细信息。

于 2014-11-11T16:32:20.157 回答