changeset 427:36e644d28edf

Make it possible to specify a version number in setup.py. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Make it possible to specify a version number in setup.py. manifest hash: 905feb305205801eb3833e5a84161fb57b83c86e -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCtc/QW7P1GVgWeRoRAlCaAJ9G2GRf0wIEVEbYNoV4PjV4b024bQCfcUFf WVYQlTXqninDXyKas2yQYdo= =ofg/ -----END PGP SIGNATURE-----
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 19 Jun 2005 21:04:32 +0100
parents 8c90ab5644c9
children 688d03d6997a
files mercurial/version.py setup.py
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/version.py	Sun Jun 19 20:16:10 2005 +0100
+++ b/mercurial/version.py	Sun Jun 19 21:04:32 2005 +0100
@@ -33,10 +33,10 @@
     f.write("version = %r\n" % version)
     f.close()
 
-def remember_version():
+def remember_version(version=None):
     """Store version information."""
     global remembered_version
-    if os.access(".hg", os.F_OK):
+    if not version and os.path.isdir(".hg"):
         f = os.popen("hg identify 2>/dev/null")  # use real hg installation
         ident = f.read()[:-1]
         if not f.close() and ident:
@@ -55,8 +55,9 @@
                         break
             if modified:
                 version += time.strftime('+%Y%m%d')
-            remembered_version = True
-            write_version(version)
+    if version:
+        remembered_version = True
+        write_version(version)
 
 def forget_version():
     """Remove version information."""
--- a/setup.py	Sun Jun 19 20:16:10 2005 +0100
+++ b/setup.py	Sun Jun 19 21:04:32 2005 +0100
@@ -11,6 +11,9 @@
 
 import mercurial.version
 
+# specify version string, otherwise 'hg identify' will be used:
+version = ''
+
 class install_package_data(install_data):
     def finalize_options(self):
         self.set_undefined_options('install',
@@ -18,7 +21,7 @@
         install_data.finalize_options(self)
 
 try:
-    mercurial.version.remember_version()
+    mercurial.version.remember_version(version)
     setup(name='mercurial',
         version=mercurial.version.get_version(),
         author='Matt Mackall',