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

�+�bF��@svddlmZddlZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
e
jZe
jZdZdd	�Zd@dd�ZdAd
d�Zdd�ZdBdd�Zdd�Zdd�Zdd�ZdCdd�Zdd�ZGdd�de�Zdd �ZdDd!d"�Zd#d$�ZdEd%d&�Z d'd(�Z!ej"d)d)d*�Gd+d,�d,e��Z#ej"d)d)d*�Gd-d.�d.e��Z$d/d0�Z%d1d2�Z&d3d4�Z'dFd5d6�Z(dGd8d9�Z)d:d;�Z*dHd<d=�Z+d>d?�Z,dS)I�)�absolute_importN�)�attr��nullrev)�error�mdiff�patch�pycompat�scmutil�smartsetlccs4|durd}|durt}|dkr$dS|dkr6t�d��|r@d}nd}|�|�t|�}g}t|d�}|dur�t�|||df�d}	|�r0t�|�\}
}||
}
|
|kr�t|d�}|dur�t�|||df�|
|	k}|r�||kr�|
}	|
V|d}
|r�|
|kr�||
�D]$}|t	k�rt�||||
f��qq�dS)a(Walk DAG using 'pfunc' from the given 'revs' nodes

    'pfunc(rev)' should return the parent/child revisions of the given 'rev'
    if 'reverse' is True/False respectively.

    Scan ends at the stopdepth (exlusive) if specified. Revisions found
    earlier than the startdepth are omitted.
    Nrsnegative stopdepth���r)
�maxlogdepthrZProgrammingError�sort�iter�next�heapq�heappush�heappopr)�pfunc�revs�
startdepth�	stopdepth�reverseZheapsignZirevs�pendingheapZinputrevZlastrev�currevZcurdepthZfoundnewZpdepth�prev�r�5/usr/lib64/python3.9/site-packages/mercurial/dagop.py�_walkrevtreesD	




rFc#s�i�g���fdd�}|r d}nd}|D]}||�q(�r�t���}��|�}||fV|D]"}|��d|�D]}||�qrq^q6dS)z�Like filectx.ancestors(), but can walk from multiple files/revisions,
    and includes the given fctxs themselves

    Yields (rev, {fctx, ...}) pairs in descending order.
    cs<t�|�}|�vr*t��|<t��|��|�|�dS�N)rZintrev�setrr�add)�fctx�rev��visitZ	visitheaprr�addvisit\s


z"filectxancestors.<locals>.addvisitrN)rr�pop�parents)�fctxs�followfirstr'�cut�crZcurfctxs�parentrr%r�filectxancestorsSs 


r/cCs dd�t||�D�}t|dd�S)z�Like filectx.ancestors(), but can walk from multiple files/revisions,
    and includes the given fctxs themselves

    Returns a smartset.
    css|]\}}|VqdSr r)�.0r$Z_csrrr�	<genexpr>z�z#filerevancestors.<locals>.<genexpr>F�Ziterasc)r/�generatorset)r*r+�genrrr�filerevancestorstsr6csd|r
d�nd��j����fdd���dur2�}n ��fdd�}|��fdd��}t||||dd�S)	NrcsLz��|�d��WStjyFdd��|��d��D�YS0dS)Ncss|]}|��VqdSr �r$�r0Zpctxrrrr1�r2z7_genrevancestors.<locals>.plainpfunc.<locals>.<genexpr>)�
parentrevsr�WdirUnsupportedr)r7)�clr,�reporr�
plainpfunc�sz$_genrevancestors.<locals>.plainpfunccs�fdd��|�D�S)Ncsg|]}�|�s|�qSrr�r0�r��cutfuncrr�
<listcomp>�r2z6_genrevancestors.<locals>.<lambda>.<locals>.<listcomp>rr7)rAr=rr�<lambda>�r2z"_genrevancestors.<locals>.<lambda>cs
�|�Sr rr7r@rrrC�r2T�r)�	changelog�filterr)r<rr+rrrArr)r;r,rAr=r<r�_genrevancestors~srGcCst||||||�}t|dd�S)a�Like revlog.ancestors(), but supports additional options, includes
    the given revs themselves, and returns a smartset

    Scan ends at the stopdepth (exlusive) if specified. Revisions found
    earlier than the startdepth are omitted.

    If cutfunc is provided, it will be used to cut the traversal of the DAG.
    When cutfunc(X) returns True, the DAG traversal stops - revision X and
    X's ancestors in the traversal path will be skipped. This could be an
    optimization sometimes.

    Note: if Y is an ancestor of X, cutfunc(X) returning True does not
    necessarily mean Y will also be cut. Usually cutfunc(Y) also wants to
    return True in this case. For example,

        D     # revancestors(repo, D, cutfunc=lambda rev: rev == B)
        |\    # will include "A", because the path D -> C -> A was not cut.
        B C   # If "B" gets cut, "A" might want to be cut too.
        |/
        A
    Fr3)rGr4)r<rr+rrrAr5rrr�revancestors�s�rHc	cs�|r
