views:

2132

answers:

7

Hi,
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 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
+1  A: 

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
mrrage
I don't use absolute path coz I set the bc3 path in windows environment path
mhd
+15  A: 

Beyond-Compare-3 is an amazing tool. I recommend a few tweaks to the setup:

[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
refack
Can you explain what does " opts.bcomp = /leftreadonly" does ?
Ibn Saeed
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.
refack
When using the linux version of BCompare, be sure to prefix your arguments with -- (--leftreadonly).
miracle2k
A: 

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

A: 

http://superuser.com/questions/23576/how-to-use-winmerge-as-the-diff-tool-for-mercurial/137669#137669

(btw what's the relation between stackoverflow and superuser?)

+1  A: 

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
MPritch
+1  A: 

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!

Oliver
+1  A: 

Personally I found that the best Beyond Compare config can be found in the Mercurial contrib selenic.com\repo\hg\contrib\mergetools.hgrc 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)

Regent