[PATCH] version: always overwrite __version__

Christian Ebert blacktrash at gmx.net
Sat Feb 3 14:55:55 CST 2007


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1170536088 -3600
# Node ID e3368a5e8e7197a71f7d08c8f8c058d22e307357
# Parent  82eb0fafb56d5767af52ed60cd272311675b547f
version: always overwrite __version__

As setup.py /and/ write_version called get_version,
which in turn imports __version__,
setup.py always returned previous version on first run --
or had to be run twice to get the correct version.

This can be easily tested by:
$ python setup.py --version
$ hg update -C other
$ python setup.py --version

diff -r 82eb0fafb56d -r e3368a5e8e71 mercurial/version.py
--- a/mercurial/version.py	Tue Jan 30 21:11:10 2007 -0200
+++ b/mercurial/version.py	Sat Feb 03 21:54:48 2007 +0100
@@ -28,8 +28,6 @@ def get_version():
 
 def write_version(version):
     """Overwrite version file."""
-    if version == get_version():
-        return
     directory = os.path.dirname(__file__)
     for suffix in ['py', 'pyc', 'pyo']:
         try:


More information about the Mercurial-devel mailing list