Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/help.py @ 46458:d481f30ea8e3
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
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 25 Jan 2021 23:08:33 +0100 |
parents | c9b2a4d69e66 |
children | d4ba4d51f85f |
comparison
equal
deleted
inserted
replaced
46457:aaff3bc75306 | 46458:d481f30ea8e3 |
---|---|
827 rst.append(_(b'list of commands:\n')) | 827 rst.append(_(b'list of commands:\n')) |
828 | 828 |
829 def appendcmds(cmds): | 829 def appendcmds(cmds): |
830 cmds = sorted(cmds) | 830 cmds = sorted(cmds) |
831 for c in cmds: | 831 for c in cmds: |
832 display_cmd = c | |
832 if ui.verbose: | 833 if ui.verbose: |
833 rst.append(b" :%s: %s\n" % (b', '.join(syns[c]), h[c])) | 834 display_cmd = b', '.join(syns[c]) |
834 else: | 835 display_cmd = display_cmd.replace(b':', br'\:') |
835 rst.append(b' :%s: %s\n' % (c, h[c])) | 836 rst.append(b' :%s: %s\n' % (display_cmd, h[c])) |
836 | 837 |
837 if name in (b'shortlist', b'debug'): | 838 if name in (b'shortlist', b'debug'): |
838 # List without categories. | 839 # List without categories. |
839 appendcmds(h) | 840 appendcmds(h) |
840 else: | 841 else: |