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/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/__pycache__/ancestor.cpython-39.pyc
a

�+�b2�@szddlmZddlZddlmZddlmZmZmZe�	d�Z
dd�Zd	d
�ZGdd�de
�Zd
d�ZGdd�de
�ZdS)�)�absolute_importN�)�nullrev)�dagop�policy�pycompat�parserscGs�t|t�st|�}t|vr t�St|�dkr0|Sdt|�>d}dgt|�d}t|�D]\}}d|>||<qZd|d>}t�}t|�}t|�d}	|	dk�r�|�r�|	}
|	d8}	||
s�q�||
}||kr�|d8}||kr�|�|
�||O}|
|vr�|
hS||k�rd||
�D]R}||}
|tk�r(�q|
dk�rD|||<|d7}n|
|k�r|||O<�qq�||
�D]<}|tk�r~�ql||}
|
�r�|
|k�r�|d8}|||<�qlq�|S)z�Returns a set with the heads of all common ancestors of all nodes,
    heads(::nodes[0] and ::nodes[1] and ...) .

    pfunc must return a list of parent vertices for a given vertex.
    rr)�
isinstance�setr�len�max�	enumerate�add)�pfunc�nodesZallseen�seen�i�nZpoison�gca�interesting�nv�v�sv�p�sp�r�8/usr/lib64/python3.9/site-packages/mercurial/ancestor.py�commonancestorsheadssZ







rcs4�fdd�}t�g|�R�}t|�dkr,|S||�S)z�
    Returns the common ancestors of a and b that are furthest from a
    root (as measured by longest path).

    pfunc must return a list of parent vertices for a given vertex.
    csi}t|�d}dg|}dg|}g}tt|��D]6\}}d||<d|>}|||<d||<|�||f�q4|d}	|	dk�r�t|�dk�r�|	}
|	d8}	||
}|dkr�qt||
}�|
�D]�}
|
tkr�q�||
}||
}||k�r<|d||
<||k�r�||d7<|||
<|�r�||d8<||dk�r�||=q�||dkr�||B}||k�r\q�|||
<|�|d�||d7<||d8<||dkr�||=q�||d8<||dkrt||=qtt|�dk�r�gSd�|D]}�|O��q�fdd�|D�S)Nrrcsh|]\}}�|@r|�qSrr)�.0rr��krr�	<setcomp>��z-ancestors.<locals>.deepest.<locals>.<setcomp>)rr
�sorted�appendrr�
setdefault)rr�count�depthr�mappingrr�brrZdvrrZdprZnsp�rrr�deepestWsh




zancestors.<locals>.deepestr)rr)rZ	orignodesr+rrr*r�	ancestorsOs
8r,c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�incrementalmissingancestorsapersistent state used to calculate missing ancestors incrementally

    Although similar in spirit to lazyancestors below, this is a separate class
    because trying to support contains and missingancestors operations with the
    same internal data structures adds needless complexity.cCs&t|�|_|js|j�t�||_dS�N)r
�basesrrr)�selfrr/rrr�__init__�s
z$incrementalmissingancestors.__init__cCs|jo|jthkS)z0whether the common set has any non-trivial bases)r/r�r0rrr�hasbases�sz$incrementalmissingancestors.hasbasescCs|j�|�dS)z)grow the ancestor set by adding new basesN)r/�update)r0Znewbasesrrr�addbases�sz$incrementalmissingancestors.addbasescCst�|j|j�Sr.)rZheadrevsr/rr2rrr�
basesheads�sz&incrementalmissingancestors.basesheadscs�|j}|j}|�|�|�t�|s(dSt|��t�fdd�|D��}t|�|krVdSt�	�t
|�dd�D]6}||vrzql|�|�|�||��t|�|krlq�qldS)z:remove all ancestors of bases from the set revs (in place)Nc3s|]}|�krdVqdS)rNr�r�r��startrr�	<genexpr>�r"zBincrementalmissingancestors.removeancestorsfrom.<locals>.<genexpr>r���)r/r�difference_update�discardrr�sumrr�xrange�minr4)r0�revsr/rZ	keepcount�currrr9r�removeancestorsfrom�s"


