hg diff and moves

Mads Kiilerich mads at kiilerich.com
Sat Sep 8 23:15:08 UTC 2012


Dave S wrote, On 09/08/2012 11:29 PM:
> I was using hg 1.9-something (what Fedora is still pointing at, it
> seems)

Only if you are using the old Fedora 16. Fedora 17 has 2.2.3. The 
internal Mercurial API used by extensions and tortoisehg is not stable, 
and it is thus not appropriate to update Mercurial as updates in stable 
releases.

> and found myself diffing file X/Y/Z/foo.c with /dev/null
> because I had done
>
> hg move W/foo.c X/Y/Z
>
> and hg diff  -r new -r old wasn't following, and the command doesn't
> seem to have a follow option.    Am I missing understanding how to do
> the the diff, or did perhaps following get added to the more recent
> releases?

Diff will by default use the diff format and it doesn't have a way to 
show renames. Use --git or set [diff] git = True to use the format 
introduced by git that is capable of showing renames.

See also http://mercurial.selenic.com/wiki/GitExtendedDiffFormat .

/Mads



More information about the Mercurial mailing list