Show More
@@ -227,14 +227,14 b' def patch(patchname, ui, strip=1, cwd=No' | |||
|
227 | 227 | """apply the patch <patchname> to the working directory. |
|
228 | 228 | a list of patched files is returned""" |
|
229 | 229 | |
|
230 | (dopatch, gitpatches) = readgitpatch(patchname) | |
|
230 | # helper function | |
|
231 | def __patch(patchname): | |
|
232 | """patch and updates the files and fuzz variables""" | |
|
233 | files = {} | |
|
234 | fuzz = False | |
|
231 | 235 | |
|
232 | files = {} | |
|
233 | fuzz = False | |
|
234 | if dopatch: | |
|
235 | if dopatch == 'filter': | |
|
236 | patchname = dogitpatch(patchname, gitpatches, cwd=cwd) | |
|
237 | patcher = util.find_in_path('gpatch', os.environ.get('PATH', ''), 'patch') | |
|
236 | patcher = util.find_in_path('gpatch', os.environ.get('PATH', ''), | |
|
237 | 'patch') | |
|
238 | 238 | args = [] |
|
239 | 239 | if cwd: |
|
240 | 240 | args.append('-d %s' % util.shellquote(cwd)) |
@@ -261,14 +261,24 b' def patch(patchname, ui, strip=1, cwd=No' | |||
|
261 | 261 | ui.warn(pf + '\n') |
|
262 | 262 | printed_file = True |
|
263 | 263 | ui.warn(line + '\n') |
|
264 | ||
|
265 | if dopatch == 'filter': | |
|
266 | os.unlink(patchname) | |
|
267 | ||
|
268 | 264 | code = fp.close() |
|
269 | 265 | if code: |
|
270 | 266 | raise util.Abort(_("patch command failed: %s") % |
|
271 | 267 | util.explain_exit(code)[0]) |
|
268 | return files, fuzz | |
|
269 | ||
|
270 | (dopatch, gitpatches) = readgitpatch(patchname) | |
|
271 | ||
|
272 | if dopatch: | |
|
273 | if dopatch == 'filter': | |
|
274 | patchname = dogitpatch(patchname, gitpatches, cwd=cwd) | |
|
275 | try: | |
|
276 | files, fuzz = __patch(patchname) | |
|
277 | finally: | |
|
278 | if dopatch == 'filter': | |
|
279 | os.unlink(patchname) | |
|
280 | else: | |
|
281 | files, fuzz = {}, False | |
|
272 | 282 | |
|
273 | 283 | for gp in gitpatches: |
|
274 | 284 | files[gp.path] = (gp.op, gp) |
General Comments 0
You need to be logged in to leave comments.
Login now