From patchwork Sat Mar 7 08:44:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [6,of,6] patch.applydiff: accept a prefix parameter From: Siddharth Agarwal X-Patchwork-Id: 7922 Message-Id: <8f72509cd5be9c0e9195.1425717888@devbig136.prn2.facebook.com> To: Date: Sat, 7 Mar 2015 00:44:48 -0800 # HG changeset patch # User Siddharth Agarwal # Date 1425709489 28800 # Fri Mar 06 22:24:49 2015 -0800 # Node ID 8f72509cd5be9c0e91954a415de4022b082720c9 # Parent 54900e624fe9e04ab32e5edc6d5c7a8729a18132 patch.applydiff: accept a prefix parameter This is preparation for upcoming patches that will add support for applying a patch within a subdirectory. diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1353,7 +1353,7 @@ raise PatchError(_('unexpected delta opcode 0')) return out -def applydiff(ui, fp, backend, store, strip=1, eolmode='strict'): +def applydiff(ui, fp, backend, store, strip=1, prefix='', eolmode='strict'): """Reads a patch from fp and tries to apply it. Returns 0 for a clean patch, -1 if any rejects were found and 1 if @@ -1364,7 +1364,7 @@ patching then normalized according to 'eolmode'. """ return _applydiff(ui, fp, patchfile, backend, store, strip=strip, - eolmode=eolmode) + prefix=prefix, eolmode=eolmode) def _applydiff(ui, fp, patcher, backend, store, strip=1, prefix='', eolmode='strict'):