changeset 15971:089ee59a8658 stable

patch: a little bit more robust line counting on diff --stat (issue3183)
author Jesus Espino Garcia <jesus.espino@kaleidos.net>
date Sat, 21 Jan 2012 23:50:58 +0100
parents 9f2ed48f8cda
children 341c58282b25
files mercurial/patch.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Sat Jan 21 13:31:41 2012 +0100
+++ b/mercurial/patch.py	Sat Jan 21 23:50:58 2012 +0100
@@ -1802,9 +1802,9 @@
             elif line.startswith('diff -r'):
                 # format: "diff -r ... -r ... filename"
                 filename = diffre.search(line).group(1)
-        elif line.startswith('+') and not line.startswith('+++'):
+        elif line.startswith('+') and not line.startswith('+++ '):
             adds += 1
-        elif line.startswith('-') and not line.startswith('---'):
+        elif line.startswith('-') and not line.startswith('--- '):
             removes += 1
         elif (line.startswith('GIT binary patch') or
               line.startswith('Binary file')):