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 :  /lib64/python3.9/site-packages/hgext/remotefilelog/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/hgext/remotefilelog/__pycache__/remotefilectx.cpython-39.opt-1.pyc
a

�+�b�K�@s�ddlmZddlZddlZddlmZmZmZddlm	Z	m
Z
mZmZm
Z
ddlmZe
jZdZGdd	�d	e
j�ZGd
d�de
je�ZdS)�)�absolute_importN)�bin�hex�nullrev)�ancestor�context�error�phases�util�)�shallowutilg�?cs�eZdZd)�fdd�	Zdd�Zedd��Zd*dd	�Zd
d�Zedd
��Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd+dd�Zdd�Zdd �Zd,d!d"�Zd#d$�Z�fd%d&�Zd'd(�Z�ZS)-�
remotefilectxNcsJ|tkr|j}|r&t|�dkr&t|�}tt|��||||||�||_dS)N�()r�nullid�lenr�superr
�__init__�_ancestormap)�self�repo�path�changeid�fileid�filelogZ	changectx�ancestormap��	__class__��G/usr/lib64/python3.9/site-packages/hgext/remotefilelog/remotefilectx.pyrs

�zremotefilectx.__init__cCs|j�|j�S�N)�_filelog�size�	_filenode�rrrrr!.szremotefilectx.sizecCsdd|jvr|jSd|jvr$|j��Sd|jvrX|�|j|j|j|j�}|j	�
�j�|�S|��SdS)N�	_changeid�
_changectx�_descendantrev)
�__dict__r$r%�rev�_adjustlinknode�_pathr r"r&�_repo�
unfiltered�	changelog�linkrev)r�linknoderrrr$1s



�zremotefilectx._changeidcCst|j|j||j|d�S)zMopens an arbitrary revision of the file without
        opening a new filelog)rrr)r
r+r*r )rrrrrr�filectxAs�zremotefilectx.filectxcCs|jSr)�_linkrevr#rrrr.Lszremotefilectx.linkrevc
Cs�|j|jjkrtS|��}||j\}}}}|jjj�|�}|durH|S|j}|j}|j�	�j}	|jj
}
tt|	�ddd�D]F}|	�
|�}|	�|�}||dvr|||
|d���|�kr||Sq|dS)Nrr����)r"r+rrrr-�indexZget_revr*r,�manifestlog�ranger�node�read�readfast�get)
rr�p1�p2r/�copyfromr(rr�cl�mflr7�datarrrr1Os(
�
zremotefilectx._linkrevcCsb|��}t|�}d|vpd|v}|s2|��|kr6|S|j|j|j|j|��dd�}|jj�|�S)areturn the rev of the changeset which introduced this file revision

        This method is different from linkrev because it take into account the
        changeset the filectx was created from. It ensures the returned
        revision is one of its ancestors. This prevents bugs from
        'linkrev-shadowing' when a file revision is used by multiple
        changesets.
        r$r%T��	inclusive)	r.�varsr(r)r*r r"r+r-)rZlkr�attrsZnoctxr/rrr�introrevos	�zremotefilectx.introrevc
	Cs�|��}||j\}}}}|s"dS||f}|��|��kr>|S|��}|j}|j��D]4}	z||	�|�krrWdSWqVtj	y�YqV0qV|S)a#check if file was actually renamed in this changeset revision

        If rename logged in file revision, we report copy for changeset only
        if file revisions linkrev points back to the changeset in question
        or both changeset parents contain different file revisions.
        N)
rr"r(r.rr%�parents�filenoder�LookupError)
rrr;r<r/r=�renamed�name�fnode�prrrrI�s zremotefilectx.renamedcCs|��}|o|dS)Nr)rI)r�copyrrr�
copysource�szremotefilectx.copysourcecCs|js|���|j�|_|jSr)rrrr"r#rrrr�szremotefilectx.ancestormapcCs�|j}|��}||j\}}}}g}||jkrh|p6|j}|�|�}	t||||	|d�}
|��|
_|�	|
�||jkr�|j}|�|�}	t||||	|d�}|��|_|�	|�|S)N)rrr)
r+rr"rr*�filer
r(r&�append)rrrr;r<r/r=�resultsrZflog�p1ctx�p2ctxrrrrF�s*



