changeset 15976:d1c74c6151c9 stable

copies: eliminate criss-crosses when chaining Before the copies refactoring, we declared that if a and b were present in source and destination, we ignored copies between them. The refactored code could however report b was a copy of a and vice versa in a situation where we looked for differences between two identical changesets that copy a to b. y / x \ y'
author Matt Mackall <mpm@selenic.com>
date Tue, 24 Jan 2012 17:16:29 -0600
parents 341c58282b25
children c2e6c5ef4555
files mercurial/copies.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Sat Jan 21 21:39:27 2012 -0600
+++ b/mercurial/copies.py	Tue Jan 24 17:16:29 2012 -0600
@@ -99,6 +99,13 @@
         if v in src:
             # file is a copy of an existing file
             t[k] = v
+
+    # remove criss-crossed copies
+    for k, v in t.items():
+        if k in src and v in dst:
+            print "bad", k, v
+            del t[k]
+
     return t
 
 def _tracefile(fctx, actx):