Patchwork D10060: build: make version from .hg_archival.txt consistent with that from .hg/

login
register
mail settings
Submitter phabricator
Date Feb. 23, 2021, 8:43 p.m.
Message ID <differential-rev-PHID-DREV-t62mpljwxfhal7xhwq5v-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48376/
State Superseded
Headers show

Comments

phabricator - Feb. 23, 2021, 8:43 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  D9955 <https://phab.mercurial-scm.org/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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10060

AFFECTED FILES
  setup.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -431,10 +431,10 @@ 
     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]