[PATCH 2 of 5] setup: append the date to the version string for a tag with a dirty work tree

Gilles Moris gilles.moris at free.fr
Fri Oct 16 04:16:26 CDT 2009


 setup.py |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)


# HG changeset patch
# User Gilles Moris <gilles.moris at free.fr>
# Date 1249974243 -7200
# Node ID 89d9d923d262827efd0c9ee2e9db414f5592bc05
# Parent  67e886f2c7864e0ee92e7119c28da4580be1e1bf
setup: append the date to the version string for a tag with a dirty work tree

This makes the version string of tagged and untagged version consistent.

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -133,6 +133,10 @@
             l.pop()
         if l:
             version = l[-1] # latest tag or revision number
+            if l[0].endswith('+') and len(l) > 1:
+                # for an unclean working directory based on a tag, we also
+                # need a '+'
+                version += '+'
             if version.endswith('+'):
                 version += time.strftime('%Y%m%d')
 elif os.path.exists('.hg_archival.txt'):


More information about the Mercurial-devel mailing list