z/incrementalmissingancestors.removeancestorsfromcCs@t|�}|j}|j}|�|�}|�|�|s0gStt|�t|��}g}t�|td�D]�}|sb�q4||vr�|�	|�||�D]"}	|�
|	�|�|	�|�|	�q|qT||vr�|�|�|�	|�|}
|}n||vrT|}
|}nqT||�D]L}	|	tkr�q�|	|v�s|	|v�r&|�
|	�|�|	�|�|	�q�|
�|	�q�qT|�
�|S)areturn all the ancestors of revs that are not ancestors of self.bases

        This may include elements from revs.

        Equivalent to the revset (::revs - ::self.bases). Revs are returned in
        revision number order, which is a topological order.r<)r
r/r�intersectionr=rrr@r�remover>rr$�reverse)r0rBZ	revsvisitZ
basesvisitrZ	bothvisitr:�missingrCrZ	thisvisitZ
othervisitrrr�missingancestors�sL








z,incrementalmissingancestors.missingancestorsN)
�__name__�
__module__�__qualname__�__doc__r1r3r5r6rDrIrrrrr-�sr-ccs2th}tj}tj}tj}|j}|rFdd�|D�}	|�|�t�|	�n\g}	t�|	�|D]H}
||
�\}}||vr�||	|�||�||vrX||	|�||�qX|	�r.|	d}
|
|kr��q.|
V||
�\}}||v�r|
|dkr�||	d<n||	|�||�n||	�||vr�||	|�||�q�dS)NcSsg|]
}|�qSrrr7rrr�
<listcomp>r"z&_lazyancestorsiter.<locals>.<listcomp>rr)r�heapq�heappush�heappop�heapreplacerr4�heapify)Z
parentrevsZinitrevs�stoprev�	inclusiverrPrQrR�seeZvisitr8Zp1Zp2�currentrrr�_lazyancestorsitersD





rXc@s2eZdZddd�Zdd�ZeZdd�Zd	d
�ZdS)
�
lazyancestorsrFcsJ||_�fdd�|D�|_�|_||_t�|_t|j|j|j|j�|_dS)a�Create a new object generating ancestors for the given revs. Does
        not generate revs lower than stoprev.

        This is computed lazily starting from revs. The object supports
        iteration and membership.

        cl should be a changelog and revs should be an iterable. inclusive is
        a boolean that indicates whether revs should be included. Revs lower
        than stoprev will not be generated.

        Result does not include the null revision.csg|]}|�kr|�qSrrr7�rTrrrNNr"z*lazyancestors.__init__.<locals>.<listcomp>N)�_parentrevs�	_initrevs�_stoprev�
_inclusiver
�
_containsseenrX�
_containsiter)r0rrBrTrUrrZrr1As�zlazyancestors.__init__cCs,ztt|��WdSty&YdS0dS)z*False if the set is empty, True otherwise.TFN)�next�iter�
StopIterationr2rrr�__nonzero__Ws
zlazyancestors.__nonzero__cCst|j|j|j|j�S)aGenerate the ancestors of _initrevs in reverse topological order.

        If inclusive is False, yield a sequence of revision numbers starting
        with the parents of each revision in revs, i.e., each revision is
        *not* considered an ancestor of itself. Results are emitted in reverse
        revision number order. That order is also topological: a child is
        always emitted before its parent.

        If inclusive is True, the source revisions are also yielded. The
        reverse revision number order is still enforced.)rXr[r\r]r^r2rrr�__iter__as�zlazyancestors.__iter__cCs�|j}||vrdS|j}|dur$dS|dur0dS|j}z2t|�}||�||krVWdS||kr8WdSq8Wnty�d|_YdS0dS)z5Test whether target is an ancestor of self._initrevs.TNF)r_r`rrarc)r0�targetrrbrVZrevrrr�__contains__ps&zlazyancestors.__contains__N)rF)rJrKrLr1rd�__bool__rergrrrrrY@s

rY)Z
__future__rrOZnoder�rrrZ	importmodrrr,�objectr-rXrYrrrr�<module>s
9G~,

Youez - 2016 - github.com/yon3zu
LinuXploit