Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7195623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:36:56+00:00 2026-05-28T20:36:56+00:00

Using Windows, Mercurial, and the extdiff extension (for Mercurial). I was trying to set

  • 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 <my_real@email.address>
editor = D:\Documents\apps\Notepad++\notepad++.exe -multiInst

[extensions]
hgext.graphlog = 
hgext.extdiff = 

[extdiff]
cmd.winmerge = d:\Documents\apps\mercurial\diff_winmerge.bat
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:36:57+00:00Added an answer on May 28, 2026 at 8:36 pm

    I can confirm that extdiff will change to a temporary directory before starting your diff program. You can use --debug to see this. Here I’m using true as the diff program (it just exist immediately):

    $ hg extdiff -p true --debug
    making snapshot of 2 files from rev 18480437f81b
      a
      b
    making snapshot of 2 files from working directory
      a
      b
    running "'true'  'foo.18480437f81b' 'foo'" in /tmp/extdiff.IJ9clg
    cleaning up temp directory
    

    The two arguments for the diff program are directories: a snapshot directory for the old versions and one for the new versions. They are inside the /tmp/extdiff.IJ9clg temporary directory.

    One confusing point is that the arguments for the diff program are different depending on the number of modified files. With just one modified file, there is no need to create a
    snapshot of the working copy. So if a is the only modified file, you’ll see

    $ hg extdiff -p true --debug
    making snapshot of 1 files from rev 18480437f81b
      a
    running "'true'  '/tmp/extdiff.mUlnP_/foo.18480437f81b/a' '/home/mg/tmp/foo/a'"
    in /tmp/extdiff.mUlnP_
    cleaning up temp directory
    

    Here the diff program was started with two files as arguments. As described in hg help -e extdiff, you can use some variables to build the command line. The default corresponds to $parent $child.

    You say that WinMerge “cannot find the files correctly”. There are other questions and answers on SO about WinMerge and they seem to have it working just fine. Maybe you can try their command line options.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using Mercurial for a little while, but mainly for my own use.
I'm trying to configure Mercurial for use with both a windows server (freeSSHd) and
I'm using Mercurial on Windows for a cross-platform project, with the eol extension to
I'm using Mercurial (specifically TortoiseHg on Windows) to do version control of VBA code.
I have Mercurial hgweb set up on Windows 2008 64 bit and IIS. The
We are currently using Subversion (on Windows) for our source control but we examine
I’m trying to convert an existing Windows CVS repository to Mercurial and getting the
I'm in the middle of trying to get mercurial working on a windows build
I am using Mercurial under Windows XP (using the TortoiseHg distribution) and I want
I'm using Mercurial 1.7.2 Windows I have a local repo where I copied some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.