Show More
@@ -1366,11 +1366,14 b' def applydiff(ui, fp, backend, store, st' | |||||
1366 | return _applydiff(ui, fp, patchfile, backend, store, strip=strip, |
|
1366 | return _applydiff(ui, fp, patchfile, backend, store, strip=strip, | |
1367 | eolmode=eolmode) |
|
1367 | eolmode=eolmode) | |
1368 |
|
1368 | |||
1369 | def _applydiff(ui, fp, patcher, backend, store, strip=1, |
|
1369 | def _applydiff(ui, fp, patcher, backend, store, strip=1, prefix='', | |
1370 | eolmode='strict'): |
|
1370 | eolmode='strict'): | |
1371 |
|
1371 | |||
|
1372 | if prefix: | |||
|
1373 | # clean up double slashes, lack of trailing slashes, etc | |||
|
1374 | prefix = util.normpath(prefix) + '/' | |||
1372 | def pstrip(p): |
|
1375 | def pstrip(p): | |
1373 |
return pathtransform(p, strip - 1, |
|
1376 | return pathtransform(p, strip - 1, prefix)[1] | |
1374 |
|
1377 | |||
1375 | rejects = 0 |
|
1378 | rejects = 0 | |
1376 | err = 0 |
|
1379 | err = 0 | |
@@ -1393,7 +1396,8 b' def _applydiff(ui, fp, patcher, backend,' | |||||
1393 | if gp.oldpath: |
|
1396 | if gp.oldpath: | |
1394 | gp.oldpath = pstrip(gp.oldpath) |
|
1397 | gp.oldpath = pstrip(gp.oldpath) | |
1395 | else: |
|
1398 | else: | |
1396 |
gp = makepatchmeta(backend, afile, bfile, first_hunk, strip, |
|
1399 | gp = makepatchmeta(backend, afile, bfile, first_hunk, strip, | |
|
1400 | prefix) | |||
1397 | if gp.op == 'RENAME': |
|
1401 | if gp.op == 'RENAME': | |
1398 | backend.unlink(gp.oldpath) |
|
1402 | backend.unlink(gp.oldpath) | |
1399 | if not first_hunk: |
|
1403 | if not first_hunk: |
General Comments 0
You need to be logged in to leave comments.
Login now