tags:

views:

64

answers:

3

Here's what I have in my Mercurial.ini ...

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

So, the extdiff extension is working fine except that even when one side of the comparison is my working directory, as in the case where I only give one revision argument, e.g. hg bcomp -r 25 to get a diff between rev25 and the working directory, it causes my diff tool, in this case BC3, to open up a folder comparison session comparing a snapshot of rev25 to a snapshot of the working directory, such as...

left:  C:\Windows\Temp\extdiff.v20d13s\MyCode\ 
right: C:\Windows\Temp\extdiff.q78g269\MyCode\ 

Is there a way for me to tell it to diff against the actual live working directory on the right side so I can edit from inside the diff tool? This seems to work just fine through SVN's external diff functionality. I realize it will display a lot of orphans on the right --I'll be glad to suffer through having to filter those out.

+1  A: 

I've never found a way to prevent extdiff from copying the changed files to the Temp directoy, but if you change them in Beyond Compare, it will copy them back to the working directory when you exit Beyond Compare.

FWIW, this is the relevant piece from my Mercurial.ini:

[extdiff]
cmd.bcomp = C:\Program Files\Beyond Compare 3\BCompare.exe
opts.bcomp =/expandall /solo /lro
Niall C.
You're right. It just works!
leo grrr
This is not bcompare specific, any diff tool that allows in-place edit will do, since it's `extdiff.dodiff` who checks for and copy changed files.
Geoffrey Zheng
A: 

I'm NOT an expert at Mercurial, but I'm having some problems with extdiff as well, and I MAY have inadvertetly found the answer to your question while trying to figure out mine. I may also be completely wrong. ;-)

Anyway, it looks to me like if you explicitly provide a version number to compare against, extdiff takes a snapshot of both versions you're trying to compare (even though you didn't specify BOTH sides of the DIFF; the unspecified side is implicitly the working directory).

The only way I've been able to get extdiff to simply work off of the working directory is to not specify a version to compare to (I guess doing this works off of the tip?).

Sorry I'm not terribly helpful. Hope you find your answer!

loneboat
Have you tried this out yourself? It doesn't work for me, even if I give no args. Yes, No args means a diff of the working directory against the tip.
leo grrr
You're right - I tried it again and wasn't able to get it to work the way I described it. :-( Sorry! Hope you get it working.
loneboat
A: 

extdiff only copies divergent files between the two changesets to the temp dir, so that the diff tool will not show identical files. It'd be nice if it could detect that one version is working copy and just pass the working directory, and any decent diff tool should allow you to ignore identical files.

That's why if you do hg bcomp <file1> -r<rev> you'll indeed see the working copy because there's only one file to diff.

@Niall C's answer is great, but if you're not comfortable with changing temp files, or your diff tool isn't as cool as bcomp, it shouldn't be hard to write a little extension to copy the files from the non-working copy changeset to a temp dir just like extdiff does, then invoke diff tool between the temp dir and your working dir.

Geoffrey Zheng