##// END OF EJS Templates
Make it possible to specify a version number in setup.py....
Thomas Arendsen Hein -
r427:36e644d2 default
parent child Browse files
Show More
@@ -33,10 +33,10 b' def write_version(version):'
33 f.write("version = %r\n" % version)
33 f.write("version = %r\n" % version)
34 f.close()
34 f.close()
35
35
36 def remember_version():
36 def remember_version(version=None):
37 """Store version information."""
37 """Store version information."""
38 global remembered_version
38 global remembered_version
39 if os.access(".hg", os.F_OK):
39 if not version and os.path.isdir(".hg"):
40 f = os.popen("hg identify 2>/dev/null") # use real hg installation
40 f = os.popen("hg identify 2>/dev/null") # use real hg installation
41 ident = f.read()[:-1]
41 ident = f.read()[:-1]
42 if not f.close() and ident:
42 if not f.close() and ident:
@@ -55,8 +55,9 b' def remember_version():'
55 break
55 break
56 if modified:
56 if modified:
57 version += time.strftime('+%Y%m%d')
57 version += time.strftime('+%Y%m%d')
58 remembered_version = True
58 if version:
59 write_version(version)
59 remembered_version = True
60 write_version(version)
60
61
61 def forget_version():
62 def forget_version():
62 """Remove version information."""
63 """Remove version information."""
@@ -11,6 +11,9 b' from distutils.command.install_data impo'
11
11
12 import mercurial.version
12 import mercurial.version
13
13
14 # specify version string, otherwise 'hg identify' will be used:
15 version = ''
16
14 class install_package_data(install_data):
17 class install_package_data(install_data):
15 def finalize_options(self):
18 def finalize_options(self):
16 self.set_undefined_options('install',
19 self.set_undefined_options('install',
@@ -18,7 +21,7 b' class install_package_data(install_data)'
18 install_data.finalize_options(self)
21 install_data.finalize_options(self)
19
22
20 try:
23 try:
21 mercurial.version.remember_version()
24 mercurial.version.remember_version(version)
22 setup(name='mercurial',
25 setup(name='mercurial',
23 version=mercurial.version.get_version(),
26 version=mercurial.version.get_version(),
24 author='Matt Mackall',
27 author='Matt Mackall',
General Comments 0
You need to be logged in to leave comments. Login now