^clddlZddlZddlmZdZddddd ddd Z dd lmZejZn #e $rYnwxYwd ej vrd Zdej vr ej d dZdZ ddddddZdddddZdZdZdZddZdS)N)getattrallow)cextN)rpure)cffiN)rr)Nr)crcffis cffi-allowspysrust+cs rust+c-allow)__modulepolicy____pypy__r HGMODULEPOLICYzutf-8ci}t|t||gd} t||x||<}n #t$rt d|zwxYwt|dd||S)Nr)levelzcannot import name %s__doc__) __import__globalsrAttributeError ImportError)pkgnamemodname fakelocalspkgmods 2/usr/lib/python3/dist-packages/mercurial/policy.py _importfromr<sJ WgiigYa H H HC=$+C$9$99 7cc ===1G;<<<= CD!!! g s ;A))rbase85)rbdiff)rmpatch)rosutilrparsersr#)rr)r charencode)rr$))rr%)rr)rr%)rr$ct||f}t|dd}||krtd||||fzdS)Nversionz=cannot import module %s.%s (expected version: %d, actual: %r)) _cextversionsgetrr)rrrexpectedactuals r _checkmodr,[sf  '7!344H S)T * *F  162 3   c tt\}}n%#t$rtdtzwxYw|s|sJ|r_t||f||f\}} t ||}||krt||||S#t$r|sYnwxYwt||f||f\}}t ||S)z7Import module according to policy and check API versionzinvalid HGMODULEPOLICY %r) _packageprefspolicyKeyErrorr _modredirectsr)rr,)rverpkgpurepkgpnmnrs r importmodr7fs @'/ @@@5>???@ W ""FG#4vw6GHHB b"%%CV||"b#&&&J         1GW3E F FFB r2  s":((B B! B!c6tdS)z;Assuming the policy is a Rust one, tell if it's permissive.s-allow)r0endswithr-r_isrustpermissiver;{s ??9 % %%r-c.tds|S td|}n!#t$rt r|cYSwxYw||S t ||S#t $r%t r|cYStd|zwxYw)aImport Rust module according to policy and availability. If policy isn't a Rust one, this returns `default`. If either the module or its member is not available, this returns `default` if policy is permissive and raises `ImportError` if not. srustrustextNzCannot import name %s)r0 startswithrrr;rr)rmemberdefaultrs r importrustrAs   W % %)W--     NNN ~ <sF### <<<    NNN1F:;;;rJsf    # %    """"""  *FF   D ))) Frz!! Z( ) 0 0 9 9F     0*2,     *&&& <<<<<