# HG changeset patch # User Thomas Arendsen Hein # Date 1258560540 -3600 # Node ID a1886801d4660e12bcf37da2e7b5036784faa3e5 # Parent d266aa7606ce82fa926a1d3389453d7cb7b8f200# Parent 7bb004fc14ecadc355cf5a65b9b055ffe7ef0f92 merge with crew-stable diff -r 7bb004fc14ec -r a1886801d466 mercurial/dispatch.py --- a/mercurial/dispatch.py Wed Nov 18 16:47:20 2009 +0100 +++ b/mercurial/dispatch.py Wed Nov 18 17:09:00 2009 +0100 @@ -200,6 +200,12 @@ self.args = aliasargs(self.fn) + args if cmd not in commands.norepo.split(' '): self.norepo = False + if self.help.startswith("hg " + cmd): + # drop prefix in old-style help lines so hg shows the alias + self.help = self.help[4 + len(cmd):] + self.__doc__ = _("alias for: hg %s\n\n%s") \ + % (definition, self.fn.__doc__) + except error.UnknownCommand: def fn(ui, *args): ui.warn(_("alias '%s' resolves to unknown command '%s'\n") \ @@ -240,14 +246,14 @@ if args: cmd, args = args[0], args[1:] - aliases, i = cmdutil.findcmd(cmd, commands.table, + aliases, entry = cmdutil.findcmd(cmd, commands.table, ui.config("ui", "strict")) cmd = aliases[0] - args = aliasargs(i[0]) + args + args = aliasargs(entry[0]) + args defaults = ui.config("defaults", cmd) if defaults: args = map(util.expandpath, shlex.split(defaults)) + args - c = list(i[1]) + c = list(entry[1]) else: cmd = None c = [] @@ -267,7 +273,7 @@ options[n] = cmdoptions[n] del cmdoptions[n] - return (cmd, cmd and i[0] or None, args, options, cmdoptions) + return (cmd, cmd and entry[0] or None, args, options, cmdoptions) def _parseconfig(ui, config): """parse the --config options from the command line"""