d}nd}|j}|��}|tkr<|V|D]
}|Vq.ndt|�}|�|�D]P}||vrb|VqN|�|�d|�D](}|tkrt||vrt|�|�|VqNqtqNdS)Nr)rE�minrr!rr9r")	r<rr+r,r;�first�i�seen�xrrr�_genrevdescendants�s&

rNcCs�|j}dd�t�|t|��D�}|�|d�D]R}|�|�\}}||krZ|||�|�|s.|tkr.||kr.|||�|�q.|S)z6Build map of 'rev -> child revs', offset from startrevcSsg|]}g�qSrr)r0Z_revrrrrB�r2z(_builddescendantsmap.<locals>.<listcomp>r)rEr
�xrange�lenrr9�appendr)r<�startrevr+r;�descmaprZp1revZp2revrrr�_builddescendantsmap�srTcs4|���t|�|����fdd�}t||||dd�S)Ncs�|�Sr rr7�rSrRrrr�sz(_genrevdescendantsofdepth.<locals>.pfuncFrD)rIrTr)r<rr+rrrrrUr�_genrevdescendantsofdepth�srVcCsB|dur&|dus|tkr&t|||�}nt|||||�}t|dd�S)z�Like revlog.descendants() but supports additional options, includes
    the given revs themselves, and returns a smartset

    Scan ends at the stopdepth (exlusive) if specified. Revisions found
    earlier than the startdepth are omitted.
    NTr3)rrNrVr4)r<rr+rrr5rrr�revdescendants�s
�rWccsxt|�}|tkr&|�D]
}|VqdSt|�}||dd�D]6}||�D](}|tkrH||vrH|�|�|Vq<qHq<dS)akGenerate revision number descendants in revision order.

    Yields revision numbers starting with a child of some rev in
    ``revs``. Results are ordered by revision number and are
    therefore topological. Each revision is not considered a descendant
    of itself.

    ``revsfn`` is a callable that with no argument iterates over all
    revision numbers and with a ``start`` argument iterates over revision
    numbers beginning with that value.

    ``parentrevsfn`` is a callable that receives a revision number and
    returns an iterable of parent revision numbers, whose values may include
    nullrev.
    Nr��start)rIrr!r")r�revsfn�parentrevsfnrJr$rLrrrr�descendantrevs�s

r\c@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�subsetparentswalkeraScan adjacent ancestors in the graph given by the subset

    This computes parent-child relations in the sub graph filtered by
    a revset. Primary use case is to draw a revisions graph.

    In the following example, we consider that the node 'f' has edges to all
    ancestor nodes, but redundant paths are eliminated. The edge 'f'->'b'
    is eliminated because there is a path 'f'->'c'->'b' for example.

          - d - e -
         /         \
        a - b - c - f

    If the node 'c' is filtered out, the edge 'f'->'b' is activated.

          - d - e -
         /         \
        a - b -(c)- f

    Likewise, if 'd' and 'e' are filtered out, this edge is fully eliminated
    since there is a path 'f'->'c'->'b'->'a' for 'f'->'a'.

           (d) (e)

        a - b - c - f

    Implementation-wise, 'f' is passed down to 'a' as unresolved through the
    'f'->'e'->'d'->'a' path, whereas we do also remember that 'f' has already
    been resolved while walking down the 'f'->'c'->'b'->'a' path. When
    processing the node 'a', the unresolved 'f'->'a' path is eliminated as
    the 'f' end is marked as resolved.

    Ancestors are searched from the tipmost revision in the subset so the
    results can be cached. You should specify startrev to narrow the search
    space to ':startrev'.
    NcCs�|dur|�d|�|@}|j}|r*|�}n.|��sP|��sPt�|�}|jdd�t|�}||_|j	|_
||_g|_i|_
i|_i|_t|_||_t|_|��dS)Ns%d:nullTrD)r�fastdescZisdescendingZistopor�basesetrr�_reporE�
_changelog�_subset�_tovisit�_pendingcnt�	_pointers�_parentsr�
_inputhead�
_inputtail�
_bottomrev�
_advanceinput)�selfr<�subsetrRr^Zdesciterrrr�__init__9s(
zsubsetparentswalker.__init__cCst�|�|��S)zVLook up parents of the given revision in the subset, and returns
        as a smartset)rr_r)�rkr$rrr�
