403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/mercurial/__pycache__/store.cpython-39.opt-1.pyc
a

�+�be�@s.ddlmZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZmZmZmZm	Z	mZmZddlmZe�d	�Zd
Zdd�Zd
d�Ze
ede�Zdd�Zdd�Zdd�Ze�\Z Z!dd�Z"dd�Z#dd�Z$e
edd�p�e$�Z%dZ&dZ'dd �Z(d!Z)d"Z*d"e*dd#Z+d$d%�Z,d&d'�Z-d(d)�Z.e
ed*e.�Z.d+d,�Z/d-d.�Z0gd/�Z1d0Z2d1Z3d2Z4e�5d3�Z6d4d5�Z7d6d7�Z8d8Z9d9Z:d:Z;d;Z<d<Z=dZ>d=Z?e9e=BZ@e9e>BZAe:e=BZBe:e>BZCe;e=BZDe;e>BZEe<ZFGd>d?�d?eG�ZHGd@dA�dAeH�ZIGdBdC�dCeG�ZJGdDdE�dEejK�ZLGdFdG�dGeH�ZMdS)H�)�absolute_importN�)�_)�getattr)�hex)�	changelog�error�manifest�policy�pycompat�util�vfs)�hashutil�parsersi@BcCsp|durdSt|�}|�d�r8||td�td���S|�d�r^|�|td�td���St�d|��dS)z�parses a fncache entry and returns whether the entry is tracking a path
    matched by matcher or not.

    If matcher is None, returns TrueNT�data/�.i�meta/s
/00manifest.iscannot decode path %s)�	decodedir�
startswith�lenZvisitdirrZProgrammingError)�path�matcher�r�5/usr/lib64/python3.9/site-packages/mercurial/store.py�_matchtrackedpath$s

rcCs|�dd��dd��dd�S)aM
    >>> _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'
    �.hg/�.hg.hg/�.i/�.i.hg/�.d/�.d.hg/��replace�rrrr�
_encodedir7s���r$�	encodedircCs(d|vr|S|�dd��dd��dd�S)z�
    >>> 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'
    rr rrrrr!r#rrrrLs	���rccsLdd�dD�}td�D]
}|Vqtdd�D]
}|Vq,|D]
}|Vq<dS)z�characters that are problematic for filesystems

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

    these characters will be escaped by encodefunctions
    cSsg|]}t|��qSr)�ord��.0�xrrr�
<listcomp>g�z_reserved.<locals>.<listcomp>z\:*?"<>|� �~�N)�range)Zwinreservedr)rrr�	_reserved^s	r0cs�d}tj}tt|td���}tttd�td�d��}dd�|D��t�D]}d|�||�<qJ|t|�gD]}|||����||�<qni�t���D]\}}|�|<q��fd	d
���fdd��fd
d�fS)a�
    >>> 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'
    �_��A�ZrcSsi|]
}||�qSrrr'rrr�
<dictcomp>�r+z#_buildencodefun.<locals>.<dictcomp>�~%02xc	3shd}|t|�krdt�dd�D]@}z(�||||�V||7}WqWqtyZYq0qt�qdS)Nrr�)rr�xrange�KeyError)�s�i�l)�dmaprr�decode�s
z_buildencodefun.<locals>.decodecs$d���fdd�t�t���D��S)Nr+cs g|]}��||d��qS)rr�r(�c)�cmapr:rrr*�r+z5_buildencodefun.<locals>.<lambda>.<locals>.<listcomp>)�joinrr8r�r:�rArCr�<lambda>�s�z!_buildencodefun.<locals>.<lambda>csd�t�|���S)Nr+)rB�listrC)r>rrrE�r+)	r�bytechrrF�mapr/r&r0�lowerZ	iteritems)�e�xchrZasciistrZcapitalsr)�k�vr)rAr>r=r�_buildencodefunps 



�rNcCstt|��S)z~
    >>> 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'
    )�_encodefnamer%rCrrr�encodefilename�srPcCstt|��S)z~
    >>> 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�_decodefnamerCrrr�decodefilename�srRcsztj��fdd�t�d�D��t�D]}d|��|�<q$ttd�td�d�D]}�|�����|�<qP�fdd	�}|S)
z�
    >>> 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'
    csi|]}�|��|��qSrrr')rKrrr5�r+z(_buildlowerencodefun.<locals>.<dictcomp>r2r6r3r4rcsd��fdd�t�|�D��S)Nr+csg|]}�|�qSrrr?rDrrr*�r+z=_buildlowerencodefun.<locals>.lowerencode.<locals>.<listcomp>)rBrZiterbytestrrCrDrr�lowerencode�sz)_buildlowerencodefun.<locals>.lowerencode)rrGr8r0r/r&rI)r)rSr)rArKr�_buildlowerencodefun�s
