[PATCH 6 of 6] patch.applydiff: accept a prefix parameter
Siddharth Agarwal
sid0 at fb.com
Sat Mar 7 02:44:48 CST 2015
# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# 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'):
More information about the Mercurial-devel
mailing list