#23 Added support for Mercurial (hg) source control.


Added support for Mercurial (hg) source control. Mercurial is an
open-source distributed source control system, conceptually similar to
Git, Bazaar (bzr), Darcs, and the commercial system BitKeeper
(which tkdiff already supports).

While Mercurial already comes with a tkdiff wrapper called "hgdiff",
this script does not support arbitrary revisions in the way that the
actual hg diff command does (e.g. "hg diff -r2 -r5 filename). This
patch gives tkdiff support for all the revision numbers that "hg diff"

The code changes are small and mostly boilerplate, but I did add one
new procedure called "is-mercurial-repository". This was added
because mercurial uses a single ".hg" directory at the top-level
directory of a repository rather than having a directory at each
different directory inside the repository. The new procedure simply
traverses up the parent directories until it either finds a .hg
directory (indicating that we're in a Mercurial repository) or hits
the root directory (indicating that we're not).

Since the list of supported source control systems is getting large, I
alphabetized the list in the command-line help text and also modified
other parts of this help text to say things like "RCS, CVS, etc."
rather than exhaustively listing all the supported systems yet again.

More information on Mercurial can be found at
http://www.selenic.com/mercurial/wiki/ and


  • Damon McCormick

    Damon McCormick - 2008-01-09

    tkdiff-hg.patch based on tkdiff 4.14 revision 1.48

  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2011-03-14
    Last edit: Anonymous 2016-11-12
  • Buck

    Buck - 2011-03-14

    I don't find an 'hgdiff' command in my installation. I'm using this patch instead.

  • DorothyR

    DorothyR - 2011-09-11
    • status: open --> pending-accepted
  • Christoph Junghans

    We apply this patch to tkdiff-4.1.4 in Gentoo Linux since 23 Dec 2008 and have no reported problems so far!

    It is also much better than my dirty hack (ID: 2144602).

  • DorothyR

    DorothyR - 2011-12-03
    • status: pending-accepted --> closed-accepted

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks