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__/wireprotov1server.cpython-39.opt-1.pyc
a

�+�bQi�@s�ddlmZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZm
ZmZmZmZmZmZmZmZmZmZmZddlmZmZejZejZed	�Zed
�Z dee fZ!dd
�Z"dd�Z#dd�Z$dd�Z%dd�Z&e�'�Z(dfdd�Z)e)dddd�dd��Z*e)dd dd�d!d"��Z+e)d#dd�d$d%��Z,e)d&d'dd�d(d)��Z-e)d*d+dd�d,d-��Z.gd.�Z/d/d0�Z0e)d1dd�d2d3��Z1e)d4d5dd�d6d7��Z
e)d8d9dd�d:d;��Z2e)d<d=dd�d>d?��Z3d@dA�Z4e)dBdCdd�dDdE��Z5e)dFdd�dGdH��Z6e)dIdd�dJdK��Z7e)dLdMdd�dNdO��Z8e)dPdQdd�dRdS��Z9e)dTdUdd�dVdW��Z:e)dXdYdd�dZd[��Z;e)d\d]dd�d^d_��Ze)d`dd�dadb��Z<e)dcdFdd�ddde��Z=dS)g�)�absolute_importN�)�_)�hex)�getattr)
�bundle2�bundlecaches�changegroup�	discovery�encoding�error�exchange�pushkey�pycompat�requirements�streamclone�util�wireprototypes)�procutil�
stringutils/incompatible Mercurial client; bundle2 requireds9see https://www.mercurial-scm.org/wiki/IncompatibleClients%s
(%s)
cCs6|��D]$}|�d�r|dd��d�SqddgS)aReturns a list of compression methods supported by the client.

    Returns a list of the compression methods supported by the client
    according to the protocol capabilities. If no such capability has
    been announced, fallback to the default of zlib and uncompressed.
    scomp=�N�,szlibsnone)�getprotocaps�
startswith�split)�protoZcap�r�A/usr/lib64/python3.9/site-packages/mercurial/wireprotov1server.py�clientcompressionsupport0s
rcCs|j�dd�}|�|�S)z�Obtain the repo used for processing wire protocol commands.

    The intent of this function is to serve as a monkeypatch point for
    extensions that need commands to operate on different repo views under
    specialized circumstances.
    �serversview)�uiZconfigZfiltered)�repor�commandZ
viewconfigrrr�getdispatchrepo@sr#cCs4t|||�}t|\}}|�|�}|||g|�R�S�N)r#�commandsZgetargs)r!rr"�func�spec�argsrrr�dispatchKs
r)cCsJi}|D]}||vr||||<||=q|rFtj�d|d�|�f�|S)Ns,warning: %s ignored unexpected arguments %s
r)r�stderr�write�join)�cmd�keys�others�opts�krrr�optionsTs��r2cCsv|j}tj|jv}|r2|�dd|�}|dur2|S|�dd|�}|durN|S|rj|�dd�}|durj|S|�dd�S)z�Whether a bundle1 operation is allowed from the server.

    Priority is:

    1. server.bundle1gd.<action> (if generaldelta active)
    2. server.bundle1.<action>
    3. server.bundle1gd (if generaldelta active)
    4. server.bundle1
    rsbundle1gd.%sNs
bundle1.%ss	bundle1gdsbundle1)r �requirementsmodZGENERALDELTA_REQUIREMENTr�
configbool)r!�actionr �gd�vrrr�bundle1allowedbs
r8�pushcs`dd�tj��D���dvr*t�d����dur6d�t�t�sJt�d������fdd	�}|S)
a�Decorator to declare a wire protocol command.

    ``name`` is the name of the wire protocol command being provided.

    ``args`` defines the named arguments accepted by the command. It is
    a space-delimited list of argument names. ``*`` denotes a special value
    that says to accept all named arguments.

    ``permission`` defines the permission type needed to run this command.
    Can be ``push`` or ``pull``. These roughly map to read-write and read-only,
    respectively. Default is to assume command requires ``push`` permissions
    because otherwise commands not declaring their permissions could modify
    a repository that is supposed to be read-only.
    cSs h|]\}}|ddkr|�qS)sversionrr)�.0r1r7rrr�	<setcomp>�sz#wireprotocommand.<locals>.<setcomp>)r9�pullsCinvalid wire protocol permission; got %s; expected "push" or "pull"N�s:arguments for version 1 commands must be declared as bytescs0�tvrt�d���tj|���d�t�<|S)Ns+%s command already registered for version 1)r(�
transports�
permission)r%r�ProgrammingErrorrZcommandentry)r&�r(�namer?r>rr�register�s��
z"wireprotocommand.<locals>.register)rZ
TRANSPORTS�itemsrr@�
isinstance�bytes)rBr(r?rCrrAr�wireprotocommand�s"���
�rGsbatchscmds *r<)r?csXtj}g}|�d�D�]0}|�dd�\}}i}	|�d�D]&}
|
r8|
�d�\}}||�|	||�<q8t|\}
}t|j}|�|�|�r|��}i�|D]H}|dkr�i}|	��D]}||vr�|	|||<q�|�d<q�|	|�|<q�|
||g�fdd�|D��R�}n
|
||�}t|tj��r"|St|tj	��r6|j
}|�t�|��qt�	d�
|��S)	N�;� rr�=�*csg|]}�|�qSrr)r:r1��datarr�
<listcomp>�r=zbatch.<locals>.<listcomp>)rZunescapebatchargrr%r?Z	checkpermr.rE�ooberror�
bytesresponserM�appendZescapebatchargr,)r!rZcmdsr/Zunescapearg�resZpair�opr(Zvals�a�nr7r&r'Zpermr.r1Zstar�key�resultrrLr�batch�s>


"
rXsbetweenspairscCsLdd�|�d�D�}g}|�|�D]}|�t�|�d�q"t�d�|��S)NcSsg|]}t�|d��qS)�-)r�
decodelist)r:�prrrrN�r=zbetween.<locals>.<listcomp>rI�
r=)r�betweenrQr�
encodelistrPr,)r!r�pairs�r�brrrr]�s
r]�	branchmapcCs\|��}g}t�|�D]4\}}t�t�|��}t�|�}|�	d||f�qt�
d�|��S)Ns%s %sr\)�	branchmapr�	iteritems�urlreq�quoterZ	fromlocalrr^rQrPr,)r!rrc�heads�branch�nodesZ
branchnameZbranchnodesrrrrc�s
rcsbranches�nodescCsBt�|�}g}|�|�D]}|�t�|�d�qt�d�|��S)Nr\r=)rrZ�branchesrQr^rPr,)r!rrir`rarrrrk�s

rksclonebundlesr=cCst�|j�tj��S)aZServer command for returning info for available bundles to seed clones.

    Clients will parse this response and determine what bundle to fetch.

    Extensions may wrap this command to filter or dynamically emit data
    depending on the request. e.g. you could advertise URLs for the closest
    data center given the client's IP address.
    )rrP�vfs�tryreadrZCB_MANIFEST_FILE�r!rrrr�clonebundless
�ro)�lookuprb�pushkey�known�	getbundlesunbundlehashcCstt�}t�d|�r|�d�t�|�rz|j�dd�r@|�d�t�	|�}|t
jhsb|�d�n|�dd�t
|���|j�dd	�r�t�tj|dd
��}|�dt�|��|�dd�tj��|j�dd
�r�|�tj�|j�dd�r�|�tj�|�||�S)a)return a list of capabilities for a repo

    This function exists to allow extensions to easily wrap capabilities
    computation

    - returns a lists: easy to alter
    - change done here will be propagated to both `capabilities` and `hello`
      command without any other action needed.
    �changegroupsubsetrspreferuncompressedsstream-preferredsstreams
streamreqs=%srsexperimentalsbundle2-advertise)Zrolesbundle2=sunbundle=%ssnarrowsnarrowservebrokenellipses)�list�
wireprotocapsr%ZcommandavailablerQrZallowservergenerationr r4Zstreamed_requirementsr3ZREVLOGV1_REQUIREMENTr,�sortedrZ
encodecapsZgetrepocapsrerfZbundlepriorityrZ	NARROWCAPZELLIPSESCAPZaddcapabilities)r!r�capsZrequiredformatsZcapsblobrrr�
_capabilitiess&



ryscapabilitiescCst||�}t�d�t|���S)NrI)ryrrPr,rw�r!rrxrrr�capabilitiesEs
r{schangegroupsrootscsLt�|�}tj|||��d�}t�||dd��t�fdd�d�}tj|d�S)N�ZmissingrootsZancestorsof�01�servecs
��d�S�Ni���readr�Zcgrr�<lambda>Rr=zchangegroup.<locals>.<lambda>r=��gen)	rrZr
�outgoingrg�changegroupmod�makechangegroup�iter�	streamres)r!r�rootsrir�r�rr�rr	Ks

�r	rtsbases headscsRt�|�}t�|�}tj|||d�}t�||dd��t�fdd�d�}tj|d�S)Nr|r}r~cs
��d�Srr�rr�rrr�\r=z#changegroupsubset.<locals>.<lambda>r=r�)rrZr
r�r�r�r�r�)r!r�basesrgr�r�rr�r�changegroupsubsetVs

r��
debugwireargss	one two *cCs0tdddg|�}t�|j||fit�|����S)Nr�sthreesfour)r2rrP�
debugwireargsr�	strkwargs)r!rZoneZtwor/r0rrrr�`s�r�c	s�dd�}|j�d�}|sdSt�||�}t�||�}|s<dS|��j��j�fdd�|D�dd���j�fd	d�|D�dd��t|�}	|D�]N}
|
�	d
�}t
jj�	|�}|r�||	vr�||	vr�q�d|
v�r6z||
d�}
Wnt
y�Yq�Yn0|
�|�r�q�t��fdd
�|
D���rq�t���fdd
�|
D���r6q�d|
v�r�z||
d�}Wnt
�yhYq�Yn0t��fdd
�|D���s�q�|
d}|j�d|�z|j�|�WSt�y�|j�d|�Yq�Yq�0q�dS)a�Return a file object for the first matching pullbundle.

    Pullbundles are specified in .hg/pullbundles.manifest similar to
    clonebundles.
    For each entry, the bundle specification is checked for compatibility:
    - Client features vs the BUNDLESPEC.
    - Revisions shared with the clients vs base revisions of the bundle.
      A bundle can be applied only if all its base revisions are known by
      the client.
    - At least one leaf of the bundle's DAG is missing on the client.
    - Every leaf of the bundle's DAG is part of node set the client wants.
      E.g. do not send a bundle of all changes if the client wants only
      one specific branch of many.
    cSsdd�|�d�D�S)NcSsh|]}t�|��qSr)�binasciiZ	unhexlify)r:�hrrrr;zr=z;find_pullbundle.<locals>.decodehexstring.<locals>.<setcomp>rH)r)�srrr�decodehexstringysz(find_pullbundle.<locals>.decodehexstringspullbundles.manifestNcsg|]}��|��qSr��rev�r:r���clrrrN�r=z#find_pullbundle.<locals>.<listcomp>T)Z	inclusivecsg|]}��|��qSrr�r�r�rrrN�r=sCOMPRESSION�headsc3s|]}��|��vVqdSr$r�r��r��
