Mercurial > public > mercurial-scm > hg-stable
comparison setup.py @ 46573:359bdd8fc60a
build: make version from .hg_archival.txt consistent with that from .hg/
D9955 changed the version format to replace "-" by "." and to add "hg"
before the number representing the distance from the latest
tag. However, it missed the "hg" string and added an extra "." to the
version string we produce when there's a `.hg_archival.txt`. This
patch makes it consistent.
Differential Revision: https://phab.mercurial-scm.org/D10060
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 23 Feb 2021 12:26:52 -0800 |
parents | 866eb4d6bd9f |
children | d4ba4d51f85f |
comparison
equal
deleted
inserted
replaced
46572:c82d6363bc9e | 46573:359bdd8fc60a |
---|---|
429 if 'tag' in kw: | 429 if 'tag' in kw: |
430 version = kw['tag'] | 430 version = kw['tag'] |
431 elif 'latesttag' in kw: | 431 elif 'latesttag' in kw: |
432 if 'changessincelatesttag' in kw: | 432 if 'changessincelatesttag' in kw: |
433 version = ( | 433 version = ( |
434 '%(latesttag)s+.%(changessincelatesttag)s.%(node).12s' % kw | 434 '%(latesttag)s+hg%(changessincelatesttag)s.%(node).12s' % kw |
435 ) | 435 ) |
436 else: | 436 else: |
437 version = '%(latesttag)s+.%(latesttagdistance)s.%(node).12s' % kw | 437 version = '%(latesttag)s+hg%(latesttagdistance)s.%(node).12s' % kw |
438 else: | 438 else: |
439 version = '0+' + kw.get('node', '')[:12] | 439 version = '0+hg' + kw.get('node', '')[:12] |
440 | 440 |
441 if version: | 441 if version: |
442 versionb = version | 442 versionb = version |
443 if not isinstance(versionb, bytes): | 443 if not isinstance(versionb, bytes): |
444 versionb = versionb.encode('ascii') | 444 versionb = versionb.encode('ascii') |