[PATCH 06 of 10 layering] cmdutil: mark dirstateguard as deprecated
Yuya Nishihara
yuya at tcha.org
Tue Nov 22 09:12:22 EST 2016
On Mon, 21 Nov 2016 22:05:21 -0500, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie at google.com>
> # Date 1479781014 18000
> # Mon Nov 21 21:16:54 2016 -0500
> # Node ID 3c0eded240368fe2c276cbc5f29172e02f37869f
> # Parent fe0b18c02e53589b043cff35f6987fdf63d855fb
> cmdutil: mark dirstateguard as deprecated
>
> I sincerely doubt this is used in external code, as grepping the
> extensions I keep locally (including Facebook's hgexperimental and
> evolve) indicate nobody outside of core uses this. As such, I'd also
> welcome just dropping this name forward entirely.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -3522,4 +3522,9 @@ def wrongtooltocontinue(repo, task):
> hint = after[0]
> raise error.Abort(_('no %s in progress') % task, hint=hint)
>
> -dirstateguard = dirstateguardmod.dirstateguard
> +class dirstateguard(dirstateguardmod.dirstateguard):
> + def __init__(self, repo, name):
> + dirstateguardmod.dirstateguard.__init__(self, repo, name)
> + repo.ui.deprecwarn(
> + 'dirstateguard has moved from cmdutil to dirstateguard',
> + '4.1')
Seems fine to drop it without deprecation (but queued all patches for now.)
More information about the Mercurial-devel
mailing list