Patchwork D8004: wix: always normalize version string

login
register
mail settings
Submitter phabricator
Date Jan. 25, 2020, 4:34 a.m.
Message ID <differential-rev-PHID-DREV-z5uum7cpgtszdbnzk2ci-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44652/
State Superseded
Headers show

Comments

phabricator - Jan. 25, 2020, 4:34 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Before, it was possible to pass in a custom version string
  which would not be valid in MSI. So we always normalize the
  version string.
  
  While we're here, also print when we normalize the version string,
  for better visibility.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  contrib/packaging/hgpackaging/wix.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py
--- a/contrib/packaging/hgpackaging/wix.py
+++ b/contrib/packaging/hgpackaging/wix.py
@@ -411,8 +411,11 @@ 
         extra_packages_script=extra_packages_script,
     )
 
-    version = version or normalize_version(find_version(source_dir))
+    orig_version = version or find_version(source_dir)
+    version = normalize_version(orig_version)
     print('using version string: %s' % version)
+    if version != orig_version:
+        print('(normalized from: %s)' % orig_version)
 
     if post_build_fn:
         post_build_fn(source_dir, hg_build_dir, dist_dir, version)