parentssetVszsubsetparentswalker.parentssetcCs&|�|�dd�t|j�|g��D�S)z�Look up parents of the given revision in the subset

        The returned revisions are sorted by parent index (p1/p2).
        cSsg|]\}}|�qSrr)r0Z_cr?rrrrBar2z/subsetparentswalker.parents.<locals>.<listcomp>)�_scanparents�sortedrf�getrnrrrr)[s
zsubsetparentswalker.parentscCsbz,|j�|�}|dtkr(|dd�WS|WStjy\tdd�|jd��D��YS0dS)Nr
css|]}|��VqdSr r7r8rrrr1jr2z2subsetparentswalker._parentrevs.<locals>.<genexpr>)rar9rrr:�tupler`r))rkr$rrrr�_parentrevscszsubsetparentswalker._parentrevscCsH|jtkrdSzt|j�|_Wn$tyB|j|_td|_Yn0dS)zBAdvance the input iterator and set the next revision to _inputheadNr)rgrrrh�
StopIterationri)rkrrrrjls
z!subsetparentswalker._advanceinputcs~|j�|j}|j�|j}|j}|s.|jtk�rz��|�dkr@dS|s\t�	||j�|�
�|j|dkr�t�	||j�|�
�q\t�|�}||jkr�dS|�vr�||vr�q|�v}��
|d�|r�g||<|�|it�f�\}}|�r^|��D]L\}	}
�|	d8<|	|v�rq�||	�|
|f��|	dkr�|�|	�q�|���fdd�|D�}|�|�}t�fdd�|D��}|�r�|�s�|�r�t|�dk�r�||fg}
nd||f|��|��fg}
|D]F}	�|	d7<|
dd|	d7<|
dd|	d	7<�q�t|�D]�\}}t�	||�||v�r�||\}}|
|\}}|��D]@\}	}
|	|v�r��|	d8<t|
||	�||	<n|
||	<�qV|�|�n|
|||<�qt|�dk�r�d
gndd	g}|�r|�rt|�D]$\}}||}
||�|
|f��q�q|rt|�D]^\}}||\}}||}
|�v�r\||�|
|f�|�|�n�|d7<|
||<�qqdS)zNScan ancestors until the parents of the specified stoprev are
        resolvedrNrcsh|]}�|dkr|�qS)rrr>)�
pendingcntrr�	<setcomp>�r2z3subsetparentswalker._scanparents.<locals>.<setcomp>c3s|]}|�vVqdSr r�r0�p)rlrrr1�r2z3subsetparentswalker._scanparents.<locals>.<genexpr>�1�2r2)rbrcrdrerfrgrrrrrrjrri�
setdefaultr(r!�itemsrQr"�clearrt�allrP�copy�	enumeraterI�update)rkZstoprevZtovisitZpointersr)r$Z	curactiveZ
unresolvedZresolvedr?r-r9ZbothparentsactiveZparentpointersrKryZknownunresolvedZ
knownresolvedZ
chaincodesr)rvrlrrpvs�



�


z subsetparentswalker._scanparents)N)
�__name__�
__module__�__qualname__�__doc__rmror)rtrjrprrrrr]s%
	
r]cCs�|sgSt|�}t|�}t�}i}|j}|j}	|j}
|r�|
�}||vrT||�|sTq4||�}|||<|D]}
|
|krh|
|vrh|	|
�qhq4|s�t�S|s�|St|�D]"}||D]}
|
|vr�||�q�q�|S�zSee revlog.reachableroots)r!�listr"rQr(r_rq)r�minroot�roots�heads�includepathr&�	reachablerLZreachedZdovisitZ	nextvisitr$r)r.rrr�_reachablerootspures:r�cCsH|s
t�S|��}t|�}t|�}|j�||||�}t|�}|��|Sr�)r_rIr�rE�reachablerootsr)r<r�r�r�r�rrrrr�(sr�cCs@t�|��|��|�}t�||�\}}tdd�|D��}||fS)z�Return `(diffinrange, linerange1)` where `diffinrange` is True
    if diff from fctx2 to fctx1 has changes in linerange2 and
    `linerange1` is the new line range for fctx1.
    css|]\}}|dkVqdS)�!Nr)r0�_�styperrrr1<r2z _changesrange.<locals>.<genexpr>)r�	allblocks�dataZ
blocksinrange�any)Zfctx1Zfctx2�
linerange2�diffopts�blocksZfilteredblocks�
linerange1Zdiffinrangerrr�
_changesrange5sr�c
cs�t�|jj�}|��}|��|��f|||ffi}|r�|�t|��\}}|�	�}|r`|dd�}|sp||fVq2d}	|D]R}
t
|
|||�\}}|	p�|}	|d|dkr�qx|��|
_|
|f||
��|
��f<qx|	r2||fVq2dS)zgYield ancestors of `fctx` with respect to the block of lines within
    `fromline`-`toline` range.
    NrFr)
