setup.py: reload __version__.py after writing it.
write_version loads __version__.py before writing it (see
7eb694a1c1af),
so we have to explicitly reload it to use the correct version.
Problem diagnosed by Christian Ebert.
--- a/mercurial/version.py Tue Feb 06 15:54:58 2007 -0200
+++ b/mercurial/version.py Tue Feb 06 15:55:20 2007 -0200
@@ -18,10 +18,13 @@
unknown_version = 'unknown'
remembered_version = False
-def get_version():
+def get_version(doreload=False):
"""Return version information if available."""
try:
- from mercurial.__version__ import version
+ import mercurial.__version__
+ if doreload:
+ reload(mercurial.__version__)
+ version = mercurial.__version__.version
except ImportError:
version = unknown_version
return version
@@ -40,6 +43,8 @@
f.write("# This file is auto-generated.\n")
f.write("version = %r\n" % version)
f.close()
+ # reload the file we've just written
+ get_version(True)
def remember_version(version=None):
"""Store version information."""