[PATCH 1 of 4] import-checker: allow symbol imports from hgweb.common and .request

Gregory Szorc gregory.szorc at gmail.com
Wed Nov 18 20:42:19 CST 2015


On Wed, Nov 18, 2015 at 1:51 PM, Pierre-Yves David <
pierre-yves.david at ens-lyon.org> wrote:

>
>
> On 11/18/2015 07:44 AM, Yuya Nishihara wrote:
>
>> # HG changeset patch
>> # User Yuya Nishihara <yuya at tcha.org>
>> # Date 1446353721 -32400
>> #      Sun Nov 01 13:55:21 2015 +0900
>> # Node ID d66415991a1f94da2f7f1e24793746a48deb3df6
>> # Parent  a21e63ed613bc956c88c2832fce1968550ccf834
>> import-checker: allow symbol imports from hgweb.common and .request
>>
>> This seems the convention of hgweb.
>>
>
> I'm unclear about what this changeset achieve and why it is necessary. Can
> you elaborate?
>
>
absolute_import engages a strict mode about what imports are allowed. One
of the rules is we only allow importing of symbols that are themselves
modules (as opposed to functions, variables, etc). We're supposed to import
modules then assign their symbols to locals post import.

The list modified by this patch stops applying this restriction to hgweb
because it is easier to do that than rewrite half of hgweb to not import
symbols directly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151118/cedb3e64/attachment.html>


More information about the Mercurial-devel mailing list