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

�+�ba��@s�ddlmZddlZddlmZddlmZmZddlm	Z	m
Z
mZmZm
Z
mZddlmZdZdZGd	d
�d
e�ZdPdd
�Zdd�Zdd�ZdQdd�ZdRdd�Zdd�Zdd�Zdd�ZdZdZdZdZ dZ!dZ"d Z#d!Z$e�%d"�e�%d#�e�%d$�e�%d%�gZ&d&d'�Z'd(d)�Z(d*d+�Z)d,d-�Z*d.d/�Z+dSd0d1�Z,Gd2d3�d3e-�Z.dTd4d5�Z/d6d7�Z0d8d9�Z1d:d;�Z2d<d=�Z3d>d?�Z4d@dA�Z5dBdC�Z6edD�edE�edF�edG�edH�dI�Z7dJdK�Z8dLdM�Z9dNdO�Z:dS)U�)�absolute_importN�)�_)�hex�short)�diffutil�encoding�error�phases�pycompat�util)�dateutil�c@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�markerzWrap obsolete marker raw datacCs||_||_d|_dS�N)�_repo�_dataZ_decodedmeta)�self�repo�data�r�7/usr/lib64/python3.9/site-packages/mercurial/obsutil.py�__init__@szmarker.__init__cCs
t|j�Sr)�hashr�rrrr�__hash__Fszmarker.__hash__cCs t|�t|�krdS|j|jkS)NF)�typer�r�otherrrr�__eq__Isz
marker.__eq__cCs
|jdS)z%Predecessor changeset node identifierr�rrrrr�prednodeNszmarker.prednodecCs
|jdS)z-List of successor changesets node identifiersrr rrrr�	succnodesRszmarker.succnodescCs
|jdS)z2Parents of the predecessors (None if not recorded)�r rrrr�parentnodesVszmarker.parentnodescCst|jd�S)zDecoded metadata dictionary�)�dictrrrrr�metadataZszmarker.metadatacCs
|jdS)z#Creation date as (unixtime, offset)�r rrrr�date^szmarker.datecCs
|jdS)zThe flags field of the markerrr rrrr�flagsbszmarker.flagsN)
�__name__�
__module__�__qualname__�__doc__rrrr!r"r$r'r)r*rrrrr=srFccsF|dur|j}n|r t||�}n|j�|�}|D]}t||�Vq0dS)zreturns markers known in a repository

    If <nodes> is specified, only markers "relevant" to those nodes are are
    returnedN)�obsstore�exclusivemarkersZrelevantmarkersr)r�nodesZ	exclusiveZ
rawmarkersZ
markerdatarrr�
getmarkersgsr2cCst|dd�d�S)NcSs|dd�|dpdfS)N���rr)�mrrr�<lambda>y�zsortedmarkers.<locals>.<lambda>)�key��sorted��markersrrr�
sortedmarkerswsr<c	cst|jj}|g}t|�}|rp|��}|�|d�}|D]:}|d}||vrHq2|�|�||vrb|Vq2|�|�q2qdS)z�yield the list of next predecessors pointing on visible changectx nodes

    This function respect the repoview filtering, filtered revision will be
    considered missing.
    rrN)r/�predecessors�set�pop�get�add�append)	rZnodeidZ
precursors�stack�seen�currentZ
currentpreccs�precZ
precnodeidrrr�closestpredecessors|s
rGc	csrt|�}t|�}|jj}|rn|��}|V||d�D]6}|d|@rFq4|d}||vr4|�|�|�|�q4qdS)z�Yield node for every precursors of <nodes>.

    Some precursors may be unknown locally.

    This is a linear yield unsuited to detecting folded changesets. It includes
    initial nodes too.rrrN)r>r=r@r?rA)	r/r1�ignoreflags�	remainingrDrFrE�mark�sucrrr�allpredecessors�s
rLccstt|�}t|�}|rp|��}|V|j�|d�D]<}|d|@rBq0|dD] }||vrJ|�|�|�|�qJq0qdS)z�Yield node for every successor of <nodes>.

    Some successors may be unknown locally.

    This is a linear yield unsuited to detecting split changesets. It includes
    initial nodes too.rrrN)r>r?�
