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: //proc/thread-self/root/lib64/python2.7/site-packages/mercurial/store.pyo
�
1�3\c@@sddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZmZm
Z
mZejd�Zd�Zeede�Zd	�Zd
�Zd�Ze�\ZZd�Zd
�Zd�Zeedd�pe�Zd,Zd-Z d�Z!dZ"dZ#de#ddZ$d�Z%d�Z&d�Z'eede'�Z'd�Z(d�Z)d Z*d!�Z+d"e,fd#��YZ-d$e-fd%��YZ.d&e,fd'��YZ/d(ej0ej1fd)��YZ2d*e-fd+��YZ3dS(.i(tabsolute_importNi(t_(terrortnodetpolicytpycompattutiltvfstparserscC@s(|jdd�jdd�jdd�S(sM
    >>> _encodedir(b'data/foo.i')
    'data/foo.i'
    >>> _encodedir(b'data/foo.i/bla.i')
    'data/foo.i.hg/bla.i'
    >>> _encodedir(b'data/foo.i.hg/bla.i')
    'data/foo.i.hg.hg/bla.i'
    >>> _encodedir(b'data/foo.i\ndata/foo.i/bla.i\ndata/foo.i.hg/bla.i\n')
    'data/foo.i\ndata/foo.i.hg/bla.i\ndata/foo.i.hg.hg/bla.i\n'
    s.hg/s.hg.hg/s.i/s.i.hg/s.d/s.d.hg/(treplace(tpath((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt
_encodedirst	encodedircC@s8d|kr|S|jdd�jdd�jdd�S(s�
    >>> decodedir(b'data/foo.i')
    'data/foo.i'
    >>> decodedir(b'data/foo.i.hg/bla.i')
    'data/foo.i/bla.i'
    >>> decodedir(b'data/foo.i.hg.hg/bla.i')
    'data/foo.i.hg/bla.i'
    s.hg/s.d.hg/s.d/s.i.hg/s.i/s.hg.hg/(R	(R
((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt	decodedir/s	cc@stgdD]}t|�^q}xtd�D]}|Vq,Wxtdd�D]}|VqKWx|D]}|VqaWdS(s� characters that are problematic for filesystems

    * ascii escapes (0..31)
    * ascii hi (126..255)
    * windows specials

    these characters will be escaped by encodefunctions
    u\:*?"<>|i i~iN(tordtrange(txtwinreserved((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt	_reserved?s			
c@s#d}tj}tt|td���}tttd�td�d��}td�|D���x%t�D]}d|�||�<qoWx;|t|�gD]&}|||�j��||�<q�Wi�x$�j	�D]\}}|�|<q�W�fd���fd	��fd
�fS(s�
    >>> enc, dec = _buildencodefun()

    >>> enc(b'nothing/special.txt')
    'nothing/special.txt'
    >>> dec(b'nothing/special.txt')
    'nothing/special.txt'

    >>> enc(b'HELLO')
    '_h_e_l_l_o'
    >>> dec(b'_h_e_l_l_o')
    'HELLO'

    >>> enc(b'hello:world?')
    'hello~3aworld~3f'
    >>> dec(b'hello~3aworld~3f')
    'hello:world?'

    >>> enc(b'the\x07quick\xADshot')
    'the~07quick~adshot'
    >>> dec(b'the~07quick~adshot')
    'the\x07quick\xadshot'
    RitAtZics@s|]}||fVqdS(N((t.0R((s5/usr/lib64/python2.7/site-packages/mercurial/store.pys	<genexpr>mss~%02xc3@s}d}xp|t|�krxxWtjdd�D]=}y#�||||!V||7}PWq.tk
rjq.Xq.Wt�q	WdS(Niii(tlenRtxrangetKeyError(tstitl(tdmap(s5/usr/lib64/python2.7/site-packages/mercurial/store.pytdecodevs

c@s>djgtjt|��D]}�|||d!^q�S(Nti(tjoinRRR(Rtc(tcmap(s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt<lambda>�s	c@sdjt�|���S(NR(Rtlist(R(R(s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR"�R(
RtbytechrR#tmapRRtdictRtlowert	iteritems(tetxchrtasciistrtcapitalsRtktv((R!RRs5/usr/lib64/python2.7/site-packages/mercurial/store.pyt_buildencodefunPs	%$cC@stt|��S(s~
    >>> encodefilename(b'foo.i/bar.d/bla.hg/hi:world?/HELLO')
    'foo.i.hg/bar.d.hg/bla.hg.hg/hi~3aworld~3f/_h_e_l_l_o'
    (t_encodefnameR(R((s5/usr/lib64/python2.7/site-packages/mercurial/store.pytencodefilename�scC@stt|��S(s~
    >>> decodefilename(b'foo.i.hg/bar.d.hg/bla.hg.hg/hi~3aworld~3f/_h_e_l_l_o')
    'foo.i/bar.d/bla.hg/hi:world?/HELLO'
    (R
t_decodefname(R((s5/usr/lib64/python2.7/site-packages/mercurial/store.pytdecodefilename�sc@s�tj}tgtjd�D]}||�||�f^q��x%t�D]}d|�||�<qMWxCttd�td�d�D]"}||�j��||�<q�W�fd�}|S(s�
    >>> f = _buildlowerencodefun()
    >>> f(b'nothing/special.txt')
    'nothing/special.txt'
    >>> f(b'HELLO')
    'hello'
    >>> f(b'hello:world?')
    'hello~3aworld~3f'
    >>> f(b'the\x07quick\xADshot')
    'the~07quick~adshot'
    is~%02xRRic@s-djgtj|�D]}�|^q�S(NR(RRtiterbytestr(RR (R!(s5/usr/lib64/python2.7/site-packages/mercurial/store.pytlowerencode�s(RR$R&RRRRR'(R*RR5((R!s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt_buildlowerencodefun�s	:& R5tauxtcontprntnultcomtlptcC@sgx`t|�D]R\}}|s%q
n|rg|ddkrgdt|dd!�|d}|||<n�|jd�}|dkr�t|�}n|dkr�|d tks�|dkr,|dd!d	kr,|dd!d
kr,|d tkr,dt|dd!�}|dd!||d}|||<n|ddkr
|d dt|d�||<q
q
W|S(s�
    Encodes filenames containing names reserved by Windows or which end in
    period or space. Does not touch other single reserved characters c.
    Specifically, c in '\:*?"<>|' or ord(c) <= 31 are *not* encoded here.
    Additionally encodes space or period at the beginning, if dotencode is
    True. Parameter path is assumed to be all lowercase.
    A segment only needs encoding if a reserved name appears as a
    basename (e.g. "aux", "aux.foo"). A directory or file named "foo.aux"
    doesn't need encoding.

    >>> s = b'.foo/aux.txt/txt.aux/con/prn/nul/foo.'
    >>> _auxencode(s.split(b'/'), True)
    ['~2efoo', 'au~78.txt', 'txt.aux', 'co~6e', 'pr~6e', 'nu~6c', 'foo~2e']
    >>> s = b'.com1com2/lpt9.lpt4.lpt1/conprn/com0/lpt0/foo.'
    >>> _auxencode(s.split(b'/'), False)
    ['.com1com2', 'lp~749.lpt4.lpt1', 'conprn', 'com0', 'lpt0', 'foo~2e']
    >>> _auxencode([b'foo. '], True)
    ['foo.~20']
    >>> _auxencode([b' .foo'], True)
    ['~20.foo']
    is. s~%02xit.i����iit9t1i(t	enumerateRtfindRt_winres3t_winres4(R
t	dotencodeRtnRtec((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt
_auxencode�s$
2
'ixiicC@s�tjtj|�j��}t|d�jd�}t||�}|d}tj	j
|�\}}g}d}	x�|d D]�}
|
t }|ddkr�|d d}n|	dkr�t|�}n$|	dt|�}|t
kr�Pn|j|�|}	qWdj|�}
t|
�dkr4|
d7}
nd|
||}tt|�}|dkr�|| }d|
|||}n|S(	Nit/i����is. Risdh/(Rthexthashlibtsha1tdigestR5tsplitRGtosR
tsplitextt
_dirprefixlenRt_maxshortdirslentappendRt_maxstorepathlen(R
RDRLtletpartstbasenamet_roottexttsdirstsdirslentptdtttdirstrest	spacelefttfiller((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt_hashencode�s6





cC@sat|�}t|�jd�}djt||��}t|�tkr]t||�}n|S(seencodes path with a length limit

    Encodes all paths that begin with 'data/', according to the following.

    Default encoding (reversible):

    Encodes all uppercase letters 'X' as '_x'. All reserved or illegal
    characters are encoded as '~xx', where xx is the two digit hex code
    of the character (see encodefilename).
    Relevant path components consisting of Windows reserved filenames are
    masked by encoding the third character ('aux' -> 'au~78', see _auxencode).

    Hashed encoding (not reversible):

    If the default-encoded path is longer than _maxstorepathlen, a
    non-reversible hybrid hashing of the path is done instead.
    This encoding uses up to _dirprefixlen characters of all directory
    levels of the lowerencoded path, but not more levels than can fit into
    _maxshortdirslen.
    Then follows the filler followed by the sha digest of the full path.
    The filler is the beginning of the basename of the lowerencoded path
    (the basename is everything after the last path separator). The filler
    is as long as possible, filling in characters from the basename until
    the encoded path has _maxstorepathlen characters (or all chars of the
    basename have been taken).
    The extension (e.g. '.i' or '.d') is preserved.

    The string 'data/' at the beginning is replaced with 'dh/', if the hashed
    encoding was used.
    RH(RR0RMRRGRRSRb(R
RDtefR_((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt
_hybridencodescC@s{t|�}t|�tkr+t|t�St|�jd�}djt|t��}t|�tkrwt|t�S|S(NRH(	RRRSRbtTrueR0RMRRG(R
tdeRcR_((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt_pathencode&s

t
pathencodecC@s
t|t�S(N(RdtFalse(tf((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt_plainhybridencode2scC@sRy4|j�j}dtj@d|@kr3d}nWntk
rMd}nX|S(Ni�(tstattst_modeRtumasktNonetOSError(Rtmode((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt	_calcmode5s


s^narrowspec data meta 00manifest.d 00manifest.i 00changelog.d 00changelog.i phaseroots obsstorecC@s|tjko|ddkS(Ni����s.is.d(s.is.d(RltS_IFREG(Rjtkindtst((s5/usr/lib64/python2.7/site-packages/mercurial/store.pytisrevlogCst
basicstorecB@szeZdZd�Zd�Zed�Zdd�Zd�Z	dd�Z
d�Zd�Zd	�Z
d
�Zd�ZRS(
s&base class for local repository storescC@sa||�}|j|_t|�|_|j|_||_tj|t�|_|j|_	dS(N(
tbaseR
Rrt
createmodetrawvfstvfsmodt	filtervfsRRtopener(tselfR
tvfstypeR((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt__init__Hs	cC@s|jdt|�S(NRH(R
R(R~Rj((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyRQscC@s*|j}|r |d|7}nt|j�d}g}|jj|�r|g}|jj}x�|r|j�}	x�||	dt�D]�\}
}}|	d|
}
||
||�r�tj|
|�}|j	t
|�||jf�q�|tj
kr�|r�|j	|
�q�q�WqcWn|j�|S(s!yields (unencoded, encoded, size)RHiRl(R
RRztisdirtreaddirtpopReRtpconvertRRR
tst_sizeRltS_IFDIRtsort(R~trelpathtrecurset
filefilterR
tstriplenRtvisitR�R[RjRtRutfpRE((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt_walkTs&			""
cC@s |jdt�|jdt�S(Ntdatatmeta(R�Re(R~tmatcher((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt	datafilesjscC@st|jdt��S(NR(treversedR�Ri(R~((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyttopfilesmscc@s?x|j|�D]}|VqWx|j�D]}|Vq,WdS(s�yields (unencoded, encoded, size)

        if a matcher is passed, storage files of only those tracked paths
        are passed with matches the matcher
        N(R�R�(R~R�R((s5/usr/lib64/python2.7/site-packages/mercurial/store.pytwalkqs	cC@sdgtj�S(Ntrequires(t_dataRM(R~((s5/usr/lib64/python2.7/site-packages/mercurial/store.pytcopylist}scC@sdS(N((R~ttr((s5/usr/lib64/python2.7/site-packages/mercurial/store.pytwrite�scC@sdS(N((R~((s5/usr/lib64/python2.7/site-packages/mercurial/store.pytinvalidatecaches�scC@sdS(N((R~tfn((s5/usr/lib64/python2.7/site-packages/mercurial/store.pytmarkremoved�scC@s[djd|f�}|jj|d�r/tS|jd�sK|d}n|jj|�S(s!Checks if the store contains pathRHR�s.i(RRtexistsRetendswith(R~R
((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt__contains__�s
N(t__name__t
__module__t__doc__R�RRvR�RoR�R�R�R�R�R�R�R�(((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyRwFs								tencodedstorecB@s/eZd�Zdd�Zd�Zd�ZRS(cC@se||d�}|j|_t|�|_|j|_||_tj|t�|_|j|_	dS(Ns/store(
RxR
RrRyRzR{R|R1RR}(R~R
RR((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s	cc@sex^tt|�j�D]G\}}}yt|�}Wntk
rNd}nX|||fVqWdS(N(tsuperR�R�R3RRo(R~R�tatbtsize((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s%

cC@s|jdt|�S(NRH(R
R1(R~Rj((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR�scC@s+ddggtj�D]}d|^qS(NR�s
00changelog.isstore/(R�RM(R~Rj((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s	N(R�R�R�RoR�RR�(((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s			tfncachecB@sGeZd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cC@s||_d|_t|_dS(N(RRotentriesRit_dirty(R~R((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s		cC@s�t|_y|jddd�}Wntk
rBt�|_dSXtt|j��j��|_d|jkr�|j	d�x[t
tj|��D]A\}}|j
d�s�td�|d	}tj|��q�q�Wn|j�dS(
s&fill the entries from the fncache fileR�RqtrbNRis
s!invalid entry in fncache, line %di(RiR�RtIOErrortsetR�R
treadt
splitlinestseekR@RtiterfiletrstripRRtAborttclose(R~R�REtlineR]((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt_load�s	
!
"cC@sz|jrv|jd�|jddddt�}|jr`|jtdj|j�d��n|j�t	|_ndS(NR�Rqtwbt
atomictemps
(
R�t	addbackupRReR�R�RRR�Ri(R~R�R�((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s	
	&
cC@sK|jdkr|j�n||jkrGt|_|jj|�ndS(N(R�RoR�ReR�tadd(R~R�((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s

	cC@sQ|jdkr|j�ny|jj|�t|_Wntk
rLnXdS(N(R�RoR�tremoveReR�R(R~R�((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s


cC@s)|jdkr|j�n||jkS(N(R�RoR�(R~R�((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s
cC@s)|jdkr|j�nt|j�S(N(R�RoR�titer(R~((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt__iter__�s
(	R�R�R�R�R�R�R�R�R�(((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s			
				t_fncachevfscB@s&eZd�Zdd�Zd�ZRS(cC@s)tjj||�||_||_dS(N(R{tproxyvfsR�R�tencode(R~RtfncR�((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s	trcO@s�|j|�}|dkr�|jd�s9|jd�r�|jjdkoZ|jj|�}|r�d|kr�|jj|�jr�t	}n|s�|jj
|�q�n|j||||�S(NR�R�sdata/smeta/R�(R�R�(R�t
startswithR�R�RoRR�RlR�RiR�(R~R
Rqtargstkwtencodedtnotload((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt__call__�s$(	cC@s3|r|jj|j|��S|jj|�SdS(N(RRR�(R~R
((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyRs(R�R�R�R�R(((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR��s	tfncachestorecB@seeZd�Zd�Zd�Zd
d�Zd�Zd�Zd�Z	d�Z
d�Zd	�ZRS(cC@s�|rt}nt}||_||d�}|j|_|jd|_t|�|_|j|_||_t	|�}||_	t
|||�|_|j|_dS(Ns/storeRH(
RgRkR�RxR
tpathsepRrRyRzR�R�RR}(R~R
RRDR�RR�((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR�s				cC@s|j|j|�S(N(R�R�(R~Rj((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyRscC@s|jj|�jS(N(RzRlR�(R~R
((s5/usr/lib64/python2.7/site-packages/mercurial/store.pytgetsizescc@svxot|j�D]^}|j|�}y|||j|�fVWqtk
rm}|jtjkrn�qnqXqWdS(N(tsortedR�R�R�RpterrnotENOENT(R~R�RjRcterr((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR�scC@s1d}ddgg|j�D]}d|^qS(Nsinarrowspec data meta dh fncache phaseroots obsstore 00manifest.d 00manifest.i 00changelog.d 00changelog.iR�s
00changelog.isstore/(RM(R~R\Rj((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR�(s	cC@s|jj|�dS(N(R�R�(R~R�((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR�.scC@sd|j_dS(N(RoR�R�(R~((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR�1scC@s|jj|�dS(N(R�R�(R~R�((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR�4scC@sW|j|�}y|j|�tSWn,tk
rR}|jtjkrN�ntSXdS(N(R�R�ReRpR�R�Ri(R~RjRcR�((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt_exists7s
cC@s�djd|f�}|d}||jkrA|j|�rAtS|jd�s]|d7}nx3|jD](}|j|�rg|j|�rgtSqgWtS(s!Checks if the store contains pathRHR�s.i(RR�R�ReR�R�Ri(R~R
R)((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR�Bs

N(
R�R�R�RR�RoR�R�R�R�R�R�R�(((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyR�s									(R7R8R9R:(R;R<(4t
__future__RR�RJRNRlti18nRRRRRRRRR{t	importmodRRtgetattrRR
RR/R0R2R1R3R6RoR5RBRCRGRSRPRQRbRdRgRkRrR�RvtobjectRwR�R�tabstractvfsR�R�R�(((s5/usr/lib64/python2.7/site-packages/mercurial/store.pyt<module>sH.					6				,		&	
			N>