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: //usr/lib64/python2.7/site-packages/mercurial/copies.pyo
�
1�3\c@@s@ddlmZddlZddlZddlZddlmZddlmZ	m
Z
mZmZm
Z
ddlmZd�Zd�Zd	d
�Zdd�Zdd�Zd
�Zdd�Zd�Zdd�Zdd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"dd�Z#dS(i(tabsolute_importNi(t_(tmatchtnodetpathutiltscmutiltutil(t
stringutilc
C@s�|j}t|�}|dkr*|}n|dkr?|}nid|6d|6}||g}tj|�t|�}t}|}	x#|r�tj|�}
|
|kr�g|jj�D]}|j	|�^q�}n|j
|
�}x�|D]�}|dkrq�n||krL||
||<||r8|d7}ntj||�q�||r�||||
kr�d||<|d8}t}q�q�W||
r�|
}	|d8}q�q�W|s�dSt
|	||�S(s�
    Find the last revision that needs to be checked to ensure that a full
    transitive closure for file copies can be properly calculated.
    Generally, this means finding the earliest revision number that's an
    ancestor of a or b but not both, except when a or b is a direct descendent
    of the other, in which case we can return the minimum revnum of a and b.
    None if no such revision exists.
    i����iiN(t	changelogtlentNonetheapqtheapifytFalsetheappoptdirstatetparentstrevt
parentrevstheappushtTruetmin(
trepotatbtcltworkingtsidetvisittinterestingthascommonancestortlimittrtpR((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt
_findlimitsF			
	.






cC@s�|j�}xy|j�D]k\}}||krk|||krR||||<n||krk||=qkn||kr|||<qqWxBt|j��D].\}}||kr�||kr�||=q�q�W|S(schain two sets of copies a->b(tcopyt	iteritemstlisttitems(tsrctdstRRtttktv((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_chainps
i����cC@swxp|j�D]b}|j|j�d�|j�kr;|S|dkr
|j�|kr
|j�|kr
dSq
WdS(s�return file context that is the ancestor of fctx present in ancestor
    manifest am, stopping after the first ancestor lower than limitiN(t	ancestorstgettpathR
tfilenodetlinkrevR(tfctxtamRtf((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt
_tracefile�s
$0cC@sf|jj}|j�j�}xAt|�D]3}||dksT|r+||�r+||=q+q+W|S(Ntanm(t_repoRtcopiesR#R%(tdRtdstcR*((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_dirstatecopies�s#cC@s+|j�}|j�}|j|d|�S(s�Computes which files are in b but not a.
    This is its own function so extensions can easily wrap this call to see what
    files _forwardcopies is about to process.
    R(tmanifestt
filesnotin(RRRtmatmb((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_computeforwardmissing�scC@s"|j}|jjo'|jjdd�}|jj}|rS|d||f�nt||j�|j��}|dkr�d}n|r�|d|�n|j�}i}|}	|j	�|kr|j
�j�tjkrt
j|j|j��}
tj||
�}	nt||d|	�}|jjj|j�gdt�}|rh|dt|��nx�|D]�}
|r�|d	|
�n||
}||_|r�tj�}nt|||�}|r�|r�|d
|j�n|j�||
<n|ro|dtj�|�qoqoW|S(
s@Like _forwardcopies(), but b.rev() cannot be None (working copy)tdevelsdebug.copiess3debug.copies:    looking into rename from %s to %s
i����s$debug.copies:      search limit: %d
Rt	inclusives.debug.copies:      missing file to search: %d
s&debug.copies:        tracing file: %s
s%debug.copies:          rename of: %s
s(debug.copies:          time: %f seconds
N(R7tuit	debugflagt
configbooltdebugR"RR
R=tp1tp2RtnullidRt
matchfilestfilestmatchmodtintersectmatchersRARR-RR	t_ancestrycontextRttimerR5t_pathR/(RRRRRGtdbgRR3tcmtforwardmissingmatchtfilesmatchertmissingtancestrycontextR4R2tstarttofctx((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_committedforwardcopies�sJ	!	-$

	cC@s�|j�j|�}|j�dkrz||j�krFt||�St||j�|�}t|||t||��St|||�S(s<find {dst@b: src@a} copy mapping where a is an ancestor of bN(RtnarrowmatchRR
RHR<RZR,(RRRRS((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_forwardcopies�s
cC@sz|jjjdd�dkr"iSt||�}i}x<t|j��D](\}}||krhqJn|||<qJW|S(Ntexperimentalt	copytracetoff(R7RDtconfigR\tsortedR$(RRR4R R*R+((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_backwardrenames�sc	C@s(|j}|jjo'|jjdd�}|rM|jjd||f�n||ksg|sg|rkiS|j|�}||kr�|r�|jjd�nt||d|�S||kr�|r�|jjd�nt||�S|r�|jjd�nt||t||�t||d|��S(s5find {dst@y: src@x} copy mapping for directed compareRBsdebug.copiess-debug.copies: searching copies from %s to %s
s#debug.copies: search mode: forward
Rs$debug.copies: search mode: backward
s$debug.copies: search mode: combined
(	R7RDRERFRGtancestorR\RbR,(txtyRRRGR((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt
pathcopies�s(	!
tc	C@s�t||�}t||�}d}|r=|d|7}n|rm|jjd|ddj|�f�n|r�|jjd|ddj|�f�n||fS(s�Computes, based on addedinm1 and addedinm2, the files exclusive to c1
    and c2. This is its own function so extensions can easily wrap this call
    to see what files mergecopies is about to process.

    Even though c1 and c2 are not used in this function, they are useful in
    other extensions for being able to read the file nodes of the changed files.

    "baselabel" can be passed to help distinguish the multiple computations
    done in the graft case.
    s  unmatched files in %ss
 (from %s)s
%s:
   %s
tlocals
   tother(RaRDRGtjoin(	Rtc1tc2t	addedinm1t	addedinm2t	baselabeltu1tu2theader((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_computenonoverlaps**c@s��j���j�t�dd���dkr��g}�dkrpg�j�D]}|j�^qU}n�jj|dt����_n����fd�}t	j
|�S(s�return a 'getfctx' function suitable for _checkcopies usage

    We have to re-setup the function building 'filectx' for each
    '_checkcopies' to ensure the linkrev adjustment is properly setup for
    each. Linkrev adjustment is important to avoid bug in rename
    detection. Moreover, having a proper '_ancestrycontext' setup ensures
    the performance impact of this adjustment is kept limited. Without it,
    each file could do a full dag traversal making the time complexity of
    the operation explode (see issue4537).

    This function exists here mostly to limit the impact on stable. Feel
    free to refactor on default.
    RORCc@se|tjkr:�j�dkr.�j|�S�d|S�j|d|�}�|_�|_|S(Ntfileid(RtwdirfilenodeidsRR
tfilectxROt_descendantrev(R4tnR2(tactctxRR(s6/usr/lib64/python2.7/site-packages/mercurial/copies.pytmakectx@s
		N(RR7tgetattrR
RRR-RRORtlrucachefunc(RztrevsR!R{((RyRzRRs6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_makegetfctx)s		(
cC@s�i}x6|D].}||kr
|||||<||=q
q
WxQ|D]I}||}|d|kr�||d|dg||<qF|||<qFW|S(scombine partial copy pathsii((tcopyfromtcopytot	finalcopytdivergetincompletediverget	remainderR4tic((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_combinecopiesLs


cC@s|s|s||kr-iiiiifS|j�dkrv|j�|jj�krv|jj�iiiifS|jjdd�}tj|�}|dkr�t	|||�r�t
||||�St||||�S|tkr�iiiiifSt
||||�SdS(s�
    The function calling different copytracing algorithms on the basis of config
    which find moves and copies between context c1 and c2 that are relevant for
    merging. 'base' will be used as the merge base.

    Copytracing is used in commands like rebase, merge, unshelve, etc to merge
    files that were moved/ copied in one merge parent and modified in another.
    For example:

    o          ---> 4 another commit
    |
    |   o      ---> 3 commit that modifies a.txt
    |  /
    o /        ---> 2 commit that moves a.txt to b.txt
    |/
    o          ---> 1 merge base

    If we try to rebase revision 3 on revision 4, since there is no a.txt in
    revision 4, and if user have copytrace disabled, we prints the following
    message:

    ```other changed <file> which local deleted```

    Returns five dicts: "copy", "movewithdir", "diverge", "renamedelete" and
    "dirmove".

    "copy" is a mapping from destination name -> source name,
    where source is in c1 and destination is in c2 or vice-versa.

    "movewithdir" is a mapping from source name -> destination name,
    where the file at source present in one context but not the other
    needs to be moved to destination by the merge process, because the
    other context moved the directory it is in.

    "diverge" is a mapping of source name -> list of destination names
    for divergent renames.

    "renamedelete" is a mapping of source name -> list of destination
    names for files deleted in c1 that were renamed in c2 or vice-versa.

    "dirmove" is a mapping of detected source dir -> destination dir renames.
    This is needed for handling changes to new files previously grafted into
    renamed directories.
    R]R^t
heuristicsN(
RR
RRHR8RDR`Rt	parseboolt_isfullcopytraceablet_fullcopytracingt_heuristicscopytracingR
(RRkRltbasetcopytracingt
boolctrace((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pytmergecopies\s.-cC@s�|j�dkr!|j�}n|j�r|j�r|jjdd�}t|jd|j�|j���}||kStS(s� Checks that if base, source and destination are all no-public branches,
    if yes let's use the full copytrace algorithm for increased capabilities
    since it will be fast enough.

    `experimental.copytrace.sourcecommitlimit` can be used to set a limit for
    number of changesets from c1 to base such that if number of changesets are
    more than the limit, full copytracing algorithm won't be used.
    R]scopytrace.sourcecommitlimits%d::%dN(	RR
RHtmutableRDt	configintR	R~R
(RRkR�tsourcecommitlimittcommits((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyR��s		'
c5
C@s�|j�dkr|j�n|}|j�dkrB|j�n|}|j|�}|j|�}|pq|}|}	|r�|j|�}	nt||j�|j��}
|
dkr�iiiiifS|jjd|
�|j�}|j�}|j�}
i}i}iid6id6id6|d6|d6}iid6id6id6|d6|d6}|j	|
|j
��}|j	|
|j
��}t||@�}|	|kr�t|||||�\}}||}}nxt|||||dd�\}}|	j�}t||||j	||j
��|j	||j
��dd	�\}}x-|D]%}t
|||||	||
|�q^Wx-|D]%}t
|||||	||
|�q�Wt|d�}|j|d�t|d�}|j|d�|r t|d|d|||�nt|d|d|||�i}t�}t�}x�t|j��D]�\} }!t|!�d
ks�| |ks�| |kr|| =| |kr| |krg|!D]$}||ks�||kr�|^q�|| <|j|!�qqi|j|!�qiW|r=|jjddj|��ni}"i}#i}$iid6id6id6|"d6|#d6}%iid6id6id6|"d6|#d6}&xL|D]D}t
|||||	||
|%�t
|||||	||
|&�q�W|rti|%d||"|#�}$n%|r:ti|&d||"|#�}$nxA|$D]9}|$|}'|'d
|rd|n|krA|'|"|<qAqAWxQ|"j�D]C\} }!t|!�dkr�|!d
|!d
kr�| ||!d
<q�q�W|r�|jjr�|jjd�x�t|�D]x}d}(||kr&|(d7}(n||kr?|(d7}(n||krX|(d7}(n|jjd||||(f�qWn~|s�|i||ifS|jjd�|j�|j�})}*|)jd�|*jd�t�}+i},x�|j�D]�\}-}.tj|.�tj|-�}/}0|/|+kr8q�q�|/|)kr`|0|)kr`|+j|/�q�|/|*kr�|0|*kr�|+j|/�q�|/|,kr�|,|/|0kr�|+j|/�q�|0|,|/<q�Wx$|+D]}1|1|,kr�|,|1=q�q�W~)~*~+|,s|i||ifSd�|,j�D�},x,|,D]$}2|jjd|2|,|2f�q(Wi}3x�||D]�}||kraxo|,D]d}2|j|2�rz|,|2|t|2�}4|4|kr�|4|3|<|jjd||4f�nPqzqzWqaqaW||3|||,fS(s( The full copytracing algorithm which finds all the new files that were
    added from merge base up to the top commit and for each file it checks if
    this file was copied from another file.

    This is pretty slow when a lot of changesets are involved but will track all
    the copies.
    s&  searching for copies back to rev %d
R#tfullcopyt
incompleteR�R�RoR�stopological common ancestoris%  unmatched files new in both:
   %s
s
   iisK  all copies found (* = to merge, ! = divergent, % = renamed and deleted):
Rgt*t!t%s   src: '%s' -> dst: '%s' %s
s!  checking for directory renames
t/cS@s'i|]\}}|d|d�qS(R�((t.0R*R+((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pys
<dictcomp>�s	s)   discovered dir src: '%s' -> dst: '%s'
s'   pending file src: '%s' -> dst: '%s'
N(RR
RHtisancestorofRcR"RDRGR=R>R[RaRst_checkcopiestdicttupdateR�tsetR%R&R	RjREtdirstaddpathR$Rtdirnametaddt
startswith(5RRkRlR�t_c1t_c2tdirtyc1tdirtyc2tgraftttcaRtm1tm2R@R�R�tdata1tdata2RmRntbothnewtu1rtu2rtu1utu2utmtaR4R#R�trenamedeletetrenamedeletesett
divergesettoftfltbothdivergetbothincompletedivergeR�tboth1tboth2R�tnotetd1td2tinvalidtdirmoveR(R'tdsrctddsttiR9tmovewithdirtdf((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyR��s*$$




#
#
		*5




#

&




	
	


c@s$|j�d	kr!|j�}n�j�d	krB�j��ni}t�}|j��|jd�j��j��s�|jjd�t||���S�}xj|�krt	|j
��dkr�|jjd�t||���S|j|j��|j�}q�Wt
���}x3|j�D]%\}}	|	�kr0|	||<q0q0W���fd�}
g|D]}|
|�ru|^qu}|rtjt�}
tjt�}xc�j�j��D]L}tjj|�}tjj|�}|
|j|�||j|�q�Wx�|D]�}tjj|�}tjj|�}|
|}||}||}�j|�}|jjdd�}t	|�|kr�|jjtd�|t	|�f�q$nx9|D]1}|j|�}t||�r�|||<q�q�Wq$Wn|iiiifS(
s~ Fast copytracing using filename heuristics

    Assumes that moves or renames are of following two types:

    1) Inside a directory only (same directory name but different filenames)
    2) Move from one directory to another
                    (same filenames but different directory names)

    Works only when there are no merge commits in the "source branch".
    Source branch is commits from base up to c2 not including base.

    If merge is involved it fallbacks to _fullcopytracing().

    Can be used by setting the following config:

        [experimental]
        copytrace = heuristics

    In some cases the copy/move candidates found by heuristics can be very large
    in number and that will make the algorithm slow. The number of possible
    candidates to check can be limited by using the config
    `experimental.copytrace.movecandidateslimit` which defaults to 100.
    s%d::%ds?switching to full copytracing as base is not an ancestor of c2
is0switching to full copytracing because of merges
c@s"|�ko!|�ko!|�kS(N((R4(R�RlR�(s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt<lambda>�RgR]scopytrace.movecandidateslimitsBskipping copytracing for '%s', more candidates than the limit: %d
N(RR
RHR�R=R~RDRGR�R	RR�RLR\R$tcollectionstdefaultdictR%R>tosR/tbasenameR�tappendRvR�tstatusRt_related(RRkRlR�R8tchangedfilesRztcpR(R'tfiltR4tmissingfilestbasenametofilenametdirnametofilenameR�R�tsamebasenametsamedirnametmovecandidatestf2t
maxcandidatest	candidatetf1((R�RlR�s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyR��sb	!%



	
cC@s�||kr|S|j�|j�}}y�|j�|j�}}|dkr`t|�}n|dkr{t|�}nxctr�|j�|j�}}||kr�t|�}q~||kr�t|�}q~||kSq~WWntk
r�tSXdS(sFreturn True if f1 and f2 filectx have a common ancestor

    Walk back to common ancestor to see if the two files originate
    from the same file. Since workingfilectx's rev() is None it messes
    up the integer comparison logic, hence the pre-step check for
    None (f1 and f2 can only be workingfilectx's initially).
    N(R-R1R
tnextRt
StopIterationR
(R�R�tg1tg2tf1rtf2r((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyR�s$		
cC@s�|j�}|j�}	|j�}
|j�}|oL||koL||
k}t|�}
t|�}|||
j|�kr�|r�dSd}|h}x�|
|||�j�D]~}|j�}||kr�|j�|kr�Pq�q�n|j|�|r||d|<n||d|<||	kr2q�n|	||
j|�krOdS|||	|�}t||�}|r�||ks�||j�kr�|r�||d|<n�||
kr�||d|<ne|r�||d|<|d|=||d|<n5x2|D]*}||
kr||g|d|<PqqWdSq�W||kr�|sN|r_||d|<q�xa|D]V}||
krf||kr�|dj	|g�j
|�n||g|d|<dSqfWndS(s�
    check possible copies of f from msrc to mdst

    srcctx = starting context for f in msrc
    dstctx = destination context for f in mdst
    f = the filename to check (as in msrc)
    base = the changectx used as a merge base
    tca = topological common ancestor for graft-like scenarios
    remotebase = True if base is outside tca::srcctx, False otherwise
    limit = the rev number to not search beyond
    data = dictionary of dictionary to store copy data. (see mergecopies)

    note: limit is only an optimization, and provides no guarantee that
    irrelevant revisions will not be visited
    there is no easy way to make this algorithm stop in a guaranteed way
    once it "goes behind a certain revision".
    NR�R#R�R�R�(R=RR.R
R-R/R1R�R�t
setdefaultR�(tsrcctxtdstctxR4R�R�t
remotebaseRtdatatmsrctmdstR@R�t	backwardst
getsrcfctxt
getdstfctxR�tseentocRltcrtsf((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyR�'sd
 	 
$

 c
C@s�i}|jjdd�}tj|�}|dk	rn|dksT|sT|dkrnt||||�}nxNt||||�j�D]/\}}	||kr�q�n||j|	�q�WdS(s+reproduce copies from fromrev to rev in the dirstate

    If skiprev is specified, it's a revision that should be used to
    filter copy records. Any copies that occur between fromrev and
    skiprev will not be duplicated, even if they appear in the set of
    copies between fromrev and rev.
    R]R^R�N(RDR`RR�R
RfR$t
markcopied(
RtwctxRtfromrevtskiprevtexcludetctraceconfigtbctraceR(R'((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pytduplicatecopies�s*($t
__future__RR�RR�ti18nRRgRRMRRRRtutilsRR"R,R5R
R<RARZR\RbRfRsRR�R�R�R�R�R�R�R�(((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt<module>s2(	U	
		9		#		I		�	e	 	]