Patchwork hghave: support HGMODULEPOLICY for pure

login
register
mail settings
Submitter timeless@mozdev.org
Date Jan. 11, 2016, 11:14 p.m.
Message ID <39122c2442cd445172d7.1452554076@waste.org>
Download mbox | patch
Permalink /patch/12663/
State Superseded
Commit 39122c2442cd445172d7f07adb3f8186f9ddc0f1
Headers show

Comments

timeless@mozdev.org - Jan. 11, 2016, 11:14 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1452554014 0
#      Mon Jan 11 23:13:34 2016 +0000
# Node ID 39122c2442cd445172d7f07adb3f8186f9ddc0f1
# Parent  4571c0b383378f5eec5189e3a39c672a169ce566
hghave: support HGMODULEPOLICY for pure

HGMODULEPOLICY was introduced in 4374d819ccd5
Gregory Szorc - Jan. 12, 2016, 12:51 a.m.
On Mon, Jan 11, 2016 at 3:14 PM, timeless <timeless@mozdev.org> wrote:

> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1452554014 0
> #      Mon Jan 11 23:13:34 2016 +0000
> # Node ID 39122c2442cd445172d7f07adb3f8186f9ddc0f1
> # Parent  4571c0b383378f5eec5189e3a39c672a169ce566
> hghave: support HGMODULEPOLICY for pure
>
>
LGTM.

It feels a little weird that run-tests.py isn't setting
HGTEST_RUN_TESTS_PURE when a pure Mercurial is being used. But that would
mean teaching run-tests.py to detect a pure Mercurial install. This feels
like an effective and simple solution (assuming this is the only or one of
the only places in testing land where such a hack is needed).
Augie Fackler - Jan. 12, 2016, 2:50 a.m.
On Mon, Jan 11, 2016 at 04:51:52PM -0800, Gregory Szorc wrote:
> On Mon, Jan 11, 2016 at 3:14 PM, timeless <timeless@mozdev.org> wrote:
>
> > # HG changeset patch
> > # User timeless <timeless@mozdev.org>
> > # Date 1452554014 0
> > #      Mon Jan 11 23:13:34 2016 +0000
> > # Node ID 39122c2442cd445172d7f07adb3f8186f9ddc0f1
> > # Parent  4571c0b383378f5eec5189e3a39c672a169ce566
> > hghave: support HGMODULEPOLICY for pure
> >
> >
> LGTM.

Queued this, thanks.

>
> It feels a little weird that run-tests.py isn't setting
> HGTEST_RUN_TESTS_PURE when a pure Mercurial is being used. But that would
> mean teaching run-tests.py to detect a pure Mercurial install. This feels
> like an effective and simple solution (assuming this is the only or one of
> the only places in testing land where such a hack is needed).

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -460,7 +460,10 @@ 
 
 @check("pure", "running with pure Python code")
 def has_pure():
-    return os.environ.get("HGTEST_RUN_TESTS_PURE") == "--pure"
+    return any([
+        os.environ.get("HGMODULEPOLICY") == "py",
+        os.environ.get("HGTEST_RUN_TESTS_PURE") == "--pure",
+    ])
 
 @check("slow", "allow slow tests")
 def has_slow():