successorsr@rA)r/r1rHrIrDrErJrKrrr�
allsuccessors�s
rNcCsdd�|D�S)z"return a set with no prune markerscSsh|]}|dr|�qS)rr��.0r4rrr�	<setcomp>�r6z _filterprunes.<locals>.<setcomp>rr:rrr�
_filterprunes�srRcsR|��}|jjj}|jj}|jj�|jj}t�}t|�}�fdd�|D�}|�	�t|�}|�rN|�
�}	t|�|	d��}
��|	d�D]}|ds�|
�
|�q�|�|	d�D]}|ds�|
�
|�q�|
D]�}||vr�q�|ds�|d|	kr�|�|�|d}||v�rq�||�}
|
�r||v�rq�t��|��}|�|�r�|�|�|�
|�q�qZ|S)aset of markers relevant to "nodes" but no other locally-known nodes

    This function compute the set of markers "exclusive" to a locally-known
    node. This means we walk the markers starting from <nodes> until we reach a
    locally-known precursors outside of <nodes>. Element of <nodes> with
    locally-known successors outside of <nodes> are ignored (since their
    precursors markers are also relevant to these successors).

    For example:

        # (A0 rewritten as A1)
        #
        # A0 <-1- A1 # Marker "1" is exclusive to A1

        or

        # (A0 rewritten as AX; AX rewritten as A1; AX is unknown locally)
        #
        # <-1- A0 <-2- AX <-3- A1 # Marker "2,3" are exclusive to A1

        or

        # (A0 has unknown precursors, A0 rewritten as A1 and A2 (divergence))
        #
        #          <-2- A1 # Marker "2" is exclusive to A0,A1
        #        /
        # <-1- A0
        #                #         <-3- A2 # Marker "3" is exclusive to A0,A2
        #
        # in addition:
        #
        #  Markers "2,3" are exclusive to A1,A2
        #  Markers "1,2,3" are exclusive to A0,A1,A2

        See test/test-obsolete-bundle-strip.t for more examples.

    An example usage is strip. When stripping a changeset, we also want to
    strip the markers exclusive to this changeset. Otherwise we would have
    "dangling"" obsolescence markers from its precursors: Obsolescence markers
    marking a node as obsolete without any successors available locally.

    As for relevant markers, the prune markers for children will be followed.
    Of course, they will only be followed if the pruned children is
    locally-known. Since the prune markers are relevant to the pruned node.
    However, while prune markers are considered relevant to the parent of the
    pruned changesets, prune markers for locally-known changeset (with no
    successors) are considered exclusive to the pruned nodes. This allows
    to strip the prune markers (with the rest of the exclusive chain) alongside
    the pruned changesets.
    cs g|]}t��|d��s|�qS)r)rRr@�rP�n�Zsuccessormarkersrr�
<listcomp>r6z$exclusivemarkers.<locals>.<listcomp>rrr)�
unfiltered�	changelog�index�has_noder/r=rMZchildrenr>�sortr?�listr@rBrArR�issubset)rr1ZunfirZZprecursorsmarkersZchildrenmarkersZexclmarkersrCZ	seennodesrEr;rJrF�knownZprecmarkersrrUrr0�sF6




