diff mercurial/copies.py @ 44197:17e12938f8e7

copies: print debug information about copies per side/branch Differential Revision: https://phab.mercurial-scm.org/D7987
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 24 Jan 2020 10:39:55 -0800
parents 6ca9f45b32b0
children 7f8bdee0034e
line wrap: on
line diff
--- a/mercurial/copies.py	Wed Jan 22 15:31:17 2020 -0800
+++ b/mercurial/copies.py	Fri Jan 24 10:39:55 2020 -0800
@@ -630,9 +630,6 @@
     if u2:
         repo.ui.debug(b"%s:\n   %s\n" % (header % b'other', b"\n   ".join(u2)))
 
-    fullcopy = copies1.copy()
-    fullcopy.update(copies2)
-
     if repo.ui.debugflag:
         renamedeleteset = set()
         divergeset = set()
@@ -647,17 +644,21 @@
             b"  all copies found (* = to merge, ! = divergent, "
             b"% = renamed and deleted):\n"
         )
-        for f in sorted(fullcopy):
-            note = b""
-            if f in copy1 or f in copy2:
-                note += b"*"
-            if f in divergeset:
-                note += b"!"
-            if f in renamedeleteset:
-                note += b"%"
-            repo.ui.debug(
-                b"   src: '%s' -> dst: '%s' %s\n" % (fullcopy[f], f, note)
-            )
+        for side, copies in ((b"local", copies1), (b"remote", copies2)):
+            if not copies:
+                continue
+            repo.ui.debug(b"   on %s side:\n" % side)
+            for f in sorted(copies):
+                note = b""
+                if f in copy1 or f in copy2:
+                    note += b"*"
+                if f in divergeset:
+                    note += b"!"
+                if f in renamedeleteset:
+                    note += b"%"
+                repo.ui.debug(
+                    b"    src: '%s' -> dst: '%s' %s\n" % (copies[f], f, note)
+                )
         del renamedeleteset
         del divergeset