copies: make debug messages more sensible
authorSiddharth Agarwal <sid0@fb.com>
Wed, 26 Dec 2012 15:03:58 -0800
changeset 18135 a6fe1b9cc68f
parent 18134 6c35b53cd28b
child 18136 f23dea2b296e
copies: make debug messages more sensible The -> in debug messages is currently overloaded to mean both source to dest and dest to source. To fix this, we add explicit labels and make the arrow direction consistent.
mercurial/copies.py
tests/test-copy-move-merge.t
tests/test-double-merge.t
tests/test-graft.t
tests/test-issue672.t
tests/test-rename-dir-merge.t
tests/test-rename-merge1.t
tests/test-rename-merge2.t
--- a/mercurial/copies.py	Wed Dec 26 14:50:17 2012 -0800
+++ b/mercurial/copies.py	Wed Dec 26 15:03:58 2012 -0800
@@ -318,7 +318,8 @@
                 note += "!"
             if f in renamedelete2:
                 note += "%"
-            repo.ui.debug("   %s -> %s %s\n" % (f, fullcopy[f], note))
+            repo.ui.debug("   src: '%s' -> dst: '%s' %s\n" % (fullcopy[f], f,
+                                                              note))
     del diverge2
 
     if not fullcopy:
@@ -362,7 +363,8 @@
         return copy, movewithdir, diverge, renamedelete
 
     for d in dirmove:
-        repo.ui.debug("  dir %s -> %s\n" % (d, dirmove[d]))
+        repo.ui.debug("   discovered dir src: '%s' -> dst: '%s'\n" %
+                      (d, dirmove[d]))
 
     # check unaccounted nonoverlapping files against directory moves
     for f in u1 + u2:
@@ -373,7 +375,8 @@
                     df = dirmove[d] + f[len(d):]
                     if df not in copy:
                         movewithdir[f] = df
-                        repo.ui.debug("  file %s -> %s\n" % (f, df))
+                        repo.ui.debug(("   pending file src: '%s' -> "
+                                       "dst: '%s'\n") % (f, df))
                     break
 
     return copy, movewithdir, diverge, renamedelete
--- a/tests/test-copy-move-merge.t	Wed Dec 26 14:50:17 2012 -0800
+++ b/tests/test-copy-move-merge.t	Wed Dec 26 15:03:58 2012 -0800
@@ -25,8 +25,8 @@
      b
      c
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     c -> a *
-     b -> a *
+     src: 'a' -> dst: 'c' *
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
--- a/tests/test-double-merge.t	Wed Dec 26 14:50:17 2012 -0800
+++ b/tests/test-double-merge.t	Wed Dec 26 15:03:58 2012 -0800
@@ -30,7 +30,7 @@
     unmatched files in other:
      bar
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     bar -> foo *
+     src: 'foo' -> dst: 'bar' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
--- a/tests/test-graft.t	Wed Dec 26 14:50:17 2012 -0800
+++ b/tests/test-graft.t	Wed Dec 26 15:03:58 2012 -0800
@@ -131,7 +131,7 @@
     unmatched files in local:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a *
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
--- a/tests/test-issue672.t	Wed Dec 26 14:50:17 2012 -0800
+++ b/tests/test-issue672.t	Wed Dec 26 15:03:58 2012 -0800
@@ -29,7 +29,7 @@
     unmatched files in other:
      1a
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     1a -> 1 
+     src: '1' -> dst: '1a' 
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -60,7 +60,7 @@
     unmatched files in local:
      1a
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     1a -> 1 *
+     src: '1' -> dst: '1a' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -83,7 +83,7 @@
     unmatched files in other:
      1a
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     1a -> 1 *
+     src: '1' -> dst: '1a' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
--- a/tests/test-rename-dir-merge.t	Wed Dec 26 14:50:17 2012 -0800
+++ b/tests/test-rename-dir-merge.t	Wed Dec 26 15:03:58 2012 -0800
@@ -31,11 +31,11 @@
      b/a
      b/b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b/a -> a/a 
-     b/b -> a/b 
+     src: 'a/a' -> dst: 'b/a' 
+     src: 'a/b' -> dst: 'b/b' 
     checking for directory renames
-    dir a/ -> b/
-    file a/c -> b/c
+     discovered dir src: 'a/' -> dst: 'b/'
+     pending file src: 'a/c' -> dst: 'b/c'
   resolving manifests
    overwrite: False, partial: False
    ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740
@@ -82,11 +82,11 @@
     unmatched files in other:
      a/c
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b/a -> a/a 
-     b/b -> a/b 
+     src: 'a/a' -> dst: 'b/a' 
+     src: 'a/b' -> dst: 'b/b' 
     checking for directory renames
-    dir a/ -> b/
-    file a/c -> b/c
+     discovered dir src: 'a/' -> dst: 'b/'
+     pending file src: 'a/c' -> dst: 'b/c'
   resolving manifests
    overwrite: False, partial: False
    ancestor: f9b20c0d4c51, local: 397f8b00a740+, remote: ce36d17b18fb
--- a/tests/test-rename-merge1.t	Wed Dec 26 14:50:17 2012 -0800
+++ b/tests/test-rename-merge1.t	Wed Dec 26 15:03:58 2012 -0800
@@ -29,9 +29,9 @@
      b
      b2
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     c2 -> a2 !
-     b -> a *
-     b2 -> a2 !
+     src: 'a2' -> dst: 'c2' !
+     src: 'a' -> dst: 'b' *
+     src: 'a2' -> dst: 'b2' !
     checking for directory renames
    a2: divergent renames -> dr
   resolving manifests
@@ -176,7 +176,7 @@
     unmatched files in other:
      newfile
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     newfile -> file %
+     src: 'file' -> dst: 'newfile' %
     checking for directory renames
    file: rename and delete -> rd
   resolving manifests
--- a/tests/test-rename-merge2.t	Wed Dec 26 14:50:17 2012 -0800
+++ b/tests/test-rename-merge2.t	Wed Dec 26 15:03:58 2012 -0800
@@ -81,7 +81,7 @@
     unmatched files in other:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a *
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -116,7 +116,7 @@
     unmatched files in local:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a *
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -154,7 +154,7 @@
     unmatched files in other:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a *
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -189,7 +189,7 @@
     unmatched files in local:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a *
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -223,7 +223,7 @@
     unmatched files in other:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a 
+     src: 'a' -> dst: 'b' 
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -253,7 +253,7 @@
     unmatched files in local:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a 
+     src: 'a' -> dst: 'b' 
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -280,7 +280,7 @@
     unmatched files in other:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a 
+     src: 'a' -> dst: 'b' 
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -312,7 +312,7 @@
     unmatched files in local:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a 
+     src: 'a' -> dst: 'b' 
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -370,8 +370,8 @@
     unmatched files in other:
      c
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     c -> a !
-     b -> a !
+     src: 'a' -> dst: 'c' !
+     src: 'a' -> dst: 'b' !
     checking for directory renames
    a: divergent renames -> dr
   resolving manifests
@@ -649,7 +649,7 @@
     unmatched files in other:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a *
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -683,7 +683,7 @@
     unmatched files in local:
      b
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a *
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False
@@ -721,7 +721,7 @@
     unmatched files in other:
      c
     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
-     b -> a *
+     src: 'a' -> dst: 'b' *
     checking for directory renames
   resolving manifests
    overwrite: False, partial: False