Patchwork [2,of,3] copies: make debug messages more sensible

login
register
mail settings
Submitter Siddharth Agarwal
Date Dec. 21, 2012, 9:08 p.m.
Message ID <554d6cba20701d6b4487.1356124102@sid0x220>
Download mbox | patch
Permalink /patch/263/
State Accepted
Commit a6fe1b9cc68f6073b40fea4ad510fe901f90b813
Headers show

Comments

Siddharth Agarwal - Dec. 21, 2012, 9:08 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1356045786 28800
# Node ID 554d6cba20701d6b44870a79389cc89812173aed
# Parent  078b88a00bff61b44f10d71881a95324bf787925
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.
Pierre-Yves David - Dec. 22, 2012, 12:29 a.m.
On 21 d?c. 2012, at 22:08, Siddharth Agarwal wrote:

> # HG changeset patch
> # User Siddharth Agarwal <sid0 at fb.com>
> # Date 1356045786 28800
> # Node ID 554d6cba20701d6b44870a79389cc89812173aed
> # Parent  078b88a00bff61b44f10d71881a95324bf787925
> 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.

Changes seems good, but I would have quote around filename

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -318,7 +318,8 @@  def mergecopies(repo, c1, c2, ca):
                 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 @@  def mergecopies(repo, c1, c2, ca):
         return copy, moveviadirmove, 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 @@  def mergecopies(repo, c1, c2, ca):
                     df = dirmove[d] + f[len(d):]
                     if df not in copy:
                         moveviadirmove[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, moveviadirmove, diverge, renamedelete
diff --git a/tests/test-copy-move-merge.t b/tests/test-copy-move-merge.t
--- a/tests/test-copy-move-merge.t
+++ b/tests/test-copy-move-merge.t
@@ -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
diff --git a/tests/test-double-merge.t b/tests/test-double-merge.t
--- a/tests/test-double-merge.t
+++ b/tests/test-double-merge.t
@@ -30,7 +30,7 @@  we get conflicts that shouldn't be there
     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
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -131,7 +131,7 @@  Graft out of order, skipping a merge and
     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
diff --git a/tests/test-issue672.t b/tests/test-issue672.t
--- a/tests/test-issue672.t
+++ b/tests/test-issue672.t
@@ -29,7 +29,7 @@  http://mercurial.selenic.com/bts/issue67
     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 @@  http://mercurial.selenic.com/bts/issue67
     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 @@  http://mercurial.selenic.com/bts/issue67
     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
diff --git a/tests/test-rename-dir-merge.t b/tests/test-rename-dir-merge.t
--- a/tests/test-rename-dir-merge.t
+++ b/tests/test-rename-dir-merge.t
@@ -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
diff --git a/tests/test-rename-merge1.t b/tests/test-rename-merge1.t
--- a/tests/test-rename-merge1.t
+++ b/tests/test-rename-merge1.t
@@ -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 @@  Check for issue3074
     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
diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -81,7 +81,7 @@  args:
     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 @@  args:
     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 @@  args:
     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 @@  args:
     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 @@  args:
     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 @@  args:
     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 @@  args:
     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 @@  args:
     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 @@  m "um a c" "um x c" "      " "10 do merg
     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 @@  m "um a c" "um x c" "      " "10 do merg
     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 @@  m "um a c" "um x c" "      " "10 do merg
     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 @@  m "nm a b" "um x a" "      " "22 get a, 
     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