##// END OF EJS Templates
patch.patchbackend: accept a prefix parameter
Siddharth Agarwal -
r24253:26fa5ff9 default
parent child Browse files
Show More
@@ -1494,7 +1494,8 b' def _externalpatch(ui, repo, patcher, pa'
1494 util.explainexit(code)[0])
1494 util.explainexit(code)[0])
1495 return fuzz
1495 return fuzz
1496
1496
1497 def patchbackend(ui, backend, patchobj, strip, files=None, eolmode='strict'):
1497 def patchbackend(ui, backend, patchobj, strip, prefix, files=None,
1498 eolmode='strict'):
1498 if files is None:
1499 if files is None:
1499 files = set()
1500 files = set()
1500 if eolmode is None:
1501 if eolmode is None:
@@ -1509,7 +1510,7 b' def patchbackend(ui, backend, patchobj, '
1509 except TypeError:
1510 except TypeError:
1510 fp = patchobj
1511 fp = patchobj
1511 try:
1512 try:
1512 ret = applydiff(ui, fp, backend, store, strip=strip,
1513 ret = applydiff(ui, fp, backend, store, strip=strip, prefix=prefix,
1513 eolmode=eolmode)
1514 eolmode=eolmode)
1514 finally:
1515 finally:
1515 if fp != patchobj:
1516 if fp != patchobj:
@@ -1525,12 +1526,12 b' def internalpatch(ui, repo, patchobj, st'
1525 """use builtin patch to apply <patchobj> to the working directory.
1526 """use builtin patch to apply <patchobj> to the working directory.
1526 returns whether patch was applied with fuzz factor."""
1527 returns whether patch was applied with fuzz factor."""
1527 backend = workingbackend(ui, repo, similarity)
1528 backend = workingbackend(ui, repo, similarity)
1528 return patchbackend(ui, backend, patchobj, strip, files, eolmode)
1529 return patchbackend(ui, backend, patchobj, strip, '', files, eolmode)
1529
1530
1530 def patchrepo(ui, repo, ctx, store, patchobj, strip, files=None,
1531 def patchrepo(ui, repo, ctx, store, patchobj, strip, files=None,
1531 eolmode='strict'):
1532 eolmode='strict'):
1532 backend = repobackend(ui, repo, ctx, store)
1533 backend = repobackend(ui, repo, ctx, store)
1533 return patchbackend(ui, backend, patchobj, strip, files, eolmode)
1534 return patchbackend(ui, backend, patchobj, strip, '', files, eolmode)
1534
1535
1535 def patch(ui, repo, patchname, strip=1, files=None, eolmode='strict',
1536 def patch(ui, repo, patchname, strip=1, files=None, eolmode='strict',
1536 similarity=0):
1537 similarity=0):
General Comments 0
You need to be logged in to leave comments. Login now