Mercurial > hg-stable
changeset 24253:26fa5ff9e660
patch.patchbackend: accept a prefix parameter
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Fri, 06 Mar 2015 22:27:41 -0800 |
parents | f962692853c0 |
children | 60c279ab7bd3 |
files | mercurial/patch.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/patch.py Tue Mar 10 16:25:10 2015 -0400 +++ b/mercurial/patch.py Fri Mar 06 22:27:41 2015 -0800 @@ -1494,7 +1494,8 @@ util.explainexit(code)[0]) return fuzz -def patchbackend(ui, backend, patchobj, strip, files=None, eolmode='strict'): +def patchbackend(ui, backend, patchobj, strip, prefix, files=None, + eolmode='strict'): if files is None: files = set() if eolmode is None: @@ -1509,7 +1510,7 @@ except TypeError: fp = patchobj try: - ret = applydiff(ui, fp, backend, store, strip=strip, + ret = applydiff(ui, fp, backend, store, strip=strip, prefix=prefix, eolmode=eolmode) finally: if fp != patchobj: @@ -1525,12 +1526,12 @@ """use builtin patch to apply <patchobj> to the working directory. returns whether patch was applied with fuzz factor.""" backend = workingbackend(ui, repo, similarity) - return patchbackend(ui, backend, patchobj, strip, files, eolmode) + return patchbackend(ui, backend, patchobj, strip, '', files, eolmode) def patchrepo(ui, repo, ctx, store, patchobj, strip, files=None, eolmode='strict'): backend = repobackend(ui, repo, ctx, store) - return patchbackend(ui, backend, patchobj, strip, files, eolmode) + return patchbackend(ui, backend, patchobj, strip, '', files, eolmode) def patch(ui, repo, patchname, strip=1, files=None, eolmode='strict', similarity=0):