HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //usr/lib64/python2.7/site-packages/mercurial/__init__.pyo
�
1�3\c@@sddlmZddlZddlZeZgZejddkr�ddlZddlZddl	Z	ddl
Z
ddlZdejj
fd��YZd�ZdZdejjfd	��YZed
�ejD��s�ejjde��q�ndS(i(tabsolute_importNithgpathentryfindercB@seZdZdd�ZRS(s8A sys.meta_path finder that uses a custom module loader.cC@s�|jd
�sdS|jd�r&dS|jd�r9dS|jd�rLdS|jd�r_dSd}xEtjD]:}||kr�qon|j||d|�}|roPqoqoW|s�dSt|j|j�}t|j	d	�r�||j	_	n	||_	|S(Ns
mercurial.shgext.s	hgext3rd.smercurial.cext.smercurial.thirdpartysmercurial.zstdshgext.fsmonitor.pywatchmanttargettloader(s
mercurial.shgext.s	hgext3rd.(
t
startswithtNonetsyst	meta_patht	find_specthgloadertnametoriginthasattrR(tselftfullnametpathRtspectfinderR((s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyRs0	N(t__name__t
__module__t__doc__RR(((s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyRsc
#@st}�fd�����fd�}�fd�}x�t��D]�\�}|jtjkr�|j}|dd!d"kr�|VqFn|dd#kr�|VqFn|jd
d|j�VqFn|jtjkrB|jdkrBtd
���d�!D��rBg��d�!D]}|j^qddgkrBt	}n|jtj
kr|rt}|dkrw|VqFn|j\}}	d}
x}tjt
j|
�j�D]`}|jtjtjfkr�q�n|jd||	|jdfd||	|jdf�Vq�WqFn|jtjkr��dd�r|j}|d$kr���dd�r�|d�}|d!k	r
||�q
q|d%kr���dd�r�xctd�D]+}
||
�}|d!k	r�||�q�q�Wq|d&kr|jd
|d �VqFqn|VqFWd!S('sTransform a stream of tokens from raw to Python 3.

        It is called by the custom module loading machinery to rewrite
        source/tokens between source decoding and compilation.

        Returns a generator of possibly rewritten tokens.

        The input token list may be mutated as part of processing. However,
        its changes do not necessarily match the output token stream.

        REMEMBER TO CHANGE ``BYTECODEHEADER`` WHEN CHANGING THIS FUNCTION
        OR CACHED FILES WON'T GET INVALIDATED PROPERLY.
        c@sDy+�|jtjko)�|j|kSWntk
r?tSXdS(s;Assert that tokens[j] is an OP with one of the given valuesN(ttypettokentOPtstringt
IndexErrortFalse(tjto(ttokens(s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyt_isop]s+
c@s�d}x�t�dt���D]�}�|ddd�rX|d8}|dkr�dSq |dkrh|S�|ddd	�r�|d7}q �|d
�r |dkr |d8}q q WdS(s�Find arg n of a call expression (start at 0)

            Returns index of the first token of that argument, or None if
            there is not that many arguments.

            Assumes that token[i + 1] is '('.

            iit)t]t}it(t[t{t,N(trangetlenR(tntnestedR(RtiR(s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyt_findargnofcallds	 

c@sR�|}|jtjkrN|jjd�rN|jdd|j��|<ndS(s8Make sure the token at j is a unicode string

            This rewrites a string token to include the unicode literal prefix
            so the string transformer won't add the byte prefix.

            Ignores tokens that are not strings. Assumes bounds checking has
            already been done.

            t't"Rsu%sN(R,R-(RRtSTRINGRRt_replace(Rtst(R(s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyt_ensureunicode~s

$iis'''s"""R,R-Rsb%stimportcs@s!|]}|jtjkVqdS(N(RRtNAME(t.0tu((s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pys	<genexpr>�sitfromt
__future__smercurial.pycompatsS; from mercurial.pycompat import delattr, getattr, hasattr, setattr, open, unicode
tstartitendR"tgetattrtsetattrRtsafehasattrt.tencodetdecodet	iteritemst
itervaluesiN(s'''s"""(R,R-(R:R;RR<(R>R?(R@RA(Rt	enumerateRRR.RR/R3talltTruetNEWLINER8ttokenizetiotBytesIOtreadlinetENCODINGt	ENDMARKERR9RR&(RRt
futureimplineR+R1tttsR5trtctltfntarg1idxtargntargidx((RR*Rs8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyt
replacetokensKs`	
!!3	"	4%		sHGR	cB@s)eZdZd�Zd�Zd�ZRS(sCustom module loader that transforms source code.

        When the source code is converted to a code object, we transform
        certain patterns to be Python 3 compatible. This allows us to write code
        that is natively Python 2 and compatible with Python 3 without
        making the code excessively ugly.

        We do this by transforming the token stream between parse and compile.

        Implementing transformations invalidates caching assumptions made
        by the built-in importer. The built-in importer stores a header on
        saved bytecode files indicating the Python/bytecode version. If the
        version changes, the cached bytecode is ignored. The Mercurial
        transformations could change at any time. This means we need to check
        that cached bytecode was generated with the current transformation
        code or there could be a mismatch between cached bytecode and what
        would be generated from this class.

        We supplement the bytecode caching layer by wrapping ``get_data``
        and ``set_data``. These functions are called when the
        ``SourceFileLoader`` retrieves and saves bytecode cache files,
        respectively. We simply add an additional header on the file. As
        long as the version in this file is changed when semantics change,
        cached bytecode should be invalidated when transformations change.

        The added header has the form ``HG<VERSION>``. That is a literal
        ``HG`` with 2 binary bytes indicating the transformation version.
        cC@s�tt|�j|�}|jttjj��s7|S|dd!dkrYtd��n|dd!t	kr{td��n|dS(NiitHGsno hg headerishg header version mismatch(
tsuperR	tget_datatendswithttuplet	importlibt	machinerytBYTECODE_SUFFIXEStOSErrortBYTECODEHEADER(R
Rtdata((s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyRYscO@sG|jttjj��r(t|}ntt|�j||||�S(N(	RZR[R\R]R^R`RXR	tset_data(R
RRatargstkwargs((s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyRbs
cC@s[tj|�}tj|j�}tjtt|�|j��}tt	|�j
||�S(s0Perform token transformation before compilation.(RGRHRFRIt
untokenizeRVtlistR
RXR	tsource_to_code(R
RaRtbufR((s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyRgs!(RRRRYRbRg(((s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyR	�s		cc@s|]}t|t�VqdS(N(t
isinstanceR(R4tx((s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pys	<genexpr>)s(R7RRthgdemandimporttdemandimportt__all__tversion_infoR\t
importlib.abcRGRRFtabctMetaPathFinderRRVR`R]tSourceFileLoaderR	tanyRtinsert(((s8/usr/lib64/python2.7/site-packages/mercurial/__init__.pyt<module>s /	�E