# HG changeset patch # User Martin von Zweigbergk # Date 2018-04-13 16:19:38 # Node ID 1764527af92e6df8d0407a7bb282e3f401c75553 # Parent 5b8a260769a268c3b7f8ed15aa13a2dfa819825a context: set stack level for deprecation warning This patch makes the deprecation warning print the caller of repo.__getitem__. That's not quite correct, since there could also be other callers of changectx.__init__, but it seems like the most helpful stack level in practice. Differential Revision: https://phab.mercurial-scm.org/D3307 diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -399,7 +399,7 @@ def changectxdeprecwarn(repo): # * If "x" can be a mix of the above, you'll have to figure it out # yourself repo.ui.deprecwarn("changectx.__init__ is getting more limited, see source " - "for details", "4.6") + "for details", "4.6", stacklevel=4) class changectx(basectx): """A changecontext object makes access to data related to a particular