Skip to content
Snippets Groups Projects
Commit 2b7e3177f99c authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

setup: use the same code to compute tag from archive

Let us make sure we use a consistent version across the board.
parent 35a9b6d3b484
No related branches found
No related tags found
6 merge requests!1083Merge stable into default,!1078fix the pycompat Rust jobs,!1077setup: remove a debug statement that slipped through (and version from archive fix),!1076clone: properly exclude rev-branch-cache from post clone cache warming,!1075prepare for building the Wheel during the release process.,!1063upload nightly build !
Pipeline #92329 canceled
......@@ -457,5 +457,5 @@
[[t.strip() for t in l.split(':', 1)] for l in open('.hg_archival.txt')]
)
if 'tag' in kw:
version = kw['tag']
version = _version(tag=kw['tag'])
elif 'latesttag' in kw:
......@@ -461,8 +461,9 @@
elif 'latesttag' in kw:
if 'changessincelatesttag' in kw:
version = (
'%(latesttag)s+hg%(changessincelatesttag)s.%(node).12s' % kw
)
else:
version = '%(latesttag)s+hg%(latesttagdistance)s.%(node).12s' % kw
distance = int(kw.get('changessincelatesttag', kw['latesttagdistance']))
version = _version(
tag=kw['latesttag'],
branch=kw['branch'],
changes_since=distance,
hgid=kw['node'][:12],
)
else:
......@@ -468,5 +469,11 @@
else:
version = '0+hg' + kw.get('node', '')[:12]
version = _version(
tag='0',
branch='unknown-source',
changes_since=1,
hgid=kw.get('node', 'unknownid')[:12],
dirty=True,
)
elif os.path.exists('mercurial/__version__.py'):
with open('mercurial/__version__.py') as f:
data = f.read()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment