##// END OF EJS Templates
patch: minor cleanup of _applydiff
Mads Kiilerich -
r11021:c47a1cfa default
parent child Browse files
Show More
@@ -1153,8 +1153,8 b' def _applydiff(ui, fp, patcher, copyfn, '
1153 1153 rejects = 0
1154 1154 err = 0
1155 1155 current_file = None
1156 gitpatches = None
1157 opener = util.opener(os.getcwd())
1156 cwd = os.getcwd()
1157 opener = util.opener(cwd)
1158 1158
1159 1159 def closefile():
1160 1160 if not current_file:
@@ -1166,8 +1166,7 b' def _applydiff(ui, fp, patcher, copyfn, '
1166 1166 if state == 'hunk':
1167 1167 if not current_file:
1168 1168 continue
1169 current_hunk = values
1170 ret = current_file.apply(current_hunk)
1169 ret = current_file.apply(values)
1171 1170 if ret >= 0:
1172 1171 changed.setdefault(current_file.fname, None)
1173 1172 if ret > 0:
@@ -1186,13 +1185,11 b' def _applydiff(ui, fp, patcher, copyfn, '
1186 1185 missing=missing, eolmode=eolmode)
1187 1186 except PatchError, err:
1188 1187 ui.warn(str(err) + '\n')
1189 current_file, current_hunk = None, None
1188 current_file = None
1190 1189 rejects += 1
1191 1190 continue
1192 1191 elif state == 'git':
1193 gitpatches = values
1194 cwd = os.getcwd()
1195 for gp in gitpatches:
1192 for gp in values:
1196 1193 if gp.op in ('COPY', 'RENAME'):
1197 1194 copyfn(gp.oldpath, gp.path, cwd)
1198 1195 changed[gp.path] = gp
General Comments 0
You need to be logged in to leave comments. Login now