[issue2744] extdiff: can't follow renames (there is no --git option)

Jason Harris bugs at mercurial.selenic.com
Fri Apr 1 09:16:46 UTC 2011


New submission from Jason Harris <jason at jasonfharris.com>:

After renaming a file in a repository the extdiff extension doesn't take into account past 
versions of the file when doing a diff. In standard mercurial diff with the --git option does take 
account of differences across renames.

Steps:
------------------
# create new repository with an initial file
hg init renamediff-test
cd renamediff-test

echo testing > file1.txt
hg add file1.txt
hg ci -m "Adding file1"

# Now rename file1.txt to file2.txt
hg rename file1.txt file2.txt
hg ci -m "Rename file1 to file2"

# Now if we diff the files we can see that the
# diff is between file1 and file2. Good.
hg diff --git --rev 0:1 file2.txt

# whereas if we introduce some tool mydiff which
# just echos its arguments, we see that extdiff
# is doing the diff between nothing and flie2. Not Good.
hg mydiff --config extensions.extdiff= --config extdiff.mydiff=echo --config defaults.diff=--git -
-rev 0:1 file2.txt
------------------

For output I get:
[Bolt:~/test2/renamediff-test] renamediff-test 1(1)$ hg diff --rev 0:1 file2.txt
diff --git a/file1.txt b/file2.txt
copy from file1.txt
copy to file2.txt

And for the second command I get:
[Bolt:~/test2/renamediff-test] renamediff-test 1(1)$ hg mydiff --config extensions.extdiff= --
config extdiff.mydiff=echo --config defaults.diff=--git --rev 0:1 file2.txt
/dev/null renamediff-test.68d0895160f6/file2.txt

So one can see that the extdiff is not comparing file1.txt (@rev 0) to file2.txt (@rev 1) which 
would be the desired thing.

This came up as a result of some user feedback in MacHg.

Cheers,
  Jas

----------
messages: 15934
nosy: Jason Harris
priority: bug
status: unread
title: extdiff: can't follow renames (there is no --git option)

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2744>
____________________________________________________


More information about the Mercurial-devel mailing list