# HG changeset patch # User Siddharth Agarwal # Date 1425709489 28800 # Node ID 6e19516094a39aa6e825ef54e89cccd5432a770b # Parent 394a91cb3d4a77b135b72e44f9f52e31c88007d1 patch.applydiff: accept a prefix parameter This is preparation for upcoming patches that will add support for applying a patch within a subdirectory. diff -r 394a91cb3d4a -r 6e19516094a3 mercurial/patch.py --- 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'):