r0cs�|��}t|�d|��}|jr�|jjj�d}t|�|kr�t|�}dd�|D�}dd�|D�}|�t|j|���fdd�|D�}t|�d|��}q,d	d�|D�S)
aRreturn all nodes in the "foreground" of other node

    The foreground of a revision is anything reachable using parent -> children
    or precursor -> successor relation. It is very similar to "descendant" but
    augmented with obsolescence information.

    Beware that possible obsolescence cycle may result if complex situation.
    s%ln::r3cSsh|]}|���qSr��node�rP�crrrrQYr6zforeground.<locals>.<setcomp>cSsg|]}|��r|���qSr)�mutabler`rarrrrVZr6zforeground.<locals>.<listcomp>c3s|]}�|�r|VqdSrrrS�rZrr�	<genexpr>\r6zforeground.<locals>.<genexpr>cSsh|]}|���qSrr_rarrrrQ^r6)	rWr>r/rXrYrZ�len�updaterN)rr1�
foreground�plen�succsrcr^rrdrrhFs	
rhsef1�r(�� �@s^branch$s^.*-source$s^.*_source$s^source$cs |d�t�fdd�tD��S)zvCheck that the key of a meta item (extrakey, extravalue) does not
    match at least one of the blacklist pattern
    rc3s|]}|���VqdSr)�match)rP�pattern�Zmetakeyrrre�r6z%metanotblacklisted.<locals>.<genexpr>)�any�
METABLACKLIST)Zmetaitemrrqr�metanotblacklisted�srtcCsBg}|��D]0}|�d�s$|�d�s|�d�r2d}|�|�q|S)z/Drop all information but the username and patchs# User�#s@@s@@
)�
splitlines�
startswithrB)ZhunkZ	cleanhunk�linerrr�
_prepare_hunk�s
rycCst|d�}|dur|St|�S)zreturn a cleaned up linesN)�nextry)Ziterdiff�linesrrr�
_getdifflines�s
r|c	Cs�t�|��jddi�}|j��|��}|j|d�}|j��|��}|j|d�}d\}}d||fvr�t|�}t|�}||krZdSqZdS)z|return True if both ctx introduce the "same diff"

    This is a first and basic implementation, with many shortcoming.
    sgitT)Zopts)rrNF)	rZdiffalloptsr�uirrW�rev�diffr|)	ZleftctxZrightctxZdiffoptsZleftunfiZleftdiffZ	rightunfiZ	rightdiff�left�rightrrr�_cmpdiff�sr�cCs�d}|D]�}|��|��kr$|tO}|��|��kr<|tO}|��|��krT|tO}|��|��krl|tO}|��|��kr�|t	O}|�
���}tt
t|��}|�
���}tt
t|��}||kr�|tO}t||�s|tO}q|S)zeFrom an obs-marker relation, compute what changed between the
    predecessor and the successor.
    r)�description�DESCCHANGED�user�USERCHANGEDr)�DATECHANGED�branch�
BRANCHCHANGED�parents�
PARENTCHANGEDZextra�itemsr\�filterrt�METACHANGEDr��DIFFCHANGED)�sourcerMZeffectsZ	changectxZchangeextraZctxmetaZsourceextraZsrcmetarrr�
geteffectflag�s*

r�cCs�|du|dukrd}t�|��|��jjj}|jj}|jj	j
}tj}|durR|j
}|d}|d}	t�}
t�}|D]h}|d}
||
�}|dusr||
vsr||	kr�qr|
�|�|||�|kr�qrt||
�p�g��|�rr|�|�qr|S)z�return the set of pre-existing revisions obsoleted by a transaction

    Either the transaction or changes item of the transaction (for hooks)
    must be provided, but not both.
    Ns.exactly one of tr and changes must be provideds
obsmarkerssorigrepolenr)r	ZProgrammingErrorrWrXrYZget_revZ_phasecache�phaser/rMr@r
�public�changesr>rAr])r�trr��eZtorevr�Zsuccsmarkersr�ZaddedmarkersZorigrepolenZseenrevsZ	obsoletedrJr`r~rrr�getobsoleted�s0


