D7023: hghave: document format for version feature checks as <name><vers>, no dots

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Tue Oct 8 15:59:32 EDT 2019


spectral edited the summary of this revision.
spectral retitled this revision from "tests: fix test-archive to specify feature as py38, not py-38" to "hghave: document format for version feature checks as <name><vers>, no dots".
spectral updated this revision to Diff 16974.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7023?vs=16961&id=16974

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7023/new/

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

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -60,7 +60,11 @@
 def checkvers(name, desc, vers):
     """Registers a check function for each of a series of versions.
 
-    vers can be a list or an iterator"""
+    vers can be a list or an iterator.
+
+    Produces a series of feature checks that have the form <name><vers> without
+    any punctuation (even if there's punctuation in 'vers'; i.e. this produces
+    'py38', not 'py3.8' or 'py-38')."""
 
     def decorator(func):
         def funcv(v):
@@ -757,6 +761,8 @@
     return (not has_chg()) and os.environ.get('HGDEMANDIMPORT') != 'disable'
 
 
+# Add "py27", "py35", ... as possible feature checks. Note that there's no
+# punctuation here.
 @checkvers("py", "Python >= %s", (2.7, 3.5, 3.6, 3.7, 3.8, 3.9))
 def has_python_range(v):
     major, minor = v.split('.')[0:2]



To: spectral, #hg-reviewers, pulkit
Cc: mjpieters, mercurial-devel


More information about the Mercurial-devel mailing list