changeset 46524:e3f23814bac7

windows: fix parsing of version number to match format from D9955 Differential Revision: https://phab.mercurial-scm.org/D10061
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 23 Feb 2021 12:29:41 -0800
parents 359bdd8fc60a
children 636853347e14
files contrib/packaging/hgpackaging/util.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/packaging/hgpackaging/util.py	Tue Feb 23 12:26:52 2021 -0800
+++ b/contrib/packaging/hgpackaging/util.py	Tue Feb 23 12:29:41 2021 -0800
@@ -161,10 +161,10 @@
     >>> normalize_windows_version("5.3rc1")
     '5.3.0.1'
 
-    >>> normalize_windows_version("5.3rc1+2-abcdef")
+    >>> normalize_windows_version("5.3rc1+hg2.abcdef")
     '5.3.0.1'
 
-    >>> normalize_windows_version("5.3+2-abcdef")
+    >>> normalize_windows_version("5.3+hg2.abcdef")
     '5.3.0.2'
     """
     if '+' in version:
@@ -188,8 +188,8 @@
         if rc is not None:
             versions.append(rc)
         elif extra:
-            # <commit count>-<hash>+<date>
-            versions.append(int(extra.split('-')[0]))
+            # hg<commit count>.<hash>+<date>
+            versions.append(int(extra.split('.')[0][2:]))
 
     return '.'.join('%d' % x for x in versions[0:4])