build: make version from .hg_archival.txt consistent with that from .hg/
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 23 Feb 2021 12:26:52 -0800
changeset 46573 359bdd8fc60a
parent 46572 c82d6363bc9e
child 46574 e3f23814bac7
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
setup.py
--- a/setup.py	Thu Feb 11 11:22:53 2021 -0800
+++ b/setup.py	Tue Feb 23 12:26:52 2021 -0800
@@ -431,12 +431,12 @@
     elif 'latesttag' in kw:
         if 'changessincelatesttag' in kw:
             version = (
-                '%(latesttag)s+.%(changessincelatesttag)s.%(node).12s' % kw
+                '%(latesttag)s+hg%(changessincelatesttag)s.%(node).12s' % kw
             )
         else:
-            version = '%(latesttag)s+.%(latesttagdistance)s.%(node).12s' % kw
+            version = '%(latesttag)s+hg%(latesttagdistance)s.%(node).12s' % kw
     else:
-        version = '0+' + kw.get('node', '')[:12]
+        version = '0+hg' + kw.get('node', '')[:12]
 
 if version:
     versionb = version