Show More
@@ -620,7 +620,7 b' class queue(object):' | |||||
620 | files = {} |
|
620 | files = {} | |
621 | try: |
|
621 | try: | |
622 | fuzz = patchmod.patch(self.ui, repo, patchfile, strip=1, |
|
622 | fuzz = patchmod.patch(self.ui, repo, patchfile, strip=1, | |
623 |
|
|
623 | files=files, eolmode=None) | |
624 | return (True, list(files), fuzz) |
|
624 | return (True, list(files), fuzz) | |
625 | except Exception, inst: |
|
625 | except Exception, inst: | |
626 | self.ui.note(str(inst) + '\n') |
|
626 | self.ui.note(str(inst) + '\n') |
@@ -227,8 +227,7 b' class transplanter(object):' | |||||
227 | if patchfile: |
|
227 | if patchfile: | |
228 | try: |
|
228 | try: | |
229 | files = {} |
|
229 | files = {} | |
230 |
patch.patch(self.ui, repo, patchfile, |
|
230 | patch.patch(self.ui, repo, patchfile, files=files, eolmode=None) | |
231 | files=files, eolmode=None) |
|
|||
232 | files = list(files) |
|
231 | files = list(files) | |
233 | if not files: |
|
232 | if not files: | |
234 | self.ui.warn(_('%s: empty changeset') % revlog.hex(node)) |
|
233 | self.ui.warn(_('%s: empty changeset') % revlog.hex(node)) |
@@ -3105,8 +3105,8 b' def import_(ui, repo, patch1, *patches, ' | |||||
3105 | repo.dirstate.setbranch(branch or 'default') |
|
3105 | repo.dirstate.setbranch(branch or 'default') | |
3106 |
|
3106 | |||
3107 | files = {} |
|
3107 | files = {} | |
3108 |
patch.patch(ui, repo, tmpname, strip=strip, |
|
3108 | patch.patch(ui, repo, tmpname, strip=strip, files=files, | |
3109 |
|
|
3109 | eolmode=None, similarity=sim / 100.0) | |
3110 | files = list(files) |
|
3110 | files = list(files) | |
3111 | if opts.get('no_commit'): |
|
3111 | if opts.get('no_commit'): | |
3112 | if message: |
|
3112 | if message: |
@@ -1281,13 +1281,14 b' def _applydiff(ui, fp, patcher, backend,' | |||||
1281 | return -1 |
|
1281 | return -1 | |
1282 | return err |
|
1282 | return err | |
1283 |
|
1283 | |||
1284 |
def _externalpatch(ui, repo, patcher, patchname, strip, |
|
1284 | def _externalpatch(ui, repo, patcher, patchname, strip, files, | |
1285 | similarity): |
|
1285 | similarity): | |
1286 | """use <patcher> to apply <patchname> to the working directory. |
|
1286 | """use <patcher> to apply <patchname> to the working directory. | |
1287 | returns whether patch was applied with fuzz factor.""" |
|
1287 | returns whether patch was applied with fuzz factor.""" | |
1288 |
|
1288 | |||
1289 | fuzz = False |
|
1289 | fuzz = False | |
1290 | args = [] |
|
1290 | args = [] | |
|
1291 | cwd = repo.root | |||
1291 | if cwd: |
|
1292 | if cwd: | |
1292 | args.append('-d %s' % util.shellquote(cwd)) |
|
1293 | args.append('-d %s' % util.shellquote(cwd)) | |
1293 | fp = util.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, |
|
1294 | fp = util.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, | |
@@ -1355,7 +1356,7 b' def internalpatch(ui, repo, patchobj, st' | |||||
1355 | raise PatchError(_('patch failed to apply')) |
|
1356 | raise PatchError(_('patch failed to apply')) | |
1356 | return ret > 0 |
|
1357 | return ret > 0 | |
1357 |
|
1358 | |||
1358 |
def patch(ui, repo, patchname, strip=1, |
|
1359 | def patch(ui, repo, patchname, strip=1, files=None, eolmode='strict', | |
1359 | similarity=0): |
|
1360 | similarity=0): | |
1360 | """Apply <patchname> to the working directory. |
|
1361 | """Apply <patchname> to the working directory. | |
1361 |
|
1362 | |||
@@ -1374,7 +1375,7 b' def patch(ui, repo, patchname, strip=1, ' | |||||
1374 | try: |
|
1375 | try: | |
1375 | if patcher: |
|
1376 | if patcher: | |
1376 | return _externalpatch(ui, repo, patcher, patchname, strip, |
|
1377 | return _externalpatch(ui, repo, patcher, patchname, strip, | |
1377 |
|
|
1378 | files, similarity) | |
1378 | return internalpatch(ui, repo, patchname, strip, files, eolmode, |
|
1379 | return internalpatch(ui, repo, patchname, strip, files, eolmode, | |
1379 | similarity) |
|
1380 | similarity) | |
1380 | except PatchError, err: |
|
1381 | except PatchError, err: |
General Comments 0
You need to be logged in to leave comments.
Login now