Details
Details
- Reviewers
Alphare - Group Reviewers
hg-reviewers - Commits
- rHG428177ad70b0: help: remove pycompat.iteritems()
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
Alphare |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/help.py (6 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
1a88b4e20849 | ba409ae77c7b | Gregory Szorc | Feb 21 2022, 1:10 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | D12339 ui: use input() directly | |
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
doclines = docs.splitlines() | doclines = docs.splitlines() | ||||
if doclines: | if doclines: | ||||
summary = doclines[0] | summary = doclines[0] | ||||
cmdname = cmdutil.parsealiases(cmd)[0] | cmdname = cmdutil.parsealiases(cmd)[0] | ||||
if filtercmd(ui, cmdname, func, kw, docs): | if filtercmd(ui, cmdname, func, kw, docs): | ||||
continue | continue | ||||
results[b'commands'].append((cmdname, summary)) | results[b'commands'].append((cmdname, summary)) | ||||
for name, docs in itertools.chain( | for name, docs in itertools.chain( | ||||
pycompat.iteritems(extensions.enabled(False)), | extensions.enabled(False).items(), | ||||
pycompat.iteritems(extensions.disabled()), | extensions.disabled().items(), | ||||
): | ): | ||||
if not docs: | if not docs: | ||||
continue | continue | ||||
name = name.rpartition(b'.')[-1] | name = name.rpartition(b'.')[-1] | ||||
if lowercontains(name) or lowercontains(docs): | if lowercontains(name) or lowercontains(docs): | ||||
# extension docs are already translated | # extension docs are already translated | ||||
results[b'extensions'].append((name, docs.splitlines()[0])) | results[b'extensions'].append((name, docs.splitlines()[0])) | ||||
try: | try: | ||||
mod = extensions.load(ui, name, b'') | mod = extensions.load(ui, name, b'') | ||||
except ImportError: | except ImportError: | ||||
# debug message would be printed in extensions.load() | # debug message would be printed in extensions.load() | ||||
continue | continue | ||||
for cmd, entry in pycompat.iteritems(getattr(mod, 'cmdtable', {})): | for cmd, entry in getattr(mod, 'cmdtable', {}).items(): | ||||
if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])): | if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])): | ||||
cmdname = cmdutil.parsealiases(cmd)[0] | cmdname = cmdutil.parsealiases(cmd)[0] | ||||
func = entry[0] | func = entry[0] | ||||
cmddoc = pycompat.getdoc(func) | cmddoc = pycompat.getdoc(func) | ||||
if cmddoc: | if cmddoc: | ||||
cmddoc = gettext(cmddoc).splitlines()[0] | cmddoc = gettext(cmddoc).splitlines()[0] | ||||
else: | else: | ||||
cmddoc = _(b'(no help text available)') | cmddoc = _(b'(no help text available)') |