[PATCH] commands: hide deprecated commands

Dan Villiom Podlaski Christiansen danchr at gmail.com
Fri Jul 10 07:56:16 CDT 2009


# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1247226025 -7200
# Node ID f65b5f3acd462d1196988990095895302ecb35f9
# Parent  e45bb665ca74852c2a21c7a0e5f334c5955c9649
commands: hide deprecated commands.

A command is considered deprectaed if a the first line of the doc
string contains "DEPRECATED". Such commands are hidden from
non-verbose help.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1473,7 +1473,10 @@ def help_(ui, name=None, with_version=Fa
             f = f.lstrip("^")
             if not ui.debugflag and f.startswith("debug"):
                 continue
-            doc = gettext(e[0].__doc__)
+            doc = e[0].__doc__
+            if not ui.verbose and 'DEPRECATED' in doc.splitlines(0)[0]:
+                continue
+            doc = gettext(doc)
             if not doc:
                 doc = _("(no help text available)")
             h[f] = doc.splitlines(0)[0].rstrip()


More information about the Mercurial-devel mailing list