Patchwork [1,of,2] help: make listexts less confusing for deprecated exts

login
register
mail settings
Submitter timeless@mozdev.org
Date Nov. 30, 2015, 8:46 p.m.
Message ID <fa1770fa3f4097e2826e.1448916376@waste.org>
Download mbox | patch
Permalink /patch/11684/
State Accepted
Headers show

Comments

timeless@mozdev.org - Nov. 30, 2015, 8:46 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1448916262 0
#      Mon Nov 30 20:44:22 2015 +0000
# Node ID fa1770fa3f4097e2826e8d5f978a324a280ec7ac
# Parent  61fbf5dc12b23e7a2a30cf04ebd9f096c42a1f61
help: make listexts less confusing for deprecated exts

Return an empty array instead of a heading and no items

Patch

diff --git a/mercurial/help.py b/mercurial/help.py
--- a/mercurial/help.py
+++ b/mercurial/help.py
@@ -27,11 +27,12 @@ 
     '''return a text listing of the given extensions'''
     rst = []
     if exts:
-        rst.append('\n%s\n\n' % header)
         for name, desc in sorted(exts.iteritems()):
             if not showdeprecated and any(w in desc for w in _exclkeywords):
                 continue
             rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
+    if rst:
+        rst.insert(0, '\n%s\n\n' % header)
     return rst
 
 def extshelp(ui):