common_ancrr�	<genexpr>�r=z"find_pullbundle.<locals>.<genexpr>c3s*|]"}��|��vo ��|��vVqdSr$r�r��r�r�Z	heads_ancrrr��s�sbasesc3s|]}��|��vVqdSr$r�r�r�rrr��r=sURLssending pullbundle "%s"
spullbundle "%s" not accessible
)rlrmrZparseclonebundlesmanifestZfilterclonebundleentriesZ
unfiltered�	changelogZ	ancestorsr�getrZcompenginesZ_bundlenames�	TypeError�issubset�all�anyr �debug�open�IOError)r!rr0�clheadsrg�commonr�ZmanifestrRZcompformats�entry�compZaltcompZbundle_headsZbundle_bases�pathrr�r�find_pullbundleisZ





�


r�rsrKc
Cs�tdtj��|�}t�|�D]�\}}tj|}|dkrFt�|�||<q|dkrbt|�d��||<q|dkr~t	|�d��||<q|dkr�|dkr�d||<q�t
|�||<q|d	krtd
|��qt|d�s�t
�|�d��s�|jd
kr�t�t�Stjttd���zt	|j���}t	|�dt	���}t	|�dt	���}	|	�|j�|j�dd��r�d|��v�r�t||||||	�}
|
�r�tjt �!|
�dd�WS|j�dd��r�|�dd�}|�r�|	�s�||k�r�tjt"d�t"d�d��t
j#|dfit�$|���\}}
|�dd�}Wn�tj�y�}z�t
�|�d���sJ|jd
k�rHt�|j%d�WYd}~S�t&�'|j�}d|j%fg}g}|j(du�r�|�)d|j(f�|�*t&�+d||��|�,�}
d}WYd}~n
d}~00tj|
|d�S) Nrsrjscsvrsscsvsboolean�0Fsplains unknown getbundle option type %sr<s
bundlecaps�http-v1��hintr�scommonrs
pullbundlespartial-pullT)r�Zprefer_uncompressedsdisablefullbundlescgs%server has pull-based clones disableds/remove --pull if specified or upgrade Mercurialr~sprefercompressedr\�message�hint�error:abort)-r2rZGETBUNDLE_ARGUMENTSr.rrdrZrur�set�bool�KeyErrorr8r
Zbundle2requestedr�rBrO�bundle2requiredr�Abort�bundle2requiredmain�bundle2requiredhintr�rg�discardZnullidr r4rr�r�rZ
filechunkiterrZgetbundlechunksr��messager�bundle20r�rQ�addpart�
bundlepart�	getchunks)r!rr/r0r1r7Zkeytyper�rgr�Zbundler	�info�chunksZprefercompressed�exc�bundler�manargs�advargsrrr�	getbundle�s��




�
�
����
�r�r�cCs|��}t�t�|�d�S)Nr\)rgrrPr^)r!rr�rrrrg�srgshellocCst||�j}t�d|�S)afCalled as part of SSH handshake to obtain server info.

    Returns a list of lines describing interesting things about the
    server, in an RFC822-like format.

    Currently, the only one defined is ``capabilities``, which consists of a
    line of space separated tokens describing server abilities:

        capabilities: <token0> <token1> <token2>
    scapabilities: %s
)r{rMrrPrzrrr�hellosr�slistkeys�	namespacecCs(t|�t�|�����}t�t�|��Sr$)	rw�listkeysr�tolocalrDrrP�
pushkeymodZ
encodekeys)r!r�	namespace�drrrr�sr�rp�keyc
Csjz$t�|�}|�|�}t|�}d}Wn2tyV}zt�|�}d}WYd}~n
d}~00t�d||f�S)Nrrs%d %s
)	rr��lookupr�	Exceptionr�forcebytestrrrP)r!rrVr1rUr`�success�instrrrr�s


r�rrsnodes *cCs*d�dd�|�t�|��D��}t�|�S)Nr=css|]}|rdpdVqdS)�1r�Nr)r:rarrrr�)szknown.<locals>.<genexpr>)r,�knownrrZrP)r!rrir/r7rrrr�'s
�r�s	protocapsscapscCs&|jtjkrt|�d��|_t�d�S)NrIsOK)rBrZSSHV1r�rZ
_protocapsrPrzrrr�	protocaps/sr�rqsnamespace key old newcCs�t|�dkrHt�|�|krHz|�d�t�|�}WqRtyDYqR0n
t�|�}|���6}|�t�|�t�|�t�|�|�p�d}Wd�n1s�0Y|r�|�	�nd}t
�dt|�|f�S)N�zutf-8Fr=s%d
%s)
�lenrZ	escapestr�decoderr��UnicodeDecodeError�mayberedirectstdior�getvaluerrP�int)r!rr�rV�old�new�outputr`rrrr6s$


