From patchwork Tue Jan 26 02:36:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D9870: help: escape ':' (as '\:') when generating command names From: phabricator X-Patchwork-Id: 48179 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Tue, 26 Jan 2021 02:36:55 +0000 marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We need this before we can use ":" in command names. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9870 AFFECTED FILES mercurial/help.py CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -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.