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