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