views:

50

answers:

0

Using Windows, Mercurial, and the extdiff extension (for Mercurial). I was trying to set up extdiff to use WinDiff as an external diff tool, but I think I've narrowed the problem down enough to say that the trouble is before I'm even getting that far.

From what I understand of extdiff, it merely calls your cmd.winmerge program, and passes the necessary directories to it. I'm also working off of some assumptions outlined here (which may or may not be accurate; I'm just learning Mercurial):

http://bitbucket.org/tortoisehg/stable/issue/457/multiple-extdiff-threads-in-one-process-causes-side#comment-36216

which says:

The extdiff (visual diff) extension works like this:

1-Generate temporary directory(ies) for older changesets 
2-run util.system( cwd=tempdir, "yourdiff tool dir1 dir2" ) 
    util.system does: 
        2.1 store cwd; 
        2.2 cd tempdir 
3-run your diff tool, wait for it to exit 
4-cd oldcwd 
5-Then finally extdiff deletes the temp directories. 

The trouble that I'm having is that extdiff doesn't seem to be changing into the temp directory before proceeding, as it appears it is supposed to do in step 2.1 above.

In trying to isolate the problem, I wrote a batch file just to see what the cd was, what was being passed, and how exactly it was being passed. The batch file is as follows:

@echo off
echo %cd%
echo %1
echo %2
D:\Documents\apps\WinMergePortable\App\WinMerge\WinMergeU.exe %1 %2

I then set up extdiff to use this batch file as my extdiff program. This works, but I see that when it echoes %cd%, it's just c:\ , not c:\temp as expected. I've verified that extdiff is creating the temporary files in the proper temporary directories (as it's supposed to per step 1 above; something like c:\temp\extdiff.xxxxxx\someFolder.someChangesetID\file.ext), so I know it's SEEING those directories. It's just not properly changing into them before it's calling WinMerge, so when WinMerge is opened, it doesn't see the temp files (since it's not in the proper working directory).

That's basically where I'm stuck. I don't know where else to go from here. I thought of just putting

cd %tmp%

in my batch file, but that still doesn't grab the extdiff.xxxxx\ subdirectory which extdiff is creating the temp files in.

In summary: :-(


EDIT: Changing the batch file to

@echo off
echo %cd%\extdiff*
echo %1
echo %2
D:\Documents\apps\WinMergePortable\App\WinMerge\WinMergeU.exe %1 %2

seems to make it work (note changed second line), but it still seems a nasty hack to instead of how it's supposed to work. :-\

EDIT: Here is my Mercurial.ini file:

[ui]
username = Tim Skoch <[email protected]>
editor = D:\Documents\apps\Notepad++\notepad++.exe -multiInst

[extensions]
hgext.graphlog = 
hgext.extdiff = 

[extdiff]
cmd.winmerge = d:\Documents\apps\mercurial\diff_winmerge.bat