patch.applydiff: accept a prefix parameter
This is preparation for upcoming patches that will add support for applying a
patch within a subdirectory.
--- 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'):