[PATCH 6 of 6] patch.applydiff: accept a prefix parameter

Augie Fackler raf at durin42.com
Sat Mar 7 11:28:06 CST 2015


On Sat, Mar 07, 2015 at 12:44:48AM -0800, Siddharth Agarwal wrote:
> # 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

These look good and useful, queued.

>
> 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'):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list