[PATCH 1 of 6] hghave: check the mercurial.modulepolicy for pure

Yuya Nishihara yuya at tcha.org
Wed Mar 9 09:03:51 EST 2016


On Mon, 07 Mar 2016 23:33:19 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1452574111 0
> #      Tue Jan 12 04:48:31 2016 +0000
> # Node ID 49a623b73dd3cceb46f088006d005e2314c056bb
> # Parent  9974b8236cac50945d7b529e7c4fae9cf4974443
> hghave: check the mercurial.modulepolicy for pure
> 
> This is the most "correct" way to find out if we are running pure,
> but I am not sure about paths/loading the mercurial module in hghave...
> 
> diff --git a/tests/hghave.py b/tests/hghave.py
> --- a/tests/hghave.py
> +++ b/tests/hghave.py
> @@ -445,6 +445,14 @@
>  
>  @check("pure", "running with pure Python code")
>  def has_pure():
> +    try:
> +        parent = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
> +        sys.path.insert(0, parent)
> +        import mercurial
> +        if mercurial.modulepolicy == 'py':
> +            return True

Have you tried "hg debuginstall" I suggested before?


More information about the Mercurial-devel mailing list