Patchwork [2,of,4,v3] hghave: add demandimport checking

login
register
mail settings
Submitter timeless
Date Aug. 25, 2016, 10:56 p.m.
Message ID <e297cf7fe72584328675.1472165775@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/16429/
State Superseded
Headers show

Comments

timeless - Aug. 25, 2016, 10:56 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1472164235 0
#      Thu Aug 25 22:30:35 2016 +0000
# Node ID e297cf7fe725843286758863deb5b8a005d2e887
# Parent  2b368e1f8ac00774b2a1d24c6cf9282e3cd24f1a
# Available At https://bitbucket.org/timeless/mercurial-crew
#              hg pull https://bitbucket.org/timeless/mercurial-crew -r e297cf7fe725
hghave: add demandimport checking

Patch

diff -r 2b368e1f8ac0 -r e297cf7fe725 tests/hghave.py
--- a/tests/hghave.py	Thu Aug 25 22:51:39 2016 +0000
+++ b/tests/hghave.py	Thu Aug 25 22:30:35 2016 +0000
@@ -526,6 +526,11 @@ 
                          br'other supported Python versions')
     return dpkg and dh and dh_py2
 
+@check("demandimport", "demandimport enabled")
+def has_demandimport():
+    return not ('HGDEMANDIMPORT' in os.environ and
+                os.environ['HGDEMANDIMPORT'] == 'disable')
+
 @check("absimport", "absolute_import in __future__")
 def has_absimport():
     import __future__