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

timeless timeless at gmail.com
Wed Mar 9 10:05:33 EST 2016


(py)[timeless at gcc2-power8 tests]$ hg debuginstall
checking encoding (UTF-8)...
checking Python executable (/home/timeless/hg/py/bin/python)
checking Python version (2.7.8)
checking Python lib (/home/timeless/hg/py/lib64/python2.7)...
checking installed modules (/home/timeless/hg/crew/mercurial)...
checking templates (/home/timeless/hg/crew/mercurial/templates)...
checking commit editor...
checking username...
no problems detected

There's no indication of pure. It could be used to parse out installed
modules directory, although I'd rather have it support -T so i could
ask for it directly. And at that point, it would be better for
debuginstall to report the modulepolicy.

I'm ok with doing something else.

On Wed, Mar 9, 2016 at 9:03 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> 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?
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list