changeset 24247:6e19516094a3

patch.applydiff: accept a prefix parameter This is preparation for upcoming patches that will add support for applying a patch within a subdirectory.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 06 Mar 2015 22:24:49 -0800
parents 394a91cb3d4a
children 913347bcd59c
files mercurial/patch.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Fri Mar 06 22:22:14 2015 -0800
+++ b/mercurial/patch.py	Fri Mar 06 22:24:49 2015 -0800
@@ -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'):