diff mercurial/commands.py @ 15775:91eb4512edd0

copies: rewrite copy detection for non-merge users The existing copy detection API was designed with merge in mind and was ill-suited for doing status/diff. The new pathcopies implementation gives more accurate, easier to use results for comparing two revisions, and is much simpler to understand. Test notes: - test-mv-cp-st.t results finds more renames in the reverse direction now - test-mq-merge.t was always wrong and duplicated a copy in diff that was already present in one of the parent revisions
author Matt Mackall <mpm@selenic.com>
date Wed, 04 Jan 2012 17:55:30 -0600
parents 0bd17a4bed88
children 12309c09d19a
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Jan 04 15:48:02 2012 -0600
+++ b/mercurial/commands.py	Wed Jan 04 17:55:30 2012 -0600
@@ -5206,17 +5206,7 @@
     changestates = zip(states, 'MAR!?IC', stat)
 
     if (opts.get('all') or opts.get('copies')) and not opts.get('no_status'):
-        ctx1 = repo[node1]
-        ctx2 = repo[node2]
-        added = stat[1]
-        if node2 is None:
-            added = stat[0] + stat[1] # merged?
-
-        for k, v in copies.pathcopies(ctx1, ctx2).iteritems():
-            if k in added:
-                copy[k] = v
-            elif v in added:
-                copy[v] = k
+        copy = copies.pathcopies(repo[node1], repo[node2])
 
     for state, char, files in changestates:
         if state in show: