Patchwork [3,of,3] help: unify handling of DEPRECATED/EXPERIMENTAL keywords

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 26, 2015, 5:31 a.m.
Message ID <32619d6858b3dc8f924f.1443245469@mimosa>
Download mbox | patch
Permalink /patch/10656/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 26, 2015, 5:31 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1443235847 -32400
#      Sat Sep 26 11:50:47 2015 +0900
# Node ID 32619d6858b3dc8f924f40b871badf3cdc75a2a5
# Parent  137a17bb4d921345a0221b1432381358f4898abf
help: unify handling of DEPRECATED/EXPERIMENTAL keywords

This fixes listexts() to exclude translated "(DEPRECATED)" marker correctly.

On the other hand, help_() doesn't need translated keywords, but I don't think
it's worth to separate untranslated keywords just for it.
Pierre-Yves David - Sept. 28, 2015, 9:32 a.m.
On 09/25/2015 10:31 PM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1443235847 -32400
> #      Sat Sep 26 11:50:47 2015 +0900
> # Node ID 32619d6858b3dc8f924f40b871badf3cdc75a2a5
> # Parent  137a17bb4d921345a0221b1432381358f4898abf
> help: unify handling of DEPRECATED/EXPERIMENTAL keywords

All of them pushed to the clowncopter, thanks!

Patch

diff --git a/mercurial/help.py b/mercurial/help.py
--- a/mercurial/help.py
+++ b/mercurial/help.py
@@ -29,7 +29,7 @@  def listexts(header, exts, indent=1, sho
     if exts:
         rst.append('\n%s\n\n' % header)
         for name, desc in sorted(exts.iteritems()):
-            if '(DEPRECATED)' in desc and not showdeprecated:
+            if not showdeprecated and any(w in desc for w in _exclkeywords):
                 continue
             rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
     return rst
@@ -341,7 +341,7 @@  def help_(ui, name, unknowncmd=False, fu
             if not ui.debugflag and f.startswith("debug") and name != "debug":
                 continue
             doc = e[0].__doc__
-            if doc and '(DEPRECATED)' in doc and not ui.verbose:
+            if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
                 continue
             doc = gettext(doc)
             if not doc: