diff: use second filename for --stat reporting on git patches (issue4221)
authorMatt Mackall <mpm@selenic.com>
Fri, 11 Apr 2014 16:38:55 -0400
changeset 20972 4e2fb0ad00a9
parent 20971 557a083453c9
child 20973 55543ee545ab
diff: use second filename for --stat reporting on git patches (issue4221)
mercurial/patch.py
tests/test-glog.t
--- a/mercurial/patch.py	Fri Apr 11 13:43:41 2014 -0400
+++ b/mercurial/patch.py	Fri Apr 11 16:38:55 2014 -0400
@@ -1859,7 +1859,7 @@
             # set numbers to 0 anyway when starting new file
             adds, removes, isbinary = 0, 0, False
             if line.startswith('diff --git a/'):
-                filename = gitre.search(line).group(1)
+                filename = gitre.search(line).group(2)
             elif line.startswith('diff -r'):
                 # format: "diff -r ... -r ... filename"
                 filename = diffre.search(line).group(1)
--- a/tests/test-glog.t	Fri Apr 11 13:43:41 2014 -0400
+++ b/tests/test-glog.t	Fri Apr 11 16:38:55 2014 -0400
@@ -1853,7 +1853,7 @@
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     copy a b
   |
-  |   a |  0
+  |   b |  0
   |   1 files changed, 0 insertions(+), 0 deletions(-)
   |
 
@@ -1886,7 +1886,7 @@
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     copy a b
   |
-  |   a |  0
+  |   b |  0
   |   1 files changed, 0 insertions(+), 0 deletions(-)
   |
   o  changeset:   0:f8035bb17114