r	r�r`�uiZintrofilectxZlinkrevZfilenoder(�maxr)r�r$Z_descendantrev)
r#�fromline�toliner+r�r&r-r��pl�inrangery�inrangepr�rrr�blockancestors@s*

r�c
cs>ztt|||��\}}Wnty*Yn0||kr>||fVt�|jj�}|��}|��|||ffi}|�	|��g�D]�}|�
|�}d}	|�|�D]�}
z||
\}}Wnty�Yq�Yn0t
||||�\}
}|	p�|
}	||v�r||d|k�rt|||d�\}}t|�t|�f}||f||<q�|	rx||fVqxdS)ziYield descendants of `fctx` with respect to the block of lines within
    `fromline`-`toline` range.
    FrN)rr�rur	r�r`r�ZfilelogZfilerevZdescendantsZfilectxr9�KeyErrorr��ziprIr�)r#r�r�r-r�r�ZflrLrKr�rMryr�r�ZlbsZubsrrr�blockdescendantsbs2


r�T)�slots�frozenc@s4eZdZe��Ze��Zejdd�Zejdd�ZdS)�annotatelineF)�defaultN)	r�r�r�r�ibr#�lineno�skip�textrrrrr��sr�c@s,eZdZe��Ze��Ze��Ze��ZdS)�_annotatedfileN)	r�r�r�rr�r*�linenos�skipsr�rrrrr��sr�cCs*|�d�r|�d�S|�d�tt|��S)N�
)�endswith�count�int�bool)r�rrr�_countlines�s

r�cCs2t|�}t�d|d�}t|g||dg||�S)NrF)r�r
Z	rangelistr�)r�r#�nr�rrr�_decoratelines�sr�cs���fdd�|D�}|r&dd�|D�}|D]n\}}|D]`\\}}	}
}}|dkr6|j||	��j|
|�<|j||	��j|
|�<|j||	��j|
|�<q6q*|�r�|��dd�|D�}
t|�D]�\}\}}|D]�\\}}	}
}}|	|||
k�rRt�|
|�D]R}�j||kr�t|||
|	d�}|j|�j|<|j|�j|<d�j|<q�q�|
|d�||	|
|f�q�q�|
D]�\}}|D]r\}}	}
}t�|
|�D]V}�j||k�r�t|||
|	d�}|j|�j|<|j|�j|<d�j|<�q��q��qt�S)ap
    Given parent and child fctxes and annotate data for parents, for all lines
    in either parent that match the child, annotate the child with the parent's
    data.

    Additionally, if `skipchild` is True, replace all other lines with parent
    annotate data as well such that child is never blamed for any lines.

    See test-annotate.py for unit tests.
    cs$g|]}|tj|j�j�d�f�qS))Zopts)rr�r�)r0r.��childr�rrrB�s�z!_annotatepair.<locals>.<listcomp>cSsg|]\}}|t|�f�qSr)r�)r0ryr�rrrrB�r2�=cSsg|]\}}|gf�qSrr)r0r.Z_blocksrrrrB�r2rT)	r*r�r�rr�r
rOrIrQ)r)Z	childfctxr��	skipchildr�Zpblocksr.r�Za1Za2�b1�b2�tZ	remaining�idxZ_tZbkZakrr�r�
_annotatepair�sB�
r�cs�|g}i}|di}|rj|��}||vr(q||�}|||<|D]*}	|�|	d�d||	<|	|vr<|�|	�q<q|g|dd�<i�|�r^|d}|�vr�|��q|d}
||}|D]}	|	�vr�d}
|�|	�q�|
r||��t|��|�}d}|dur�|j|v}t�fdd�|D�||||�}|D]2}	||	dk�r:�|	=||	=n||	d8<�q|�|<||=q|�|}
d	d�t|
j|
j	|
j
t�|
j
��D�S)
zrCore algorithm for filectx.annotate()

    `parents(fctx)` is a function returning a list of parent filectxs.
    rrNr
