[issue1967] diff misses copies on non new or removed files

Patrick Mézard <bugs@mercurial.selenic.com> at mercurial.selenic.com Patrick Mézard <bugs@mercurial.selenic.com> at mercurial.selenic.com
Sat Jan 2 19:22:43 UTC 2010


New submission from Patrick Mézard <pmezard at gmail.com>:

Given:

@  7 echo c >> c
|
o    6 merge, keep rev 5
|\
| o  5 add a again
| |
| o  4 copy a b
| |
| o  3 rm b
| |
| o  2 echo d >> c
| |
o |  1 echo c >> c
|/
o  0 add a b c


We get:

$ hg diff --git -r2:7 b
diff --git a/b b/b
--- a/b
+++ b/b
@@ -1,1 +1,1 @@
-b
+a

I am surprised there is no copy record. 

It is caused by copies.copies() looking only at the files not in the
intersection of diffed revisions manifests, instead of all files in second
revision. It does not seem to matter for merges (at least non-linear
merges), there is probably additional logic dealing with it. IIRC,
copies.copies() was crafted for merges first, then extended to diff and
status commands, which would explain current situation.

----------
files: test-diff-copies
messages: 11359
nosy: mpm, pmezard
priority: bug
status: unread
title: diff misses copies on non new or removed files
topic: diff

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue1967>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-diff-copies
Type: application/octet-stream
Size: 551 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100102/5b60c98d/attachment.obj>


More information about the Mercurial-devel mailing list