help: escape ':' (as '\:') when generating command names
We need this before we can use ":" in command names.
Differential Revision: https://phab.mercurial-scm.org/D9870
--- a/mercurial/help.py Mon Jan 25 23:07:56 2021 +0100
+++ b/mercurial/help.py Mon Jan 25 23:08:33 2021 +0100
@@ -829,10 +829,11 @@
def appendcmds(cmds):
cmds = sorted(cmds)
for c in cmds:
+ display_cmd = c
if ui.verbose:
- rst.append(b" :%s: %s\n" % (b', '.join(syns[c]), h[c]))
- else:
- rst.append(b' :%s: %s\n' % (c, h[c]))
+ display_cmd = b', '.join(syns[c])
+ display_cmd = display_cmd.replace(b':', br'\:')
+ rst.append(b' :%s: %s\n' % (display_cmd, h[c]))
if name in (b'shortlist', b'debug'):
# List without categories.