�




�

zremotefilectx.parentsc	CsH|�|�}|d|d}}||vrD|||���|�krD|�|�SdS)zBreturns the node for <path> in <ancrev> if content matches <fnode>rr3N)r8r9r:r7)	r�ancrevr>r?rrKZancctxZmanifestnode�filesrrr�_nodefromancrev�s


zremotefilectx._nodefromancrevFcs2|j}|��j�|j}|��}||d}	|durPdd�|jd��D�}
d}n|g}
|�|
|	�rf|	Sd��fdd�|
D��t|�|t	�
|j�t	�|j�d�}|jj
d
i|��|j}d}
�j|
|d�}|D]`}|�|�|||�}|dur�|S|
s�|�||�tjkr�|�||||
|�}|�r(|Sd}
q�|	S)a�return the first ancestor of <srcrev> introducing <fnode>

        If the linkrev of the file revision does not point to an ancestor of
        srcrev, we'll walk down the ancestors until we find one introducing
        this file revision.

        :repo: a localrepository object (used to access changelog and manifest)
        :path: the file path
        :fnode: the nodeid of the file revision
        :filelog: the filelog of this path
        :srcrev: the changeset revision we search ancestors from
        :inclusive: if true, the src revision will also be checked

        Note: This is based on adjustlinkrev in core, but it's quite different.

        adjustlinkrev depends on the fact that the linkrev is the bottom most
        node, and uses that as a stopping point for the ancestor traversal. We
        can't do that here because the linknode is not guaranteed to be the
        bottom most one.

        In our code here, we actually know what a bunch of potential ancestor
        linknodes are, so instead of stopping the cheap-ancestor-traversal when
        we get to a linkrev, we stop when we see any of the known linknodes.
        �NcSsg|]}|���qSr)r()�.0rLrrr�
<listcomp>��z1remotefilectx._adjustlinknode.<locals>.<listcomp>T� csg|]}t��|���qSr)rr7)rXr(�r>rrrY�rZ)�revsrK�filepath�userZreponame�linkrevfixup�adjusting linknode
FrA)r`ra)r+r,r-r5rrF�_verifylinknode�joinrrZgetusername�uiZgetreponame�logZ_phasecache�	ancestorsrVZphaser	Zpublic�_forceprefetch)rrrrKZsrcrevrBrr?rr/r]�commonlogkwargsZpcZ
seenpublicZiterancrTZlnoderr\rr)�sB


�
�zremotefilectx._adjustlinknodecCs�d}t��}�zDz�|jj|t|�fgdd�d|_|��|d}|�||�r�d}|WWt��|}	|jjd|dfd|	d	i|��Sd
}WWt��|}	|jjd|dfd|	d	i|��dSt	�y }
zFd|
}WYd}
~
Wt��|}	|jjd|dfd|	d	i|��dSd}
~
00Wt��|}	|jjd|dfd|	d	i|��n0t��|}	|jjd|dfd|	d	i|��0dS)NrZT)�forcerWs#remotefilelog prefetching succeededr`�
�elapsedi�s#remotefilelog prefetching not founds%remotefilelog prefetching failed (%s))
�time�fileservice�prefetchrrrrbrdre�	Exception)rrrrKr]rhZlogmsg�startr/rk�errrrgs|*�������������������zremotefilectx._forceprefetchcsJ|sdSz&|j��j�t��fdd�|D��WStjyDYdS0dS)a�
        Check if a linknode is correct one for the current history.

        That is, return True if the linkrev is the ancestor of any of the
        passed in revs, otherwise return False.

        `revs` is a list that usually has one element -- usually the wdir parent
        or the user-passed rev we're looking back from. It may contain two revs
        when there is a merge going on, or zero revs when a root node with no
        parents is being created.
        Fc3s |]}�����|��VqdSr)Z