�� 
rs
stream_outcCst�t�|��S)z�If the server supports streaming clone, it advertises the "stream"
    capability with a value representing the version and flags of the repo
    it is serving. Client checks to see if it understands the format.
    )r�streamreslegacyrZgeneratev1wireprotornrrr�streamSsr�sunbundlecsTt�|�}|����*}�z�t�||d�dd�}�zx|���|j�dd�rb�fdd�}t�	���nfd\����fd	d�}t
jd
d�\}�|j�d��t
�|t
�d
����D]}��|�q���d�t�|j�d�}t|tj��r.t|d��s.|jdk�r t�t�W|�WWd�Stjttd��t�|||d|���}	t� |	d��rztj!|	�"�d�W|�WWd�St�#|	|�r�|�$�nd�W|�WWd�S|�0W�nvtj%tjtj&f�y.}
�zNt'|
dd��s�z�Wn�tj�yb}
zZt(j)�|
�*��t(j)�+�t�#d|�r.|�$�nd�WYd}
~
WYd}
~
Wd�Sd}
~
0tj&�y�t�,t
�-|
�|�r�|�$�nd�YWYd}
~
Wd�S0t.�/|j�}t'|
dd�D]}|�0|��qʐzz�W�ntj1�y�}
z�t'|
dd�}
|
du�r&d|
�2dd�v�r&�|�3d�}|�4d|
j5�|
j6du�r\|j4d|
j6dd �|
j7du�rz|j4d!|
j7dd �|
j8du�r�|j4d"|
j8dd �|
j9du�r�|j4d#|
j9dd �|
j:du�r�|j4d$|
j:dd �WYd}
~
n
d}
~
00W�ntj%�yV}
zL|�3d%�}|
j;du�r&|�4d&|
j;�|
j<�rB|�4d'd(�=|
j<��WYd}
~
n�d}
~
0tj�y�}
zLd)|
j>fg}g}|
j?du�r�|�@d*|
j?f�|�0t.�Ad+||��WYd}
~
nHd}
~
0tj&�y�}
z$|�3d,d)tB�C|
�fg�WYd}
~
n
d}
~
00tj!|�"�d�WYd}
~
Wd�Sd}
~
00Wd�n1�sF0YdS)-Nspreparing changescSsdSr$rrrrrr�cr=zunbundle.<locals>.<lambda>rsstreamunbundlecs�D]}qdSr$r)r[)�payloadrr�cleanuphszunbundle.<locals>.cleanup)NNcs�r����rt���dSr$)�close�os�unlinkr)�fp�tempnamerrr�ssshg-unbundle-)�prefixs"redirecting incoming bundle to %s
swb+rr9r�r�r~saddpartr�r=Zduringunbundle2FZ_bundle2salvagedoutputrZ
_replycapsrqserrors
error:pushkeysin-reply-tor�)Z	mandatoryr�snewsoldsretserror:unsupportedcontentsparttypesparams�r�r�r�serror:pushraced)DrrZr�r
Zcheck_headsZ
getpayloadr r4rZchunkbufferrZmkstempr�r��fdopenZsysstrr+�seekZ
readbundlerEr�Zcg1unpackerr8rBrOr�rr�r�r��unbundleZclientZsafehasattrr�r�Zpushresr�ZBundleValueErrorZ	PushRacedrrr*�format�flushZpusherrZbytestrrr�r�Z
PushkeyFailedr�ZnewpartZaddparamZpartidr�rVr�r��retZparttype�paramsr,r�r�rQr�rr�)r!rrgZtheir_headsr�r��fdr[r�r`r�r��outZ
remotecaps�partZerrpartr�r�r)r�r�r�rr�\s�
�
��
������
�2�$��
�.
(��r�)Nr9)>Z
__future__rr�r�Zi18nrZnoderrr�rrr	r�r
rrr
rr�rr3rrrZutilsrrZurlerrrer�r�r�rr#r)r2r8Zcommanddictr%rGrXr]rcrkrorvryr{r�r�r�r�rgr�r�r�r�r�r�r�rrrr�<module>s|<�	
0
-
	


	

+




	
F
N












Youez - 2016 - github.com/yon3zu
LinuXploit