rTrS)sauxsconsprnsnul)scomslptcCs*t|�D�]\}}|sq|rR|ddvrRdt|dd��|dd�}|||<n�|�d�}|dkrlt|�}|dkr�|dd�tvs�|d	kr�|dd	�d
kr�|dd	�dkr�|dd�tvr�dt|dd��}|dd�||dd�}|||<|ddvr|dd�dt|dd��||<q|S)
a�
    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']
    r�. r6rN�.����r7�9�1�)�	enumerater&�findr�_winres3�_winres4)r�	dotencoder;�nr<Zecrrr�
_auxencode�s0 

����&rb�x�r7cCs0tt�|����}t|dd���d�}t||�}|d}tj�	|�\}}g}d}	|dd�D]h}
|
dt
�}|ddvr�|dd�d}|	dkr�t|�}n|	dt|�}|tkr�q�|�
|�|}	q^d�|�}
t|
�dkr�|
d7}
d|
||}tt|�}|dk�r,|d|�}d|
|||}|S)	N��/rWrrUr1rsdh/)rrZsha1�digestrS�splitrb�osr�splitext�
_dirprefixlenr�_maxshortdirslen�appendrB�_maxstorepathlen)rr`rg�le�parts�basename�_root�extZsdirsZsdirslen�p�d�t�dirs�resZ	spaceleftZfillerrrr�_hashencodes6




rycCs@t|�}t|��d�}d�t||��}t|�tkr<t||�}|S)aeencodes 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.
    rf)r%rOrhrBrbrrnry)rr`�efrxrrr�
_hybridencode4s
r{cCsVt|�}t|�tkrt|d�St|��d�}d�t|d��}t|�tkrRt|d�S|S)NTrf)r%rrnryrOrhrBrb)r�derzrxrrr�_pathencode[s

r}Z
pathencodecCs
t|d�S�NF)r{)�frrr�_plainhybridencodeisr�cCsBz&|��j}dtj@d|@kr$d}Wnty<d}Yn0|S)Ni�)�stat�st_moder�umask�OSError)r
�moderrr�	_calcmodems

r�)�	bookmarks�
narrowspec�data�meta�00manifest.d�00manifest.i�
00changelog.d�
00changelog.i�
phaseroots�obsstore�requires)rs
i.tmpcensored)s.idxs.ds.dat�.n�.nds.sdas
d.tmpcensored)r�r�s.*undo\.[^/]+\.(nd?|i)$cCs|tjkrdSt|�S�N)r��S_IFREG�revlog_type)r�kind�strrr�	is_revlog�s
r�cCs6|�t�rtS|�t�r2t}|�t�r.|tO}|SdSr�)�endswith�REVLOG_FILES_MAIN_EXT�FILEFLAGS_REVLOG_MAIN�REVLOG_FILES_OTHER_EXT�FILETYPE_FILELOG_OTHER�REVLOG_FILES_VOLATILE_EXT�FILEFLAGS_VOLATILE)rrvrrrr��s


r�i iiir[ic@s~eZdZdZdd�Zdd�Zdd�Zdd	d
�Zdd�Zdd
d�Z	dd�Z
ddd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS) �
basicstorez&base class for local repository storescCsB||�}|j|_t|�|_|j|_||_t�|t�|_|j|_	dSr�)
�baserr��
createmode�rawvfs�vfsmod�	filtervfsr%r
�opener��selfr�vfstyper
rrr�__init__�s
zbasicstore.__init__cCs|jdt|�S�Nrf)rr%�r�rrrrrB�szbasicstore.joincCs�|j}|r|d|7}t|j�d}g}|j�|�r�|g}|jj}|r�|��}||dd�D]l\}	}
}|d|	}t|	|
|�}
|
dur�t�||d��}|�	|
t
|�|jf�qZ|
tj
krZ|rZ|�	|�qZqB|��|S)z%yields (revlog_type, unencoded, size)rfrT)r�N)rrr��isdir�readdir�popr�rZpconvertrmr�st_sizer��S_IFDIR�sort)r��relpathZrecurserZstriplenr<Zvisitr�rtrr�r��fpZrl_typerarrr�_walk�s(zbasicstore._walkNcCstj|j||d�S)N)�
trypending�concurrencychecker)rr
)r�r�r�rrrr�s
�zbasicstore.changelogcCs"t�|j|j�}t�|j|||�Sr�)r	ZmanifestrevlogZ
nodeconstantsr
�manifestlog)r�ZrepoZstorenarrowmatchZ	rootstorerrrr��szbasicstore.manifestlogccs<|�dd�|�dd�}|D]\}}}t|B||fVqdS)a4Like walk, but excluding the changelog and root manifest.

        When [undecodable] is None, revlogs names that can't be
        decoded cause an exception. When it is provided, it should
        be a list and the filenames that can't be decoded are added
        to it instead. This is very rarely needed.r�Tr�N)r��FILEFLAGS_FILELOG)r�r�undecodable�filesrv�ur:rrr�	datafiles�szbasicstore.datafilesccslt|�dd��}|D]R\}}}|�d�r:t|B||fVq|�d�rVt|B||fVqt|B||fVqdS)Nr+Fs00changelogs
