comparison mercurial/patch.py @ 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 0bd17a4bed88
children d7829b2ecf32
comparison
equal deleted inserted replaced
15970:9f2ed48f8cda 15971:089ee59a8658
1800 if line.startswith('diff --git'): 1800 if line.startswith('diff --git'):
1801 filename = gitre.search(line).group(1) 1801 filename = gitre.search(line).group(1)
1802 elif line.startswith('diff -r'): 1802 elif line.startswith('diff -r'):
1803 # format: "diff -r ... -r ... filename" 1803 # format: "diff -r ... -r ... filename"
1804 filename = diffre.search(line).group(1) 1804 filename = diffre.search(line).group(1)
1805 elif line.startswith('+') and not line.startswith('+++'): 1805 elif line.startswith('+') and not line.startswith('+++ '):
1806 adds += 1 1806 adds += 1
1807 elif line.startswith('-') and not line.startswith('---'): 1807 elif line.startswith('-') and not line.startswith('--- '):
1808 removes += 1 1808 removes += 1
1809 elif (line.startswith('GIT binary patch') or 1809 elif (line.startswith('GIT binary patch') or
1810 line.startswith('Binary file')): 1810 line.startswith('Binary file')):
1811 isbinary = True 1811 isbinary = True
1812 addresult() 1812 addresult()