changeset 220:ae6427d1c8f7

hglib: try to fix version to comply with PEP440
author Mathias De Mare <mathias.de_mare@nokia.com>
date Thu, 09 Mar 2023 11:33:04 +0100
parents 8341f2494b3f
children a2afbf236ca8
files setup.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Wed Mar 08 17:04:58 2023 +0100
+++ b/setup.py	Thu Mar 09 11:33:04 2023 +0100
@@ -13,8 +13,9 @@
         if l[0].endswith('+'): # propagate the dirty status to the tag
             version += '+'
     elif len(l) == 1: # no tag found
-        cmd = 'hg parents --template "{latesttag}+{latesttagdistance}-"'
-        version = os.popen(cmd).read() + l[0]
+        cmd1 = 'hg parents --template "{latesttag}"'
+        cmd2 = 'hg parents --template "{latesttagdistance}"'
+        version = os.popen(cmd1).read() + ".dev" + os.popen(cmd2).read()
     if version.endswith('+'):
         version += time.strftime('%Y%m%d')
 elif os.path.exists('.hg_archival.txt'):