Problems extracting renames

Yaron Minsky yminsky at janestcapital.com
Wed Feb 6 15:42:19 CST 2008


We've been having some troubles extracting rename information from hg.
The goal is to build tools for generating rename-aware diffs.
Unfortunately, hg seems to be inconsistent in how it reports renames, at
least as far as we can tell.

Our basic approach has been using hg to generate git-style diffs, and
then to parse those to discover the rename information.  Unfortunately,
renames that are seem to be understood by hg (as evidenced by the fact
that merges from the world pre-rename apply correctly to the world
post-rename) do not come up as renames in the output of hg-diff.

Interestingly, in the main tree we're looking at, we've seen that the
rename information shows up in some cases but not others.  In
particular, we have a version history that looks something like this:

A -> B -> C
          ^
          |
          D

Diffing from A to B shows all the renames. But from A to C the renames
don't show up as such, and instead appear as deletes and adds.

Does anyone have a clear idea of how to do this reliably?

y
  

-- 
Yaron Minsky <yminsky at janestcapital.com>



More information about the Mercurial mailing list