HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //lib64/python2.7/site-packages/mercurial/obsutil.pyc
�
1�3\c@@s7ddlmZddlZddlmZddlmZmZmZ	m
Z
mZddlm
Z
dZdZdefd	��YZded
�Zd�Zdd�Zdd
�Zd�Zd�Zd�ZdZd7Zd8Zd9Zd:Zd;Z d<Z!d=Z"ej#d�ej#d�ej#d�ej#d�gZ$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d e+fd!��YZ,edd"�Z-d#�Z.d$�Z/d%�Z0d&�Z1d'�Z2d(�Z3d)�Z4ied*�d+6ed,�d-6ed.�d/6ed0�d16ed2�d36Z5d4�Z6d5�Z7d6�Z8dS(>i(tabsolute_importNi(t_(tdiffutiltencodingtnodetphasestutil(tdateutilitmarkercB@s_eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
sWrap obsolete marker raw datacC@s||_||_d|_dS(N(t_repot_datatNonet_decodedmeta(tselftrepotdata((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt__init__<s		cC@s
t|j�S(N(thashR
(R
((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt__hash__BscC@s,t|�t|�krtS|j|jkS(N(ttypetFalseR
(R
tother((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt__eq__EscC@s|jdS(s%Predecessor changeset node identifieri(R
(R
((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytprednodeJscC@s|jdS(s-List of successor changesets node identifiersi(R
(R
((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt	succnodesNscC@s|jdS(s2Parents of the predecessors (None if not recorded)i(R
(R
((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytparentnodesRscC@st|jd�S(sDecoded metadata dictionaryi(tdictR
(R
((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytmetadataVscC@s|jdS(s#Creation date as (unixtime, offset)i(R
(R
((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytdateZscC@s|jdS(sThe flags field of the markeri(R
(R
((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytflags^s(t__name__t
__module__t__doc__RRRRRRRRR(((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyR9s								cc@se|dkr|j}n*|r0t||�}n|jj|�}x|D]}t||�VqIWdS(sreturns markers known in a repository

    If <nodes> is specified, only markers "relevant" to those nodes are are
    returnedN(RtobsstoretexclusivemarkerstrelevantmarkersR(Rtnodest	exclusivet
rawmarkerst
markerdata((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt
getmarkersbs
c	c@s�|jj}|g}t|�}x�|r�|j�}|j|d�}xX|D]P}|d}||krqqOn|j|�||kr�|VqO|j|�qOWq$WdS(s�yield the list of next predecessors pointing on visible changectx nodes

    This function respect the repoview filtering, filtered revision will be
    considered missing.
    iN((R!tpredecessorstsettpoptgettaddtappend(	Rtnodeidt
precursorststacktseentcurrentt
currentpreccstprect
precnodeid((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytclosestpredecessorsqs		


cc@s�t|�}t|�}x�|r�|j�}|Vxd|jj|d�D]M}|d|@rbqHn|d}||krH|j|�|j|�qHqHWqWdS(s�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.iiN((R*R+R)R,R-(R!R$tignoreflagst	remainingR2R3tmarktsuc((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytallpredecessors�s	

cc@s�t|�}t|�}x�|r�|j�}|Vxo|jj|d�D]X}|d|@rbqHnx;|dD]/}||krm|j|�|j|�qmqmWqHWqWdS(s�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.iiN((R*R+t
successorsR,R-(R!R$R8R9R2R3R:R;((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt
allsuccessors�s	
cC@std�|D��S(s"return a set with no prune markerscs@s|]}|dr|VqdS(iN((t.0tm((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys	<genexpr>�s(R*(tmarkers((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt
_filterprunes�scC@s	|j�}|jj}|jj}|jj}|jj}t�}t|�}g|D]$}t|j	|d��sX|^qX}	|	j
�t|	�}
xj|	r|	j�}t|j	|d��}x4|j	|d�D] }
|
ds�|j
|
�q�q�Wx4|j	|d�D] }
|
ds|j
|
�qqWx�|D]�}
|
|krRq:n|
dsl|
d|kr||j|
�n|
d}||
kr�q:n||k}|r�||kr�q:nt|j	|��}|j|�r:|
j|�|	j
|�q:q:Wq�W|S(sset 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 unkown 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.
    ii(((((t
unfilteredt	changelogtnodemapR!R)R=tchildrenR*RBR,tsortR+tlistR.R-tissubset(RR$tunfitnmtprecursorsmarkerstsuccessormarkerstchildrenmarkerstexclmarkerstnR1t	seennodesR3RAR:R5tknowntprecmarkers((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyR"�sF6	1
	




c@s|j�}t|jd|��}|jr�|jj�d}x�t|�|kr�t|�}td�|D��}g|D]}|j�r}|j�^q}}|jt	|j|���fd�|D�}t|jd|��}qBWntd�|D��S(sRreturn 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::i����cs@s|]}|j�VqdS(N(R(R?tc((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys	<genexpr>Hsc3@s!|]}|�kr|VqdS(N((R?RP(RK(s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys	<genexpr>Kscs@s|]}|j�VqdS(N(R(R?RT((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys	<genexpr>Ms(
RCR*R!RDREtlentmutableRtupdateR>(RR$t
foregroundtplentsuccsRTRVRR((RKs7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyRX5s		+tef1iiiis^branch$s^.*-source$s^.*_source$s^source$c@s%|d�t�fd�tD��S(sw Check that the key of a meta item (extrakey, extravalue) does not
    match at least one of the blacklist pattern
    ic3@s|]}|j��VqdS(N(tmatch(R?tpattern(tmetakey(s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys	<genexpr>us(tanyt
METABLACKLIST(tmetaitem((R^s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytmetanotblacklistedos
cC@shg}x[|j�D]M}|jd�s8|jd�r|jd�rPd}n|j|�qqW|S(s/Drop all information but the username and patchs# Usert#s@@s@@
(t
splitlinest
startswithR.(thunkt	cleanhunktline((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt
_prepare_hunkws	cC@s)t|d�}|dkr|St|�S(sreturn a cleaned up linesN(tnextRRi(titerdifftlines((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt
_getdifflines�sc	C@s�tj|j�jitd6�}|jj�|j�}|jd|�}|jj�|j�}|jd|�}d\}}x>d||fkr�t
|�}t
|�}||kr�tSq�WtS(s|return True if both ctx introduce the "same diff"

    This is a first and basic implementation, with many shortcoming.
    tgittoptsi(iiN(RtdiffalloptsRtuitTrueR	RCtrevtdiffRRmR(	tleftctxtrightctxtdiffoptstleftunfitleftdifft	rightunfit	rightdifftlefttright((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt_cmpdiff�s"cC@sWd}xJ|D]B}|j�|j�kr8|tO}n|j�|j�kr]|tO}n|j�|j�kr�|tO}n|j�|j�kr�|tO}n|j�|j�kr�|t	O}n|j
�j�}tt
t|��}|j
�j�}tt
t|��}||kr3|tO}nt||�s
|tO}q
q
W|S(sf From an obs-marker relation, compute what changed between the
    predecessor and the successor.
    i(tdescriptiontDESCCHANGEDtusertUSERCHANGEDRtDATECHANGEDtbrancht
BRANCHCHANGEDtparentst
PARENTCHANGEDtextratitemsRHtfilterRbtMETACHANGEDR~tDIFFCHANGED(tsourceR=teffectst	changectxtchangeextratctxmetatsourceextratsrcmeta((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt
geteffectflag�s*






c
C@s|j�jjj}|jj}|jjj}tj	}|j
d}|j
d}t�}t�}	x�|D]�}
|
d}||�}|dksl||ksl||kr�qln|j
|�|||�|kr�qlnt||�p�g�j|�rl|	j
|�qlqlW|	S(sCreturn the set of pre-existing revisions obsoleted by a transactiont
obsmarkerstorigrepoleniN(RCRDRER,t_phasecachetphaseR!R=RtpublictchangesR*RR-RI(
RttrttorevR�tsuccsmarkersR�taddedmarkersR�tseenrevst	obsoletedR:RRs((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytgetobsoleted�s&	

		

$
!t_succscB@s;eZdZd�Zd�Zejd��Zd�ZRS(sAsmall class to represent a successors with some metadata about itcO@s)tt|�j||�t�|_dS(N(tsuperR�RR*RA(R
targstkwargs((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyR�scC@s"t|�}|jj�|_|S(N(R�RAtcopy(R
tnew((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyR��scC@s
t|�S(N(R*(R
((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt_set�scC@s|jj|j�S(N(R�RI(R
R((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytcanmerge�s(	RRR RR�Rt
propertycacheR�R�(((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyR��s
		cC@s�|jj}|g}t|�}|dkr6i}nx�|r�|d}||kpp|op||kop||k}||kr�|j|j��q9|r�||kr�t|f�g||<q�g||<q9xt||�D]b}	xX|	dD]I}
|
|kr�|
|krg||
<q8|j|
�|j	|
�Pq�q�Wq�Pq�Wg}x�t||�D]�}	t�}|j
j	|	�|g}
x�|	dD]�}
g}x||
D]t}xk||
D]_}|j�}|j
j|j
�x*|D]"}||kr�|j|�q�q�W|j|�q�Wq�W|}
q�W|j
|
�q[Wg}g}td�|D�dtdt�}x_|D]W}xN|D],}|j|�rv|j
j|j
�PqvqvW|j|�|j|�qiW|j�|||<q9W||S(s�	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.
    i����ics@s|]}|r|VqdS(N((R?ts((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys	<genexpr>�stkeytreverseN(R!R=R*RtremoveR+R�tsortedR.R-RAR�RWtextendRURrR�R�(Rtinitialnodetclosesttcachetsuccmarkerst	toproceedt
stackedsetR3tcase2conditionR:R;t	succssetstbasetmarksst
productresulttprefixtsuffixtnewsstpartR2tfinalt
candidatestcandt	seensuccs((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytsuccessorssets�sr1			

!


		






c	C@s0|j�sdSt||j�dt�}|gkrCgg}n|jj}g}x�|D]�}|rx|j|�q\t}xY|j	|j�d�D]?}|ds�t}t
�}|jj|�|j|�q�q�W|s\|jt
��q\q\Wg}x,|D]$}|ji|d6|jd6�qW|S(sncompute the raw data needed for computing obsfate
    Returns a list of dict, one dict per successors set
    R�iR=RAN((
tobsoleteRR�RRrR!R=R.RR,R�RAR-(	RtctxtssetstsuccsmaptfullsuccessorsetstssettfoundanyR:tvalues((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytsuccessorsandmarkers�s.

	
"cC@sTt|�dkrdSt|�dkr,dS|d}t|�dkrLdSdSdS(s~ 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
    itpruneditdivergedt
supersededtsuperseded_splitN(RU(R�R=((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt_getobsfate	s
cC@s4|sd}n!t|�dkr*d}nd}|S(si Return the verb summarizing the successorset and potentially using
    information from the markers
    R�it	rewrittentsplit(RU(tsuccessorsetRAtverb((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytobsfateverb#s		cC@sg|D]}|d^qS(s4returns the list of dates for a list of markers
    i((RAR@((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytmarkersdates/scC@sCg|D]}t|d�^q}td�|D��}t|�S(s? Returns a sorted list of markers users without duplicates
    ics@s1|]'}|jd�rtj|d�VqdS(R�N(R,Rttolocal(R?tmeta((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys	<genexpr>8s(RR*R�(RAR@tmarkersmetatusers((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytmarkersusers4s#cC@sCg|D]}t|d�^q}td�|D��}t|�S(sD Returns a sorted list of markers operations without duplicates
    ics@s-|]#}|jd�r|jd�VqdS(t	operationN(R,(R?R�((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pys	<genexpr>As(RR*R�(RAR@R�t
operations((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytmarkersoperations=s#cC@s�|j}|j}|o|}g}|jt||��t|�}	|	rk|jddj|	��n|r�g|D]}
|||
�^qx}|jddj|��nt|�}|s�|jdt�}
t	|�dkr�|
|kr�d}q�n|s|r.|r.|jddj|��nt|�}|r�|r�t|�}t
|�}||kr�tj|d�}|jd|�q�tj|d�}tj|d�}|jd	||f�nd
j|�S(sp Build a obsfate string for a single successorset using all obsfate
    related function defined in obsutil
    s	 using %ss, s as %stacceptemptyis by %ss%Y-%m-%d %H:%M %1%2s (at %s)s (between %s and %s)tN(tquiettverboseR.R�R�tjoinR�tusernameRrRURR�tmintmaxRtdatestr(RqRR=RAt	formatctxR�R�tnormalRhR�tsucct
fmtsuccessorsR�tcurrentusertdatestmin_datetmax_datetfmtmin_datetfmtmax_date((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytobsfateprinterFs:		#shidden revision '%s' is prunedR�s!hidden revision '%s' has divergedR�s)hidden revision '%s' was rewritten as: %sR�s%hidden revision '%s' was split as: %sR�s1hidden revision '%s' was split as: %s and %d moretsuperseded_split_severalcC@s;t||j��}t|�}|dkr9td|S|dkrQtd|S|dkr�tj|dd�}td||fS|dkr7g}x(|dD]}|jtj|��q�Wt|�dkr�dj|�}td||fSdj|d �}	t|�d}
||	|
f}td|Snd	S(
sIreturn a human-friendly string on why a obsolete changeset is hidden
    R�R�R�iR�is, R�N(	R�RR�tfilteredmsgtabletnodemodtshortR.RUR�(RtchangeidR�R=tfatetsingle_successorRZtnode_idtfmtsuccstfirstsuccessorstremainingnumberR�((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt_getfilteredreason�s(c	C@s�i}i}x�t|j|j�g�D]�}||j�krFq(nt|||�}xN|D]F}|j�|kr}q_nt|�|kr�q_n||t|�<q_Wq(Wg|j�D] \}}i|d6|d6^q�S(s2Compute sets of commits divergent with a given onetdivergentnodestcommonpredecessor(R<R!RR�ttuplet	iteritems(	RR�R�R�RPt	nsuccsetstnsuccsettdivsettb((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt
divergentsets�s"
c
C@s�g}|j�r�x�|j�D]q}d}|j�r@d}n|j�rUd}n|dk	r|jidd6d|d6|j�d6�qqWn|j�r:t|j|j	�gdt
�}g|D]-}||kr�||j�r�||^q�}x9|D].}|jidd6d	d6|j�d6�qWn|j�r�t
||�}	xh|	D]]}
g|
d
D]}||^qm}|jidd6|d
6dd6tj|
d
�d6�q\Wn|S(NtorphanR�tinstabilitys	%s parenttreasonRR8sphase-divergentsimmutable predecessorRscontent-divergenttpredecessorR(R
R�RR�R.thextphasedivergentR<R!Rt	bumpedfixRVtcontentdivergentR	R�(
RR�tresulttparenttkindR)tpt	immutableR
tdsetstdsetRPtdivnodes((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pytwhyunstable�s<			
-

!iiiiii i@(9t
__future__Rtreti18nRR�RRRR�RRtutilsRRtusingsha256tobjectRRRR(R7R<R>RBR"RXtEFFECTFLAGFIELDR�R�R�R�R�R�R�tcompileR`RbRiRmR~R�R�RHR�R�R�R�R�R�R�R�R�R�RR	R(((s7/usr/lib64/python2.7/site-packages/mercurial/obsutil.pyt<module>sd(")			y	)		
				+	�	/								5