00manifest)�reversedr�r�FILEFLAGS_CHANGELOG�FILEFLAGS_MANIFESTLOG�FILETYPE_OTHER)r�r�rvr�r:rrr�topfiless

zbasicstore.topfilesccs.|�|�D]
}|Vq
|��D]
}|VqdS)z�return file related to data storage (ie: revlogs)

        yields (file_type, unencoded, size)

        if a matcher is passed, storage files of only those tracked paths
        are passed with matches the matcher
        N)r�r�)r�rr)rrr�walks	zbasicstore.walkcCstSr���_data�r�rrr�copylist szbasicstore.copylistcCsdSr�r�r��trrrr�write#szbasicstore.writecCsdSr�rr�rrr�invalidatecaches&szbasicstore.invalidatecachescCsdSr�r�r��fnrrr�markremoved)szbasicstore.markremovedcCs@d�d|f�}|j�|d�r"dS|�d�s4|d}|j�|�S)�!Checks if the store contains pathrfr�rT)rBr
�existsr��r�rrrr�__contains__,s
zbasicstore.__contains__)N)NN)N)�__name__�
__module__�__qualname__�__doc__r�rBr�rr�r�r�r�r�r�r�r�r�rrrrr��s	


r�cs6eZdZdd�Zd
�fdd�	Zdd�Zdd	�Z�ZS)�encodedstorecCsF||d�}|j|_t|�|_|j|_||_t�|t�|_|j|_	dS)N�/store)
r�rr�r�r�r�r�rPr
r�r�rrrr�9s
zencodedstore.__init__Nc	#s�tt|���D]p\}}}zt|�}Wn@tyd|durRtd�|}t�|��n|�|�YqYn0t	||�srq|||fVqdS)Nsundecodable revlog name %s)
�superr�r�rRr9rrZStorageErrorrmr)r�rr�rv�f1�size�f2�msg��	__class__rrr�Gs


