Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 7632:9626819b2e3d
refactor version code
- simplify version detection code
- move detection code into setup.py
- move version reading function into util.py
- drop version.py code
This makes hg more closely follow its own recommendation of how to deal with
versioning your builds: use hg id in your build script.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 10 Jan 2009 18:02:38 -0600 |
parents | 9c6ae2e09e11 |
children | 08cabecfa8a8 |
comparison
equal
deleted
inserted
replaced
7631:0b2ee57dfdb1 | 7632:9626819b2e3d |
---|---|
9 from repo import RepoError, NoCapability | 9 from repo import RepoError, NoCapability |
10 from i18n import _, gettext | 10 from i18n import _, gettext |
11 import os, re, sys | 11 import os, re, sys |
12 import hg, util, revlog, bundlerepo, extensions, copies, context | 12 import hg, util, revlog, bundlerepo, extensions, copies, context |
13 import difflib, patch, time, help, mdiff, tempfile, url | 13 import difflib, patch, time, help, mdiff, tempfile, url |
14 import version | |
15 import archival, changegroup, cmdutil, hgweb.server, sshserver, hbisect | 14 import archival, changegroup, cmdutil, hgweb.server, sshserver, hbisect |
16 import merge as merge_ | 15 import merge as merge_ |
17 | 16 |
18 # Commands start here, listed alphabetically | 17 # Commands start here, listed alphabetically |
19 | 18 |
2959 return hg.verify(repo) | 2958 return hg.verify(repo) |
2960 | 2959 |
2961 def version_(ui): | 2960 def version_(ui): |
2962 """output version and copyright information""" | 2961 """output version and copyright information""" |
2963 ui.write(_("Mercurial Distributed SCM (version %s)\n") | 2962 ui.write(_("Mercurial Distributed SCM (version %s)\n") |
2964 % version.get_version()) | 2963 % util.version()) |
2965 ui.status(_( | 2964 ui.status(_( |
2966 "\nCopyright (C) 2005-2008 Matt Mackall <mpm@selenic.com> and others\n" | 2965 "\nCopyright (C) 2005-2008 Matt Mackall <mpm@selenic.com> and others\n" |
2967 "This is free software; see the source for copying conditions. " | 2966 "This is free software; see the source for copying conditions. " |
2968 "There is NO\nwarranty; " | 2967 "There is NO\nwarranty; " |
2969 "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" | 2968 "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" |