This makes aliases be displayed in "hg help" when they have a :doc config
entry, and also allows them to be assigned to a category with :category.
Details
Details
- Reviewers
durin42 yuja - Group Reviewers
hg-reviewers - Commits
- rHG444861dc1e55: help: displaying documented aliases by default
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Comment Actions
@@ -507,16 +522,11 @@
f = fs[0] syns[f] = ', '.join(fs) func = e[0]+ alias = getattr(func, 'alias', False)
if select and not select(f): continue
- if (not select and name != 'shortlist' and
- func.module != commands.name):
- continue
- if name == "shortlist":
- if not getattr(func, 'helpbasic', False):
- continue doc = pycompat.getdoc(func)
- if filtercmd(ui, f, name, doc):
+ if filtercmd(ui, f, func, name, doc):
This makes extension commands get listed in "hg help". I think that's fine,
but can you split patches so we can backout if that causes problem?
Comment Actions
Queued the series for 4.9, many thanks.
@@ -523,16 +538,20 @@
f = fs[0] syns[f] = ', '.join(fs) func = e[0]+ alias = getattr(func, 'alias', False)
Removed unused variable alias.
@@ -554,11 +557,14 @@
- drop prefix in old-style help lines so hg shows the alias self.help = self.help[4 + len(cmd):]
+ self.owndoc = 'doc' in cfg
doc = cfg.get('doc', pycompat.getdoc(fn)) if doc is not None: doc = pycompat.sysstr(doc) self.__doc__ = doc+ self.helpcategory = cfg.get('category', registrar.command.CATEGORY_NONE)
Maybe the default can be derived from the aliased command?