zencodedstore.datafilescCs|jdt|�Sr�)rrPr�rrrrBVszencodedstore.joincCsddgdd�tD�S)Nr�r�cSsg|]}d|�qS�sstore/r�r(rrrrr*Zr+z)encodedstore.copylist.<locals>.<listcomp>r�r�rrrr�Yszencodedstore.copylist)NN)r�r�r�r�r�rBr��
__classcell__rrr�rr�8sr�c@sXeZdZdd�Zddd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)�fncachecCs||_d|_d|_t�|_dSr~)r
�entries�_dirty�set�addls)r�r
rrrr�`szfncache.__init__NcCs|jdur|�|�dS)z�read the fncache file if not already read.

        If the file on disk is corrupted, raise. If warn is provided,
        warn and keep going instead.N)r��_load)r��warnrrr�ensureloadedgs
zfncache.ensureloadedc	Cs�d|_z|jddd�}Wnty4t�|_YdS0t�|_d}tt�|jt	�d�D]^}||7}z>|�
d�}|j�t|d|d���
��||dd�}WqVty�YqV0qV|r�td	�}|r�||d�ntj|td
�d��|�||�|��dS)z&fill the entries from the fncache fileF�fncache�rb)r�Nr+�
rs$fncache does not ends with a newlines3use 'hg debugrebuildfncache' to rebuild the fncache)�hint)r�r
�IOErrorr�r��iter�	functools�partial�read�fncache_chunksize�rindex�updater�
splitlines�
ValueErrorrr�Abort�
_checkentries�close)r�r�r��chunkr@rtr�rrrr�os8
 ��z
fncache._loadcCsfd|jvrb|�d�tt�|��D]>\}}|�d�s"td�|d}|rV||d�q"t�|��q"dS)z-make sure there is no empty string in entriesr+rr�s!invalid entry in fncache, line %drN)	r��seekr\rZiterfile�rstriprrr�)r�r�r�ra�linervrrrr��s


zfncache._checkentriescCs�|jrd|j|jB|_t�|_|�d�|jdddd�}|jrV|�td�|j�d��|�	�d|_|jr�|�d�|jdddd�}|jr�|�td�|j�d��|�	�d|_t�|_dS)Nr�swbT)r�Z
atomictempr�Fsab)
r�r�r�r�Z	addbackupr
r�r%rBr�)r�r�r�rrrr��s"

z
fncache.writecCs,|jdur|��||jvr(|j�|�dSr�)r�r�r��addr�rrrr�s

zfncache.addcCsZ|jdur|��||jvr,|j�|�dSz|j�|�d|_WntyTYn0dS�NT)r�r�r��remover�r9r�rrrr�s


zfncache.removecCs*||jvrdS|jdur |��||jvSr)r�r�r�r�rrrr��s


zfncache.__contains__cCs"|jdur|��t|j|jB�Sr�)r�r�r�r�r�rrr�__iter__�s
zfncache.__iter__)N)N)r�r�r�r�r�r�r�r�rrr�rrrrrr�]s

&r�c@s.eZdZdd�Zddd�Zdd�Zdd	�Zd
S)�_fncachevfscCstj�||�||_||_dSr�)r��proxyvfsr�r��encode)r�r
�fncrrrrr��sz_fncachevfs.__init__�rcOs�|�|�}|dvrl|�d�s&|�d�rl|jjduo<|j�|�}|r\d|vr\|j�|�js\d}|sl|j�|�|j||g|�Ri|��S)N)r	r�rrsr+F)	rrr�r�r
r�r�r�r)r�rr��args�kwZencodedZnotloadrrr�__call__�s
��z_fncachevfs.__call__cCs&|r|j�|�|��S|j�|�SdSr�)r
rBrr�rrrrB�sz_fncachevfs.joincCs$|�d�s|�d�r |j�|�dS)z1generic hook point to lets fncache steer its stewrrN)rr�rr�rrr�
register_file�sz_fncachevfs.register_fileN)r	)r�r�r�r�rrBr
rrrrr�s
rc@s^eZdZdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�ZdS)�fncachestorecCst|r
t}nt}||_||d�}|j|_|jd|_t|�|_|j|_||_t	|�}||_	t
|||�|_|j|_dS)Nr�rf)
r}r�rr�r�pathsepr�r�r�r�rr
r�)r�rr�r`rr
rrrrr��s
zfncachestore.__init__cCs|j|�|�Sr�)rrr�rrrrB
szfncachestore.joincCs|j�|�jSr�)r�r�r�r�rrr�getsize
szfncachestore.getsizeNccs�t|j�D]t}t||�sq
|�|�}z&t|�}|tO}|||�|�fVWq
ty|}z|jtj	krh�WYd}~q
d}~00q
dSr�)
�sortedr�rrr�r�rr��errno�ENOENT)r�rr�rrzrv�errrrrr�s

zfncachestore.datafilescCsd}ddgdd�|D�S)N)
r�r�r�r�sdhr�r�r�r�r�r�r�r�r�r�cSsg|]}d|�qSr�rr�rrrr*.r+z)fncachestore.copylist.<locals>.<listcomp>r)r�rurrrr�szfncachestore.copylistcCs|j�|�dSr�)r�r�r�rrrr�0szfncachestore.writecCsd|j_t�|j_dSr�)r�r�r�r�r�rrrr�3szfncachestore.invalidatecachescCs|j�|�dSr�)r�rr�rrrr�7szfncachestore.markremovedc
CsT|�|�}z|�|�WdStyN}z|jtjkr8�WYd}~dSd}~00dS)NTF)rrr�rr)r�rrzrrrr�_exists:s

zfncachestore._existscCsjd�d|f�}|d}||jvr.|�|�r.dS|�d�s@|d7}|jD]}|�|�rF|�|�rFdSqFdS)r�rfr�rTF)rBr�rr�r)r�rrJrrrr�Es

zfncachestore.__contains__)NN)
r�r�r�r�rBrr�r�r�r�r�rr�rrrrr�s
r)NZ
__future__rrr�ri�rer�Zi18nrrrZnoder�rrr	r
rr
r�ZutilsrZ	importmodrr�rr$r%rr0rNrOrQrPrRrTrSr^r_rbrnrkrlryr{r}r�r�r�r�r�r��compileZEXCLUDEDr�r�r�r�r�ZFILEFLAGS_OTHERr�ZFILEFLAGS_REVLOG_OTHERr�ZFILETYPE_CHANGELOG_MAINZFILETYPE_CHANGELOG_OTHERZFILETYPE_MANIFESTLOG_MAINZFILETYPE_MANIFESTLOG_OTHERZFILETYPE_FILELOG_MAINr�r��objectr�r�r�rrrrrrr�<module>sz$	
<
0 '

m%x#

Youez - 2016 - github.com/yon3zu
LinuXploit