TFcsg|]}�|�qSrrrx�ZhistrrrBr2zannotate.<locals>.<listcomp>cSsg|]}t|��qSr)r�r>rrrrB+s�)r(rrrQr�r�Z	_changeidr�r�r*r�r�rZ
splitnewlinesr�)�baser)Zskiprevsr�r&ZpcacheZneeded�fr�ryZreadyZcurrr��arr�r�annotate�s\
��r�rc#s0|jdd�t|�}g|fg}g}t�}t�|�tj}tj}|D�]�}	|	|vrf|||	�|�|	�d��|	krB||��|����fdd�t|�D�}
|
r�|
�	d�}||\}}
|
D]&}||}|�
|d�|
|dO}
q�t|
�D]
}||=q�nt|�}|�
g�hf�||}�|	k�r0|d�
��|d���dd�|��D�}|d�|�|D]&}||v�rb|�|�|||��qb|�s�t|�dk�r�d}|d}n|d|@�s�d}|durj||dO}|dD]}|V�q�|�r�||=qjg|ddd�<qjqB|D]}|dD]}|V�q�qdS)	a"Yield revisions from heads to roots one (topo) branch at a time.

    This function aims to be used by a graph generator that wishes to minimize
    the number of parallel branches and their interleaving.

    Example iteration order (numbers show the "true" order in a changelog):

      o  4
      |
      o  1
      |
      | o  3
      | |
      | o  2
      |/
      o  0

    Note that the ancestors of merges are understood by the current
    algorithm to be on the same branch. This means no reordering will
    occur behind a merge.
    TrDNcs g|]\}}�|dvr|�qS)rr)r0rK�gr7rrrB�r2ztoposort.<locals>.<listcomp>rrcSsg|]}|tkr|�qSrrrxrrrrB�r2)rr!r�heapifyrrr"�remover�r(�extend�reversedrPrQr�)rZparentsfuncZfirstbranchZ	unblocked�groupsrZ
pendingsetrrZ
currentrevZmatchingZ	targetidxZtrevsZtparentsrKZgrr)ryr?r�rr7r�toposort1sl3	













r�cCs8t|�}th}|j}|D]}|||��q|�|�|S)a�Resolve the set of heads from a set of revisions.

    Receives an iterable of revision numbers and a callbable that receives a
    revision number and returns an iterable of parent revision numbers, possibly
    including nullrev.

    Returns a set of revision numbers that are DAG heads within the passed
    subset.

    ``nullrev`` is never included in the returned set, even if it is provided in
    the input set.
    )r!rr��difference_update)r�	parentsfn�headrevsr)Zupr$rrrr��s

r�cCs�|durt}t|pg�}|h}|h}||dd�D]P}||�D]B}||vrf||vr\|�|�|�|�||vr>||vr>|�|�q>q2|S)a�Returns the set of all revs that have no children with control.

    ``revsfn`` is a callable that with no arguments returns an iterator over
    all revision numbers in topological order. With a ``start`` argument, it
    returns revision numbers starting at that number.

    ``parentrevsfn`` is a callable receiving a revision number and returns an
    iterable of parent revision numbers, where values can include nullrev.

    ``startrev`` is a revision number at which to start the search.

    ``stoprevs`` is an iterable of revision numbers that, when encountered,
    will stop DAG traversal beyond them. Parents of revisions in this
    collection will be heads.
    NrrX)rr!r"r�)rZr[rRZstoprevsr�r�r$rrrr�headrevssubsets

r�cCs�ttt||�dd��}t�}g}|r�|��}|dkr\|d}||vr�|�|�|�|�q |�|d�||�D](}|tkst||vst||vr�qt|�|�qtq |S)a�Linearize and topologically sort a list of revisions.

    The linearization process tries to create long runs of revs where a child
    rev comes immediately after its first parent. This is done by visiting the
    heads of the revs in inverse topological order, and for each visited rev,
    visiting its second parent, then its first parent, then adding the rev
    itself to the output list.

    Returns a list of revision numbers.
    TrDrr)r�rqr�r!r(rQr"r)rr�r&�finished�resultr$rrrr�	linearize4s 

r�)F)F)FNNN)NN)F)F)NN)r)NN)-Z
__future__rrZ
thirdpartyrZnoder�rrr	r
rrr_r4rrr/r6rGrHrNrTrVrWr\�objectr]r�r�r�r�r��sr�r�r�r�r�r�r�r�r�r�rrrr�<module>sL 	5
!

�



 r$


"(	F
B
H
%

Youez - 2016 - github.com/yon3zu
LinuXploit