使用 Mercurial 和 Beyond Compare 3(bc3) 作为 diff 工具?
在 Windows 中,我可以使用 winmerge 作为 hg 的外部 diff 工具,使用 mercurial.ini 等。
使用一些您可以在网络上找到的选项开关(我认为这是一个日本网站) 无论如何,这里 例如:
hg winmerge -r1 -r2
将列出 winmerge 中 rev1 和 rev2 之间的文件更改。 我只需单击要比较的文件即可
,但对于 bc3:
hg bcomp -r1 -r2
将使 bc3 打开一个对话框,其中指出找不到临时目录。
我最多可以使用 bc3 和 hg 来
hg bcomp -r1 -r2 myfile.cpp
打开 myfile.cpp 的 rev1 和 rev2 之间的差异
,因此,hg+bc3 似乎无法成功确认修订版之间的所有文件更改。 一次只能比较 1 个文件。
任何人都可以更好地使用 bc3 + hg 吗?
编辑:问题解决了!
从 http://www.scootersoftware.com/support.php?zz=kb_vcs.php>scooter 支持页面获得解决方案。 我必须使用 bcompare 而不是 bcomp 这是我的 Mercurial.ini 的片段
[extensions] hgext.win32text = ;mhd adds hgext.extdiff = ;mhd adds for bc [extdiff] cmd.bc3 = bcompare opts.bc3 = /ro ;mhd adds for winmerge ;[extdiff] ;cmd.winmerge = WinMergeU ;opts.winmerge = /r /e /x /ub
in windows I am able to use winmerge as the external diff tool for hg using mercurial.ini,etc.
Using some options switch that you can find in web(I think it's a japanese website)
Anyway, here
for example:
hg winmerge -r1 -r2
will list file(s) change(s) between rev1 and rev2 in winmerge. I can just click which file to diff
but for bc3:
hg bcomp -r1 -r2
will make bc3 open a dialog which stated that a temp dir can't be found.
The most I can do using bc3 and hg is
hg bcomp -r1 -r2 myfile.cpp
which will open diff between rev1 and rev2 of myfile.cpp
So,it seems that hg+bc3 can't successfully acknowledge of all files change between revision.
Only able to diff 1 file at a time.
Anyone can use bc3 + hg better ?
edit: Problem Solved !
Got the solution from http://www.scootersoftware.com/support.php?zz=kb_vcs.php>scooter support page.
I have to use bcompare instead of bcomp
Here's a snippet of my mercurial.ini
[extensions] hgext.win32text = ;mhd adds hgext.extdiff = ;mhd adds for bc [extdiff] cmd.bc3 = bcompare opts.bc3 = /ro ;mhd adds for winmerge ;[extdiff] ;cmd.winmerge = WinMergeU ;opts.winmerge = /r /e /x /ub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
Beyond-Compare-3 是一个了不起的工具。
我建议对设置进行一些调整:
Beyond-Compare-3 is an amazing tool.
I recommend a few tweaks to the setup:
我个人发现最好的 Beyond Compare 配置可以在 Mercurial
mergetools.rc 文件
文件:我还发现不在
extdiff 中包含 Beyond Compare 很重要
部分,因此它将使用merge-tools
部分中的beyondcompare3
和diffargs
参数。 (我在ui.merge
和tortoisehg.vdiff
中指定了beyondcompare3
)Personally I found that the best Beyond Compare config can be found in the Mercurial
mergetools.rc file
file:I also found that it is important to NOT include Beyond Compare in
extdiff
section so it will usebeyondcompare3
from themerge-tools
section withdiffargs
arguments. (I havebeyondcompare3
specified in bothui.merge
andtortoisehg.vdiff
)我必须添加以下内容才能使其在我的机器上运行:
I had to add the following to make it work on my machine:
如果您不断收到来自 BC 的“文件夹不可用”错误(我就是这样做的,当我同时打开多个 BC 实例时),请尝试将选项
/solo
添加到命令行,即:Source: < a href="http://www.scootersoftware.com/vbulletin/showthread.php?t=5093&highlight=mercurial" rel="nofollow noreferrer">踏板车软件支持论坛
If you keep getting this "Folder Not Available" error from BC (I did, when I had several instances of BC open simultaneously), try adding option
/solo
to the command line, i.e.:Source: Scooter Software support forum
从 Scooter Software 支持页面查看此页面 - 它还包括大多数设置版本控制系统 - 我的书签列表之一!
片段:
要配置 Mercurial,您需要编辑文件 %USERPROFILE%\Mercurial.ini 或 $HOME/.hgrc。 添加以下行,如果现有 INI 部分已存在,则使用它们:
Diff
设置后,您可以使用
3-Way Merge (v3 Pro)从命令行比较修订版本
Checkout this page from the Scooter Software support page - it also includes settings for most version control systems - one for my bookmarks list!
Snippet:
To configure Mercurial you need to edit the file %USERPROFILE%\Mercurial.ini or $HOME/.hgrc. Add the following lines, using existing INI sections if they already exist:
Diff
Once set up you can compare revisions from the command line using
3-Way Merge (v3 Pro)
我尝试了当时给出的建议,但没有奏效。
我发现了以下工作:
path
bcompare
现在尝试比较 - Beyond Compare!
I tried the suggestions given at the time but none worked.
I found the following works:
path
bcompare
Now try a diff - Beyond Compare!
到目前为止给出的所有答案都是针对 Windows 的。 这是我针对使用 Linux 的用户的配置。
Diff
4-Way Merge (v3 Pro)
-ro#
:禁用指定一侧的编辑-title#=</code>:在路径编辑中显示描述而不是文件名
< code># 字符:1=左、2=右、3=居中、4=输出
要了解
bcompare
的更多选项,只需执行bcompare -help
安慰。All the answers given so far are for Windows. Here is my configuration for those using Linux.
Diff
4-Way Merge (v3 Pro)
-ro#
: Disables editing on specified side-title#=<title>
: Shows description instead of filename in path edit#
character: 1=Left, 2=Right, 3=Center, 4=OutputFor more options of
bcompare
, simply executebcompare -help
in console.如果您在正确解析配置时遇到问题,请注意任何变量或节名称的任何空格都会导致配置无法正确解析。 我不断复制和粘贴不同的配置并继续出现错误。 结果只是在许多变量之前添加了空格,导致它无法解析。
If you are having trouble getting your configuration to parse correctly please note that any space for any variable or section name will cause the configuration to parse incorrectly. I kept copying and pasting different configures and continued to get errors. It just ended up that spaces were added before many of the variables and it caused it not to parse.
如果您使用TortoiseHg,您可以通过选择“文件”->“合并工具”将合并工具设置为“Beyond Compare”。 设置,然后在 TortoiseHg 选项上,选择 Visual Diff Tool 和 Three-way Merge Tool。 此设置也会影响通过命令行设置的合并。
If you are using TortoiseHg, you can set the merge tool to Beyond Compare by choosing File -> Settings, and then on the TortoiseHg choice, select Visual Diff Tool and Three-way Merge Tool. This setting affects merges which are set through the command line as well.