r�cs>eZdZdZ�fdd�Zdd�Zejdd��Zdd	�Z	�Z
S)
�_succszAsmall class to represent a successors with some metadata about itcs"tt|�j|i|��t�|_dSr)�superr�rr>r;)r�args�kwargs��	__class__rrrsz_succs.__init__cCst|�}|j��|_|Sr)r�r;�copy)r�newrrrr�sz_succs.copycCst|�Sr)r>rrrr�_setsz_succs._setcCs|j�|j�Sr)r�r]rrrr�canmergesz_succs.canmerge)r+r,r-r.rr�rZ
propertycacher�r��
__classcell__rrr�rr�s
r�cCs|jj}|g}t|�}|dur"i}|�r|d}||vpJ|oJ||koJ||v}||vrd|�|���q"|r�||vr�t|f�g||<ng||<q"t||�D]J}	|	dD]6}
|
|vr�|
|vr�g||
<q�|�|
�|�|
�q�q�q�q"q�g}t||�D]�}	t�}|j	�|	�|g}
|	dD]p}
g}|
D]V}||
D]F}|�
�}|j	�|j	�|D]}||v�rN|�|��qN|�|��q0�q$|�r|}
�q|�|
�q�g}g}t
dd�|D�tdd�}|D]F}|D]&}|�|��r�|j	�|j	��q��q�|�|�|�|��q�|��|||<q"||S)a�	Return set of all latest successors of initial nodes

    The successors set of a changeset A are the group of revisions that succeed
    A. It succeeds A as a consistent whole, each revision being only a partial
    replacement. By default, the successors set contains non-obsolete
    changesets only, walking the obsolescence graph until reaching a leaf. If
    'closest' is set to True, closest successors-sets are return (the
    obsolescence walk stops on known changesets).

    This function returns the full list of successor sets which is why it
    returns a list of tuples and not just a single tuple. Each tuple is a valid
    successors set. Note that (A,) may be a valid successors set for changeset A
    (see below).

    In most cases, a changeset A will have a single element (e.g. the changeset
    A is replaced by A') in its successors set. Though, it is also common for a
    changeset A to have no elements in its successor set (e.g. the changeset
    has been pruned). Therefore, the returned list of successors sets will be
    [(A',)] or [], respectively.

    When a changeset A is split into A' and B', however, it will result in a
    successors set containing more than a single element, i.e. [(A',B')].
    Divergent changesets will result in multiple successors sets, i.e. [(A',),
    (A'')].

    If a changeset A is not obsolete, then it will conceptually have no
    successors set. To distinguish this from a pruned changeset, the successor
    set will contain itself only, i.e. [(A,)].

    Finally, final successors unknown locally are considered to be pruned
    (pruned: obsoleted without any successors). (Final: successors not affected
    by markers).

    The 'closest' mode respect the repoview filtering. For example, without
    filter it will stop at the first locally known changeset, with 'visible'
    filter it will stop on visible changesets).

    The optional `cache` parameter is a dictionary that may contains
    precomputed successors sets. It is meant to reuse the computation of a
    previous call to `successorssets` when multiple calls are made at the same
    time. The cache dictionary is updated in place. The caller is responsible
    for its life span. Code that makes multiple calls to `successorssets`
    *should* use this cache mechanism or risk a performance hit.

    Since results are different depending of the 'closest' most, the same cache
    cannot be reused for both mode.
    Nr3rcss|]}|r|VqdSrr)rP�srrrre�r6z!successorssets.<locals>.<genexpr>T)r7�reverse)r/rMr>�remover?r�r<rBrAr;r�rg�extendr9rfr�r�)rZinitialnode�closest�cacheZsuccmarkersZ	toproceedZ
stackedsetrEZcase2conditionrJrKZ	succssets�baseZmarkssZ
productresult�prefix�suffixZnewss�partrD�finalZ
candidatesZcandZ	seensuccsrrr�successorssetssv1�
!



�


r�c	Cs�|��sdSt||��dd�}|gkr.t�g}|jj}g}|D]f}|rR|�|�q>d}|�|��d�D],}|dsfd}t�}|j�	|�|�|�qf|s>|�t��q>g}|D]}|�||jd��q�|S)zncompute the raw data needed for computing obsfate
    Returns a list of dict, one dict per successors set
    NT)r�Frr)s
