cmdutil: mark dirstateguard as deprecated
authorAugie Fackler <augie@google.com>
Mon, 21 Nov 2016 21:16:54 -0500
changeset 30493 762c8a128357
parent 30492 77cd647b04ac
child 30494 c1149533676b
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.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Mon Nov 21 21:06:34 2016 -0500
+++ b/mercurial/cmdutil.py	Mon Nov 21 21:16:54 2016 -0500
@@ -3522,4 +3522,9 @@
         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')