[PATCH 3 of 7] hglib: try to fix version to comply with PEP440
Mathias De Mare
mathias.de_mare at nokia.com
Tue Mar 14 08:26:35 UTC 2023
# HG changeset patch
# User Mathias De Mare <mathias.de_mare at nokia.com>
# Date 1678357984 -3600
# Thu Mar 09 11:33:04 2023 +0100
# Node ID afc99a7ac939f8f64ad371150fb15c94c1826425
# Parent f296ae7240cfa59936335bb7ce819c154ba1c89e
hglib: try to fix version to comply with PEP440
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -13,8 +13,9 @@ if os.path.isdir('.hg'):
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'):
More information about the Mercurial-devel
mailing list