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: //proc/self/root/usr/lib64/python2.7/site-packages/mercurial/tagmerge.pyo
�
1�3\c@@s�ddlmZddlmZddlmZmZddlmZ	m
Z
ee�Zded�Z
d�Zd	�Zd
�Zd�ZdS(
i(tabsolute_importi(t_(thextnullid(ttagstutiltc	
C@sptj|||d|dddt�d}x>|j�D]0\}}|s8x|D]}d|d<qQWq8q8W|S(sread the .hgtags file into a structure that is suitable for merging

    Depending on the keeplinenums flag, clear the line numbers associated
    with each tag. This is done because only the line numbers of the first
    parent are useful for merging.
    tfntrecodet
calcnodelinesiN(ttagsmodt_readtaghisttNonetTruetitems(	tuitrepotlinesRtkeeplinenumstfiletagsttagnamettaginfotel((s8/usr/lib64/python2.7/site-packages/mercurial/tagmerge.pytreadtagsformergeXs

cC@s�d}x*|D]"\}}|}|dk	r
Pq
q
W|dkrcdg|D]}|d^qIggS||dd<|ggg}|}xp|D]h\}}|dk	r�||dkr�|j|gg�n|ddj|�|dk	r�|}q�q�W|S(s�
    Group nearby nodes (i.e. those that must be written next to each other)

    The input is a list of [node, position] pairs, corresponding to a given tag
    The position is the line number where the node was found on the first parent
    .hgtags file, or None for those nodes that came from the base or the second
    parent .hgtags files.

    This function groups those [node, position] pairs, returning a list of
    groups of nodes that must be written next to each other because their
    positions are consecutive or have no position preference (because their
    position is None).

    The result is a list of [position, [consecutive node list]]
    iii����N(Rtappend(ttagnodestfirstlinenumthexnodetlinenumRtgroupednodestprevlinenum((s8/usr/lib64/python2.7/site-packages/mercurial/tagmerge.pytgrouptagnodesbylinegs"$
c
C@s�x0t|j��D]\}}t|�||<qWd�}g}xL|j�D]>\}}x%|D]}||d|�|d<qbW||7}qOW|jdd��djg|D]\}}|r�|^q��}	|j|	d|j��dS(sl
    write the merged tags while trying to minimize the diff to the first parent

    This function uses the ordering info stored on the merged tags dict to
    generate an .hgtags file which is correct (in the sense that its contents
    correspond to the result of the tag merge) while also being as close as
    possible to the first parent's .hgtags file.
    cS@s*djg|D]}d||f^q
�S(Ns
s%s %s(tjoin(ttlistttnameR((s8/usr/lib64/python2.7/site-packages/mercurial/tagmerge.pyttaglist2string�sitkeycS@s|ddkrdS|dS(Nii����(R(tx((s8/usr/lib64/python2.7/site-packages/mercurial/tagmerge.pyt<lambda>�Rs
N(tlistRRtsortR twritetflags(
tfcdt
mergedtagsR"ttaglistR#t	finaltagsRtblocktranktmergedtagstring((s8/usr/lib64/python2.7/site-packages/mercurial/tagmerge.pytwritemergedtags�s
	
.cC@s�|s
|S|s|S|dd}|dd}||krXt|�t|�krXdSt|�t|�kr�||}}n
||}}t|�}xVtt|��D]B}||d||dkr�|}Pn||d||d<q�W|||S(s�
    merge the nodes corresponding to a single tag

    Note that the inputs are lists of node-linenum pairs (i.e. not just lists
    of nodes)
    i����iiN(tlenRtrange(tp1nodestp2nodest
p1currentnodet
p2currentnodethrnodestlrnodest	commonidxtn((s8/usr/lib64/python2.7/site-packages/mercurial/tagmerge.pytsingletagmerge�s$$
cC@s|j}t|||j�j�dddt�}t|||j�j�dddt�}t|||j�j�dddt�}t|�}x�t||f�D]s\}	}
t|
�}||}xN|D]F}
||
|
|
<|
|
ddtkr�|
|
j	tdg�q�q�Wq�Wg}tj|�}xx|j
�D]j\}}||krg|||<q?n||}t||�}|dkr�|j	|�q?n|||<q?W|r�t|�}|jtd�|d	jt|��f�td
fSt||�|jtd��tdfS(
s�
    Merge the tags of two revisions, taking into account the base tags
    Try to minimize the diff between the merged tags and the first parent tags
    Rsp1 tagsRsp2 tagss	base tagsi����isIautomatic .hgtags merge failed
the following %d tags are in conflict: %s
s, is.hgtags merged successfully
N(RRtdatat
splitlinesR
tFalsetsett	enumeratet	hexnullidRRRtsortdictRR=R3twarnRR tsortedR2tnote(RR+tfcotfcaRtp1tagstp2tagstbasetagst
basetagsetR<tpntagstpntagsettpnlosttagsettttconflictedtagsR,R"R6R5tmergednodestnumconflicts((s8/usr/lib64/python2.7/site-packages/mercurial/tagmerge.pytmerge�sL				

"




N(t
__future__Rti18nRtnodeRRRRR
RRCR@RRR2R=RU(((s8/usr/lib64/python2.7/site-packages/mercurial/tagmerge.pyt<module>Js	"	#	-