##// END OF EJS Templates
Don't forget version at the end of setup.py, write it only if changed....
Thomas Arendsen Hein -
r1977:7eb694a1 default
parent child Browse files
Show More
@@ -28,8 +28,15 b' def get_version():'
28
28
29 def write_version(version):
29 def write_version(version):
30 """Overwrite version file."""
30 """Overwrite version file."""
31 filename = os.path.join(os.path.dirname(__file__), '__version__.py')
31 if version == get_version():
32 f = open(filename, 'w')
32 return
33 directory = os.path.dirname(__file__)
34 for suffix in ['py', 'pyc', 'pyo']:
35 try:
36 os.unlink(os.path.join(directory, '__version__.%s' % suffix))
37 except OSError:
38 pass
39 f = open(os.path.join(directory, '__version__.py'), 'w')
33 f.write("# This file is auto-generated.\n")
40 f.write("# This file is auto-generated.\n")
34 f.write("version = %r\n" % version)
41 f.write("version = %r\n" % version)
35 f.close()
42 f.close()
@@ -72,7 +72,6 b' class install_package_data(install_data)'
72 ('install_lib', 'install_dir'))
72 ('install_lib', 'install_dir'))
73 install_data.finalize_options(self)
73 install_data.finalize_options(self)
74
74
75 try:
76 mercurial.version.remember_version(version)
75 mercurial.version.remember_version(version)
77 cmdclass = {'install_data': install_package_data}
76 cmdclass = {'install_data': install_package_data}
78 py2exe_opts = {}
77 py2exe_opts = {}
@@ -102,5 +101,3 b' try:'
102 readme='contrib/macosx/Readme.html',
101 readme='contrib/macosx/Readme.html',
103 welcome='contrib/macosx/Welcome.html')),
102 welcome='contrib/macosx/Welcome.html')),
104 **py2exe_opts)
103 **py2exe_opts)
105 finally:
106 mercurial.version.forget_version()
General Comments 0
You need to be logged in to leave comments. Login now