##// END OF EJS Templates
patch: reindent code
Patrick Mezard -
r14387:e1b4a7a7 default
parent child Browse files
Show More
@@ -1149,22 +1149,23 b' def iterhunks(fp):'
1149 1149 yield 'file', (afile, bfile, h, gp and gp.mode or None)
1150 1150 yield 'hunk', h
1151 1151 elif x.startswith('diff --git'):
1152 # check for git diff, scanning the whole patch file if needed
1153 1152 m = gitre.match(x)
1154 if m:
1155 if not git:
1156 git = True
1157 gitpatches = scangitpatch(lr, x)
1158 for gp in gitpatches:
1159 changed['b/' + gp.path] = gp
1160 yield 'git', gitpatches
1161 afile = 'a/' + m.group(1)
1162 bfile = 'b/' + m.group(2)
1163 gp = changed[bfile]
1164 # copy/rename + modify should modify target, not source
1165 if gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD') or gp.mode:
1166 afile = bfile
1167 newfile = True
1153 if not m:
1154 continue
1155 if not git:
1156 # scan whole input for git metadata
1157 git = True
1158 gitpatches = scangitpatch(lr, x)
1159 for gp in gitpatches:
1160 changed['b/' + gp.path] = gp
1161 yield 'git', gitpatches
1162 afile = 'a/' + m.group(1)
1163 bfile = 'b/' + m.group(2)
1164 gp = changed[bfile]
1165 # copy/rename + modify should modify target, not source
1166 if gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD') or gp.mode:
1167 afile = bfile
1168 newfile = True
1168 1169 elif x.startswith('---'):
1169 1170 # check for a unified diff
1170 1171 l2 = lr.readline()
General Comments 0
You need to be logged in to leave comments. Login now