Mercurial > python-hglib
comparison setup.py @ 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 | d06b48001662 |
children | 3f9dd44be8c2 |
comparison
equal
deleted
inserted
replaced
219:8341f2494b3f | 220:ae6427d1c8f7 |
---|---|
11 if len(l) > 1: # tag found | 11 if len(l) > 1: # tag found |
12 version = l[-1] | 12 version = l[-1] |
13 if l[0].endswith('+'): # propagate the dirty status to the tag | 13 if l[0].endswith('+'): # propagate the dirty status to the tag |
14 version += '+' | 14 version += '+' |
15 elif len(l) == 1: # no tag found | 15 elif len(l) == 1: # no tag found |
16 cmd = 'hg parents --template "{latesttag}+{latesttagdistance}-"' | 16 cmd1 = 'hg parents --template "{latesttag}"' |
17 version = os.popen(cmd).read() + l[0] | 17 cmd2 = 'hg parents --template "{latesttagdistance}"' |
18 version = os.popen(cmd1).read() + ".dev" + os.popen(cmd2).read() | |
18 if version.endswith('+'): | 19 if version.endswith('+'): |
19 version += time.strftime('%Y%m%d') | 20 version += time.strftime('%Y%m%d') |
20 elif os.path.exists('.hg_archival.txt'): | 21 elif os.path.exists('.hg_archival.txt'): |
21 kw = dict([[t.strip() for t in l.split(':', 1)] | 22 kw = dict([[t.strip() for t in l.split(':', 1)] |
22 for l in open('.hg_archival.txt')]) | 23 for l in open('.hg_archival.txt')]) |