# HG changeset patch # User mpm@selenic.com # Date 1119687399 28800 # Node ID 0ab093b473c5c5ab5f753f4342e0a9e0c12ebfcf # Parent e205194ca7ef204d02d0c5c4083a8fbf8d22f6d8 Fix up version module name and command conflict -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Fix up version module name and command conflict This unties the command name from the function name manifest hash: 926d097f75cbb5eb2464bb253e9a89050c6208bd -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCvRLnywK+sNU5EO8RAvryAJ9RU0PLFOXjjtQjs8UVyOC9wde69gCgrV+G 8jYfMyWwvwsmOM7wMblPGqM= =Acyk -----END PGP SIGNATURE----- diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -134,7 +134,7 @@ def show_changeset(ui, repo, rev=0, chan ui.status("summary: %s\n" % description.splitlines()[0]) ui.status("\n") -def version(ui): +def show_version(ui): """output version and copyright information""" ui.write("Mercurial version %s\n" % version.get_version()) ui.status( @@ -167,18 +167,22 @@ def help(ui, cmd=None): sys.exit(0) else: if not ui.quiet: - version(ui) + show_version(ui) ui.write('\n') ui.write('hg commands:\n\n') h = {} - for e in table.values(): - f = e[0] - if f.__name__.startswith("debug"): continue + for c,e in table.items(): + f = c + aliases = None + if "|" in f: + l = f.split("|") + f, aliases = l[0], l[1:] + if f.startswith("debug"): continue d = "" - if f.__doc__: - d = f.__doc__.splitlines(0)[0].rstrip() - h[f.__name__.rstrip("_")] = d + if e[0].__doc__: + d = e[0].__doc__.splitlines(0)[0].rstrip() + h[f] = d fns = h.keys() fns.sort() @@ -772,7 +776,7 @@ table = { ('C', 'clean', None, 'overwrite locally modified files')], 'hg update [options] [node]'), "verify": (verify, [], 'hg verify'), - "version": (version, [], 'hg version'), + "version": (show_version, [], 'hg version'), } norepo = "init version help debugindex debugindexdot" @@ -815,7 +819,7 @@ def dispatch(args): not options["noninteractive"]) if options["version"]: - version(u) + show_version(u) sys.exit(0) try: