[Bug 3908] New: copies._tracefiles does not trace from merges correctly

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu Apr 25 11:54:21 CDT 2013


http://bz.selenic.com/show_bug.cgi?id=3908

          Priority: normal
            Bug ID: 3908
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: copies._tracefiles does not trace from merges
                    correctly
          Severity: bug
    Classification: Unclassified
                OS: Mac OS
          Reporter: durham at fb.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.6-rc
         Component: Mercurial
           Product: Mercurial

copies._tracefiles does not find the correct file in the following scenario:

M    merge (file y now has a parent from C and a copy parent from B)
|\
| D  
| |
C |  rename x to y
| |
| B  edit x
|/
A    add file x


copies._tracefile(filenode(y in M), D) looks for the version of y that exists
in D. It does an ancestor walk on y and checks C first. The y node in C does
not appear in D, so that fails. It notices that C.rev() < D.rev() and gives up.
 That's wrong.  It should keep looking and will eventually find the node for x
in B.

Here are repro steps:

hg init foo && cd foo
touch x && hg commit -Am A
echo x > x && hg commit -Am B
hg up 0
hg mv x y && hg commit -m C
hg up 1
touch z && hg commit -Am D
hg merge 2
hg commit -m M
hg diff -r 3 -r 4

Actual output:
diff --git a/x b/x
deleted file mode 100644
--- a/x
+++ /dev/null
@@ -1,1 +0,0 @@
-x
diff --git a/y b/y
new file mode 100644
--- /dev/null
+++ b/y


Expected output:
diff --git a/x b/y
rename from x
rename to y

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list