Using mercurial and beyond compare 3(bc3) as the diff tool?
Asked Answered
C

9

29

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
Ciel answered 27/11, 2008 at 11:30 Comment(1)
thanks for posting, i just ran into thisAchromatism
G
31

Beyond-Compare-3 is an amazing tool. 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
Ginnie answered 27/11, 2008 at 11:30 Comment(3)
Can you explain what does " opts.bcomp = /leftreadonly" does ?Pro
As the switch name states "left read only", it causes the left side to be read only. Since the left side usually displays a historical version (represented by a temporary file) it makes no sense trying to edit it or save it.Ginnie
When using the linux version of BCompare, be sure to prefix your arguments with -- (--leftreadonly).Searching
R
12

Personally I found that the best Beyond Compare config can be found in the Mercurial mergetools.rc file 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. (I have beyondcompare3 specified in both ui.merge and tortoisehg.vdiff)

Roller answered 8/10, 2010 at 18:54 Comment(0)
C
3

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
Clavicembalo answered 31/1, 2009 at 22:2 Comment(1)
I don't use absolute path coz I set the bc3 path in windows environment pathCiel
L
3

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.:

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

Source: Scooter Software support forum

Living answered 21/4, 2010 at 9:28 Comment(1)
Thanks, that totally saved me. What is "Solo" for?Drivein
A
3

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

[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)

[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
Attainture answered 1/7, 2010 at 14:26 Comment(0)
P
1

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
  2. Open the global settings and set the diff tools to bcompare

Now try a diff - Beyond Compare!

Pickering answered 27/7, 2010 at 19:43 Comment(0)
F
1

All the answers given so far are for Windows. Here is my configuration for those using Linux.

Diff

[extensions]
extdiff =

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

4-Way Merge (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

-title#=<title>: Shows description instead of filename in path edit

# character: 1=Left, 2=Right, 3=Center, 4=Output

For more options of bcompare, simply execute bcompare -help in console.

Ferromanganese answered 22/4, 2011 at 19:20 Comment(1)
this opens 3 way merge with 2.10 :(Antistrophe
P
0

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.

Polyhedron answered 22/7, 2011 at 13:49 Comment(0)
G
0

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.

Gallion answered 5/7, 2013 at 15:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.