# HG changeset patch # User Siddharth Agarwal # Date 1425710627 28800 # Node ID 60c279ab7bd3bb08779cd6c74230d6739a63ebea # Parent 26fa5ff9e660ce4412785b062ef09e638c8fb10e patch.internalpatch: accept a prefix parameter diff -r 26fa5ff9e660 -r 60c279ab7bd3 hgext/record.py --- a/hgext/record.py Fri Mar 06 22:27:41 2015 -0800 +++ b/hgext/record.py Fri Mar 06 22:43:47 2015 -0800 @@ -604,7 +604,7 @@ try: ui.debug('applying patch\n') ui.debug(fp.getvalue()) - patch.internalpatch(ui, repo, fp, 1, eolmode=None) + patch.internalpatch(ui, repo, fp, 1, '', eolmode=None) except patch.PatchError, err: raise util.Abort(str(err)) del fp diff -r 26fa5ff9e660 -r 60c279ab7bd3 mercurial/patch.py --- a/mercurial/patch.py Fri Mar 06 22:27:41 2015 -0800 +++ b/mercurial/patch.py Fri Mar 06 22:43:47 2015 -0800 @@ -1521,12 +1521,12 @@ raise PatchError(_('patch failed to apply')) return ret > 0 -def internalpatch(ui, repo, patchobj, strip, files=None, eolmode='strict', - similarity=0): +def internalpatch(ui, repo, patchobj, strip, prefix, files=None, + eolmode='strict', similarity=0): """use builtin patch to apply 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, prefix, files, eolmode) def patchrepo(ui, repo, ctx, store, patchobj, strip, files=None, eolmode='strict'): @@ -1552,7 +1552,7 @@ if patcher: return _externalpatch(ui, repo, patcher, patchname, strip, files, similarity) - return internalpatch(ui, repo, patchname, strip, files, eolmode, + return internalpatch(ui, repo, patchname, strip, '', files, eolmode, similarity) def changedfiles(ui, repo, patchpath, strip=1):