successorssmarkers)
�obsoleter�r`r�r/rMrBr@r;rA)	r�ctxZssetsZsuccsmapZfullsuccessorsetsZssetZfoundanyrJ�valuesrrr�successorsandmarkerss.r�cCs@t|�dkrdSt|�dkr dS|d}t|�dkr8dSdSdS)a}Compute a changeset obsolescence fate based on its successorssets.
    Successors can be the tipmost ones or the immediate ones. This function
    return values are not meant to be shown directly to users, it is meant to
    be used by internal functions only.
    Returns one fate from the following values:
    - pruned
    - diverged
    - superseded
    - superseded_split
    r�prunedr�diverged�
superseded�superseded_splitN�rf)r�rMrrr�_getobsfate5sr�cCs$|s
d}nt|�dkrd}nd}|S)zhReturn the verb summarizing the successorset and potentially using
    information from the markers
    r�rs	rewrittenssplitr�)Zsuccessorsetr;Zverbrrr�obsfateverbPsr�cCsdd�|D�S)z/returns the list of dates for a list of markerscSsg|]}|d�qS)r(rrOrrrrV_r6z markersdates.<locals>.<listcomp>rr:rrr�markersdates]sr�cCs$dd�|D�}dd�|D�}t|�S)z9Returns a sorted list of markers users without duplicatescSsg|]}t|d��qS�r%�r&rOrrrrVdr6z markersusers.<locals>.<listcomp>cSs$h|]}|�d�rt�|d��qS)suser)r@rZtolocal�rP�metarrrrQes
�zmarkersusers.<locals>.<setcomp>r8)r;�markersmeta�usersrrr�markersusersbs
�r�cCs$dd�|D�}dd�|D�}t|�S)z>Returns a sorted list of markers operations without duplicatescSsg|]}t|d��qSr�r�rOrrrrVpr6z%markersoperations.<locals>.<listcomp>cSs h|]}|�d�r|�d��qS)s	operation)r@r�rrrrQqsz$markersoperations.<locals>.<setcomp>r8)r;r��
operationsrrr�markersoperationsns
�r�csF|j}|j}|o|}g}|�t||��t|�}	|	rL|�dd�|	��|rx��fdd�|D�}
|�dd�|
��t|�}|s�|jdd�}t|�dkr�||vr�d	}|s�|r�|r�|�d
d�|��t	|�}
|
�r<|�r<t
|
�}t|
�}||k�rt�
|d�}|�d|�n*t�
|d�}t�
|d�}|�d
||f�d�|�S)zoBuild a obsfate string for a single successorset using all obsfate
    related function defined in obsutil
    s	 using %s�, csg|]}��|��qSrr)rPZsucc��	formatctxrrrrV�r6z"obsfateprinter.<locals>.<listcomp>s as %sT)ZacceptemptyrNs by %ss%Y-%m-%d %H:%M %1%2s (at %s)s (between %s and %s)r6)�quiet�verboserBr�r��joinr��usernamerfr��min�maxr
Zdatestr)r}rrMr;r�r�r�Znormalrxr�Z
fmtsuccessorsr�ZcurrentuserZdatesZmin_dateZmax_dateZfmtmin_dateZfmtmax_daterr�r�obsfateprinterxs:
r�shidden revision '%s' is pruneds!hidden revision '%s' has divergeds)hidden revision '%s' was rewritten as: %ss%hidden revision '%s' was split as: %ss1hidden revision '%s' was split as: %s and %d more)r�r�r�r��superseded_split_severalcCs�t||���}t|�}|dkr*td|S|dkr>td|S|dkrft|dd�}td||fS|dkr�g}|dD]}|�t|��qzt|�dkr�d�|�}td||fSd�|dd��}	t|�d}
||	|
f}td	|SdS)
zDreturn a human-friendly string on why a obsolete changeset is hiddenr�r�r�rr�rr�Nr�)r�r`r��filteredmsgtablerrBrfr�)rZchangeidr�rMZfateZsingle_successorrjZnode_idZfmtsuccsZfirstsuccessorsZremainingnumberr�rrr�_getfilteredreason�s(

r�cCs�i}i}t|j|��g�D]P}||��kr,qt|||�}|D],}|��|vrNq<t|�|vr\q<||t|�<q<qdd�t�|�D�S)z2Compute sets of commits divergent with a given onecSsg|]\}}||d��qS))�divergentnodes�commonpredecessorr)rPZdivset�brrrrV�s�z!divergentsets.<locals>.<listcomp>)rLr/r`r��tuplerZ	iteritems)rr�r�r�rTZ	nsuccsetsZnsuccsetrrr�
divergentsets�s�r�c	s�g}|��rZ|��D]D}d}|��r*d}n|��r6d}|dur|�dd||��d��q|��r�t�j|��gt	d�}�fdd�|D�}|D]}|�dd	|��d��q�|�
�r�t�|�}|D]6}	�fd
d�|	dD�}
|�d|
d
t|	d�d��q�|S)Nsorphansobsoletes	%s parent)�instability�reason�node)rHcs(g|] }|�vr�|��s�|�qSr)rc)rP�p�rrrrVszwhyunstable.<locals>.<listcomp>sphase-divergentsimmutable predecessorcsg|]}�|�qSrrrSr�rrrVr6r�scontent-divergentspredecessorr�)r�r�r�r�)Zorphanr�r�rBrZphasedivergentrLr/r`�	bumpedfixZcontentdivergentr�)rr��result�parent�kindr=Z	immutableZpredecessorZdsetsZdsetZdivnodesrr�r�whyunstable�sR���
���

��r�)NF)r)r)NN)FN);Z
__future__r�reZi18nrr`rr�rrr	r
rrZutilsr
r�Zusingsha256�objectrr2r<rGrLrNrRr0rhZEFFECTFLAGFIELDr�r�r�r�r�r�r��compilersrtryr|r�r�r�r\r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr�<module>sp  *


z*�	
,
 
i0

6��

Youez - 2016 - github.com/yon3zu
LinuXploit