简体   繁体   English

使用mercurial和超越比较3(bc3)作为差异工具?

[英]Using mercurial and beyond compare 3(bc3) as the diff tool?

in windows I am able to use winmerge as the external diff tool for hg using mercurial.ini ,etc. 在Windows中,我可以使用winmerge作为hg的外部差异工具,使用mercurial.ini等。
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. 将在winmerge中列出rev1和rev2之间的文件更改。 I can just click which file to diff 我可以点击哪个文件来区分

but for bc3: 但对于bc3:

hg bcomp -r1 -r2

will make bc3 open a dialog which stated that a temp dir can't be found. 将使bc3打开一个对话框,表明无法找到临时目录。

The most I can do using bc3 and hg is 我能用bc3和hg做的最多的是

hg bcomp -r1 -r2 myfile.cpp

which will open diff between rev1 and rev2 of myfile.cpp 这将打开myfile.cpp的rev1和rev2之间的差异

So,it seems that hg+bc3 can't successfully acknowledge of all files change between revision. 因此,似乎hg + bc3无法成功确认所有文件在修订之间发生变化。 Only able to diff 1 file at a time. 一次只能传播1个文件。
Anyone can use bc3 + hg better ? 谁能更好地使用bc3 + hg?

edit: Problem Solved ! 编辑:问题解决了!

Got the solution from http://www.scootersoftware.com/support.php?zz=kb_vcs.php>scooter support page. 从http://www.scootersoftware.com/support.php?zz=kb_vcs.php>scooter支持页面获得解决方案。 I have to use bcompare instead of bcomp Here's a snippet of my mercurial.ini 我必须使用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

Beyond-Compare-3 is an amazing tool. Beyond-Compare-3是一个了不起的工具。 I recommend a few tweaks to the setup: 我建议对设置进行一些调整:

[extensions]
extdiff =

[extdiff]
cmd.bcomp = C:\Program Files\Beyond Compare 3\BCompare.exe
opts.bcomp = /leftreadonly

[merge-tools]
bcomp.executable = C:\Program Files\Beyond Compare 3\BComp
bcomp.args = /leftreadonly /centerreadonly $local $other $base $output
bcomp.priority = 1

[ui]
merge = bcomp

[tortoisehg]
authorcolor = True
vdiff = bcomp

Personally I found that the best Beyond Compare config can be found in the Mercurial mergetools.rc file file: 我个人发现最好的Beyond Compare配置可以在Mercurial mergetools.rc file找到:

[merge-tools]
....
; Windows version of Beyond Compare
beyondcompare3.args=$local $other $base $output /ro /lefttitle=local /centertitle=base /righttitle=other /automerge /reviewconflicts /solo
beyondcompare3.regkey=Software\Scooter Software\Beyond Compare 3
beyondcompare3.regname=ExePath
beyondcompare3.gui=True
beyondcompare3.priority=-2
beyondcompare3.diffargs=/lro /lefttitle='$plabel1' /righttitle='$clabel' /solo /expandall $parent $child

I also found that it is important to NOT include Beyond Compare in extdiff section so it will use beyondcompare3 from the merge-tools section with diffargs arguments. 我还发现, 包括超越比较重要的是extdiff部分,因此它会使用beyondcompare3merge-toolsdiffargs参数。 (I have beyondcompare3 specified in both ui.merge and tortoisehg.vdiff ) (我已经beyondcompare3在同时指定ui.mergetortoisehg.vdiff

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, ie: 如果你不断从BC获得这个“文件夹不可用”错误(我做了,当我同时打开几个BC实例时),尝试在命令行中添加选项/solo ,即:

[extdiff]
cmd.bcomp = C:\Program Files\Beyond Compare 3\BCompare.exe
opts.bcomp = /leftreadonly /solo

Source: Scooter Software support forum 资料来源: Scooter Software支持论坛

Checkout this page from the Scooter Software support page - it also includes settings for most version control systems - one for my bookmarks list! 从Scooter软件支持页面查看此页面 - 它还包括大多数版本控制系统的设置 - 一个用于我的书签列表!

Snippet: 片段:

To configure Mercurial you need to edit the file %USERPROFILE%\\Mercurial.ini or $HOME/.hgrc. 要配置Mercurial,您需要编辑文件%USERPROFILE%\\ Mercurial.ini或$ HOME / .hgrc。 Add the following lines, using existing INI sections if they already exist: 使用现有的INI部分添加以下行(如果它们已存在):

Diff DIFF

[extensions] extdiff =

[extdiff] 
cmd.bcomp = C:\Program Files\Beyond Compare 3\BCompare.exe
opts.bcomp = /ro

[tortoisehg] vdiff = bcomp 

Once set up you can compare revisions from the command line using 设置完成后,您可以使用命令行比较修订版本

hg bcomp -r <rev1> [-r <rev2>] [<filename>]

3-Way Merge (v3 Pro) 3合并(v3 Pro)

[merge-tools] 
bcomp.executable = C:\Program Files\Beyond Compare 3\BComp 
bcomp.args = $local $other
$base $output bcomp.priority = 1
bcomp.premerge = True bcomp.gui = True

[ui] merge = bcomp

I had to add the following to make it work on my machine: 我必须添加以下内容才能使其在我的机器上运行:

[extensions]
extdiff =

[extdiff]
cmd.bc3 = C:\Program Files\Beyond Compare 3\BCompare.exe
opts.bc3 = /ro

I tried the suggestions given at the time but none worked. 我尝试了当时给出的建议但没有成功。

I found the following works: 我找到了以下作品:

  1. Add beyond compare install directory to the yor system path 添加超出比较安装目录到yor系统path
  2. Open the global settings and set the diff tools to bcompare 打开全局设置并将diff工具设置为bcompare

Now try a diff - Beyond Compare! 现在尝试差异 - 超越比较!

All the answers given so far are for Windows. 到目前为止给出的所有答案都适用于Windows。 Here is my configuration for those using Linux. 这是我使用Linux的配置。

Diff DIFF

[extensions]
extdiff =

[extdiff]
cmd.bcomp = bcompare
opts.bcomp = -ro1

4-Way Merge (v3 Pro) 4路合并(v3 Pro)

[merge-tools]
bcomp.executable = bcompare
bcomp.args = -title1='First Parent' -title2='Second Parent' -title3='Common Ancestor' -title4='Output' -ro1 -ro2 -ro3 $local $other $base $output
bcomp.premerge = True
bcomp.gui = True

-ro# : Disables editing on specified side -ro# :禁用指定端的编辑

-title#=<title> : Shows description instead of filename in path edit -title#=<title> :在路径编辑中显示描述而不是文件名

# character: 1=Left, 2=Right, 3=Center, 4=Output #字符:1 =左,2 =右,3 =中心,4 =输出

For more options of bcompare , simply execute bcompare -help in console. 有关bcompare更多选项,只需在控制台中执行bcompare -help即可。

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. 如果您使用的是TortoiseHg,可以通过选择File - > Settings将合并工具设置为Beyond Compare,然后在TortoiseHg选项中选择Visual Diff Tool和Three-way Merge Tool。 This setting affects merges which are set through the command line as well. 此设置也会影响通过命令行设置的合并。

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. 它刚刚结束,在许多变量之前添加了空格,导致它不解析。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM