Mercurial > hg
changeset 467:9d5447a366a7
Add version command
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Add version command
Suggested by Arun Sharma
manifest hash: 7fc056ffe45ee854f00e76916a560fba28c74a91
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCvQW+ywK+sNU5EO8RAqGQAJ91Eysw4tHVpOB7ICeN9hMF/p+lfQCgksmg
TAKr5VNrw2wIZtSKjgQRqiA=
=8w84
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Fri, 24 Jun 2005 23:20:30 -0800 |
parents | c084cfbb2389 |
children | 157675add351 |
files | mercurial/commands.py tests/test-help.out |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Jun 24 23:17:10 2005 -0800 +++ b/mercurial/commands.py Fri Jun 24 23:20:30 2005 -0800 @@ -134,7 +134,7 @@ ui.status("summary: %s\n" % description.splitlines()[0]) ui.status("\n") -def show_version(ui): +def version(ui): """output version and copyright information""" ui.write("Mercurial version %s\n" % version.get_version()) ui.status( @@ -167,7 +167,7 @@ sys.exit(0) else: if not ui.quiet: - show_version(ui) + version(ui) ui.write('\n') ui.write('hg commands:\n\n') @@ -767,6 +767,7 @@ ('C', 'clean', None, 'overwrite locally modified files')], 'hg update [options] [node]'), "verify": (verify, [], 'hg verify'), + "version": (version, [], 'hg version'), } norepo = "init version help debugindex debugindexdot" @@ -809,7 +810,7 @@ not options["noninteractive"]) if options["version"]: - show_version(u) + version(u) sys.exit(0) try:
--- a/tests/test-help.out Fri Jun 24 23:17:10 2005 -0800 +++ b/tests/test-help.out Fri Jun 24 23:20:30 2005 -0800 @@ -32,6 +32,7 @@ undo undo the last transaction update update or merge working directory verify verify the integrity of the repository + version output version and copyright information + hg add -h hg add: option -h not recognized hg add [files] @@ -81,4 +82,5 @@ undo undo the last transaction update update or merge working directory verify verify the integrity of the repository + version output version and copyright information + exit 0