Skip to content
Snippets Groups Projects
Commit 012e25ab authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

command: automatically create alias for command using '-' in names

As discussed during the "5.6 Sprint" ignoring dash in command name open the way
to using them more. We can now move existing command to more readable (dash
using) names without breaking any compatibility.

Differential Revision: https://phab.mercurial-scm.org/D9515
parent a42502e9
No related branches found
No related tags found
No related merge requests found
......@@ -359,7 +359,17 @@
def parsealiases(cmd):
return cmd.split(b"|")
base_aliases = cmd.split(b"|")
all_aliases = set(base_aliases)
extra_aliases = []
for alias in base_aliases:
if b'-' in alias:
folded_alias = alias.replace(b'-', b'')
if folded_alias not in all_aliases:
all_aliases.add(folded_alias)
extra_aliases.append(folded_alias)
base_aliases.extend(extra_aliases)
return base_aliases
def setupwrapcolorwrite(ui):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment