hg diff and moves

15 views
Skip to first unread message

Dave S

unread,
Sep 8, 2012, 5:29:47 PM9/8/12
to mercurial
I was using hg 1.9-something (what Fedora is still pointing at, it
seems) 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?

/dps


--
test signature -- please apply at front gate on Tuesdays only.
_______________________________________________
Mercurial mailing list
Merc...@selenic.com
http://selenic.com/mailman/listinfo/mercurial

Mads Kiilerich

unread,
Sep 8, 2012, 7:15:08 PM9/8/12
to Dave S, mercurial
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

Dave S

unread,
Sep 9, 2012, 2:40:32 AM9/9/12
to Mads Kiilerich, mercurial
On Sat, Sep 8, 2012 at 4:15 PM, Mads Kiilerich <ma...@kiilerich.com> wrote:

[...]
> 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 .
>

Thanks!

/dps


--
test signature -- please apply at front gate on Tuesdays only.
Reply all
Reply to author
Forward
0 new messages