# HG changeset patch # User Martin Geisler # Date 1258499982 -3600 # Node ID d266aa7606ce82fa926a1d3389453d7cb7b8f200 # Parent 6e8a16dd3e304cba005b3498c7d3e6fc1ccac8cb# Parent c51494c538411b4e9c365445a6b0dcaf168e20b0 Merge with stable diff -r c51494c53841 -r d266aa7606ce mercurial/dispatch.py --- a/mercurial/dispatch.py Tue Nov 17 22:16:41 2009 +0100 +++ b/mercurial/dispatch.py Wed Nov 18 00:19:42 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"""