isancestorr7)rX�r�r>r/rr�	<genexpr>qrZz0remotefilectx._verifylinknode.<locals>.<genexpr>N)r+r,r-�anyrrH)rr]r/rrsrrb`szremotefilectx._verifylinknodec
cs�g}t�|f�}t�}|rv|��}|��|vr0q|�|���|�|�|��}d}|D]}|sd|sn|�|�d}qXq|�d�t|ddd�d�}|D]
}	|	Vq�dS)NTFrcSs|��Sr)r.)�xrrr�<lambda>�rZz)remotefilectx.ancestors.<locals>.<lambda>)�reverse�key)	�collections�deque�set�poprG�addrPrF�sorted)
rZfollowfirstrf�queue�seen�currentrF�firstrLrrrrrfys&


zremotefilectx.ancestorsc
s�|��|��kr(|��|vr(||��S|��|vrL|��|vrL||��S|��|vrp|��|vrp||��S|���|�����fdd�}|��|��f}|��|��f}t�|||�}|r�|\}}t|j||�d�}	|	SdS)NcsD|\}}��|�p��|�}|s$gS|dp.||df||dfgS)Nr3rr)r:)rv�f�nrL�ZamapZbmaprrrF�s
z'remotefilectx.ancestor.<locals>.parents)rr)rrrGrZgenericancestorr
r+)
rZfc2ZactxrF�a�b�resultr�r�rrrr�rr�s"zremotefilectx.ancestorcs"|}|�dd�}|rF|��}|��|krFt|j|j||j|j|jd�}g}t	�}t
�|f�}|�|�
��|r�|��}	|	��|��kr�|�|	��t|	���f�|r�|	|vr�qj|	��D](}
|
�
�|vr�|�|
�
��|�|
�q�qj|jj�dt|��|�r|jj�|�tt|�j|i|��S)N�prefetchskip)rrrrs1remotefilelog: prefetching %d files for annotate
)r}rEr(r
r+r*r"r rr|rzr{r~r7rGrPrrrFrd�debugrrmrnr�annotate)r�args�kwargsZintroctxr�rEZfetchr�r�r��parentrrrr��sF���zremotefilectx.annotatecCsgSrrr#rrr�children�szremotefilectx.children)NNNNN)N)F)F)�__name__�
__module__�__qualname__rr!�
propertycacher$r0r.r1rErIrNrrFrVr)rgrbrfrr�r��
__classcell__rrrrr
s4�




LE
",r
cs.eZdZd�fdd�	Zdd�Zdd�Z�ZS)	�remoteworkingfilectxNcs d|_tt|��||||�dSr)rrr�r)rrrrZ
workingctxrrrr�s
�zremoteworkingfilectx.__init__cCs
t�|�Sr)r
rFr#rrrrF�szremoteworkingfilectx.parentsc
Cs2|j�s,|j}|jj}|��}|r(|}n||dj�||jj�f}||jjf}t	|�dkrt||dj�||jj�f}i}|d|jjkr�|jj
|d|dd�}|�|���
|d��|d|jjkr�|jj
|d|dd�}|�|���
|d��d}	|�r
|d}	|d|d|jj|	f|d<||_|jS)Nrr)rrZ)rr*r%Z_parentsrIZ	_manifestr:r+rrr0�updaterr)
rrZpclrIr;r<�mrRrSr=rrrr�s.z remoteworkingfilectx.ancestormap)NN)r�r�r�rrFrr�rrrrr��sr�)Z
__future__rrzrlZmercurial.noderrrZ	mercurialrrrr	r
�rr�ZFASTLOG_TIMEOUT_IN_SECSr0r
Zworkingfilectxr�rrrr�<module>sQ

Youez - 2016 - github.com/yon3zu
LinuXploit