comparison mercurial/patch.py @ 20972:4e2fb0ad00a9

diff: use second filename for --stat reporting on git patches (issue4221)
author Matt Mackall <mpm@selenic.com>
date Fri, 11 Apr 2014 16:38:55 -0400
parents 9658a79968c6
children bee0e1cffdd3
comparison
equal deleted inserted replaced
20971:557a083453c9 20972:4e2fb0ad00a9
1857 if line.startswith('diff'): 1857 if line.startswith('diff'):
1858 addresult() 1858 addresult()
1859 # set numbers to 0 anyway when starting new file 1859 # set numbers to 0 anyway when starting new file
1860 adds, removes, isbinary = 0, 0, False 1860 adds, removes, isbinary = 0, 0, False
1861 if line.startswith('diff --git a/'): 1861 if line.startswith('diff --git a/'):
1862 filename = gitre.search(line).group(1) 1862 filename = gitre.search(line).group(2)
1863 elif line.startswith('diff -r'): 1863 elif line.startswith('diff -r'):
1864 # format: "diff -r ... -r ... filename" 1864 # format: "diff -r ... -r ... filename"
1865 filename = diffre.search(line).group(1) 1865 filename = diffre.search(line).group(1)
1866 elif line.startswith('+') and not line.startswith('+++ '): 1866 elif line.startswith('+') and not line.startswith('+++ '):
1867 adds += 1 1867 adds += 1