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__/sparse.cpython-310.pyc
o

�]Lb}i�@s:ddlmZddlZddlmZddlmZddlmZm	Z
mZm
ZmZmZmZmZmZddlmZdZd	d
�Zdd�Zd
d�Zdd�Zd3dd�Zdd�Zdd�Zdd�Zdd�Zdd�Z dd�Z!d4d d!�Z"d"d#�Z#d5d$d%�Z$d&d'�Z%	d6d(d)�Z&d5d*d+�Z'd5d,d-�Z(	.	.		.	.	.		d7d/d0�Z)						d8d1d2�Z*dS)9�)�absolute_importN�)�_)�hex)	�error�match�merge�
mergestate�pathutil�pycompat�requirements�scmutil�util)�hashutilFc	CsPt�dt|�|���t�}t�}t�}d}d}|�d�D]u}|��}|r)|�d�r*q|�d�r?|dd���}|r>|�|�q|dkrY|rT||krTt�	t
d	�d
|i��d}|}q|dkrbd}|}q|r�|durxtj	t
d
�||d�t
d�d��|���d�r�|�t
d�||d��q|�|�q|||fWd�S1s�wYdS)z�Parse sparse config file content.

    action is the command which is trigerring this read, can be narrow, sparse

    Returns a tuple of includes, excludes, and profiles.
    z+sparse.parseconfig(ui, %d bytes, action=%s)NF�
�#s	%include �	s	[include]s5%(action)s config cannot have includes after excludes�actionTs	[exclude]s4%(action)s config entry outside of section: %(line)s)rslines<add an [include] or [exclude] line to declare the entry type)�hint�/sPwarning: %(action)s profile cannot use paths starting with /, ignoring %(line)s
)r�timedcm�len�set�split�strip�
startswith�addr�Abortr�warn)	�ui�raw�action�includes�excludes�profiles�current�havesection�line�r(�2/usr/lib/python3/dist-packages/mercurial/sparse.py�parseconfig"sr
�

�����������
�$�r*cCs|j||d���S)z1Resolve the raw content of a sparse profile file.)�changeid)�filectx�data)�repo�profiler+r(r(r)�readprofilehsr0c
Cs<ts
t�t�t�fS|j�d�}|st�t�t�fS|dur%t�td���t|j|d�\}}}||}|r�t�}|r�|�	�}||vrCq8|�
|�zt|||�}Wn$tjytd||f}	|j�
dd�rl|j�|	�n|j�|	�Yq8wt|j|d�\}
}}|�|
�|�|�|�|�|s:|}|r�|�
d�|||fS)z�Obtain sparse checkout patterns for the given rev.

    Returns a tuple of iterables representing includes, excludes, and
    patterns.
    �sparseNs3cannot parse sparse patterns from working directorys?warning: sparse profile '%s' not found in rev %s - ignoring it
smissingwarnings.hg*)�enabledr�vfs�tryreadrrrr*r�poprr0�ManifestLookupError�
configboolr�debug�update)
r.�revr r"r#r$�ctx�visitedr/�msg�	pincludes�	pexcludes�subprofsr(r(r)�patternsforrevosR�
���
�


�

rAc	sf�fdd��j��D�}t�}t�}t�}|D]}t�|�\}}}||O}||O}||O}q|||fS)z�Determine the active sparse config rules.

    Rules are constructed by reading the current sparse config and bringing in
    referenced profiles from parents of the working directory.
    c�"g|]
}|�jkr�j�|��qSr(��nullid�	changelogr:��.0�node�r.r(r)�
<listcomp>��


�z activeconfig.<locals>.<listcomp>)�dirstate�parentsrrA)	r.�revs�allincludes�allexcludes�allprofilesr:r"r#r$r(rIr)�activeconfig�s
�

rRTcCs�|j}|�d�}|r|�d�}nd}|dus|rB|durBtt�|j�d�����}||d<|rB|j�d�}tt�|����}||d<d||fS)zObtain the signature string for the current sparse configuration.

    This is used to construct a cache key for matchers.
    s	signatures
tempsignature�0Nr1�
tempsparse�%s %s)�_sparsesignaturecache�getrr�sha1r3r4�digest)r.�includetemp�cache�	signature�
tempsignaturer r(r(r)�configsignature�s
r^cCs�|�dd��F}t|�D]	}|�d|�q|r-|�d�t|�D]}|�|�|�d�q |rE|�d�t|�D]}|�|�|�d�q8Wd�n1sOwY|j��dS)z:Write the sparse config file given a sparse configuration.r1swbs
%%include %s
s
[include]
rs
[exclude]
N)r3�sorted�writerV�clear)r.r"r#r$�fh�p�i�er(r(r)�writeconfig�s 



��rfcCs$|j�d�}|st�St|�d��S�NrTr)r3r4rr)r.r r(r(r)�readtemporaryincludes�srhcCs&|j�dd�t|���|j��dSrg)r3r`�joinr_rVra)r.r"r(r(r)�writetemporaryincludes�srjcCs*t|�}|D]}|�|�qt||�dS�N)rhrrj)r.�
additionalr"rdr(r(r)�addtemporaryincludessrmc
Cs
tr|j�d�s
dS|��}|js|js|js|jrdSt|dd�}|j	}t
��}g}t|�}|D]}||vrM||�sMt
d�}|�|tjd|�|�|�q1t
j|||d|dddd�|D]
}|j|ddd�q_|j�d�|j��t
d�}	|j�|	t|��dS)	NrTF�rZs*dropping temporarily included sparse files�.��wantfiledata��
p1_tracked�
wc_trackedsAcleaned up %d temporarily added file(s) from the sparse checkout
)r2r3�exists�status�modified�added�removed�deleted�matcherrL�mergemod�mergeresultrhr�addfile�
mergestatemod�
ACTION_REMOVE�append�applyupdates�update_file�unlinkrVrarr)
r.�s�sparsematchrL�mresult�dropped�tempincludes�file�messager=r(r(r)�prunetemporaryincludess6
��
�r�cCs(dd�|D�}t�d|�}t�||g�S)zqReturns a matcher that returns true for any of the forced includes
    before testing against the actual matcher.cSsg|]}d|df�qS)spath�r()rG�includer(r(r)rJ/sz'forceincludematcher.<locals>.<listcomp>r�)�matchmod�includematcher�unionmatcher)r{r"�kindpatsr�r(r(r)�forceincludematcher,sr�c
	stst��S|r
|dgkr�fdd��j��D�}t�|d�}d|d�ttj	|��f}�j
�|�}|r6|Sg}|D]*}zt�|�\}}	}
|sI|	rZtj
�jdg||	dd	�}|�|�Wq:tydYq:w|slt��}nt|�d
krw|d}nt�|�}|r�t��}t||�}|�j
|<|S)z�Obtain a matcher for sparse working directories for the given revs.

    If multiple revisions are specified, the matcher is the union of all
    revs.

    ``includetemp`` indicates whether to use the temporary sparse profile.
    NcrBr(rCrFrIr(r)rJArKzmatcher.<locals>.<listcomp>rnrU� r�srelpath)r��exclude�defaultrr)r2r��alwaysrLrMr^ri�mapr�bytestr�_sparsematchercacherWrAr�rootr��IOErrorrr�rhr�)
r.rNrZr\�key�result�matchersr:r"r#r$r{r�r(rIr)r{4sN	
��
��




r{c 	Cs�tsdSdd�|��D�}t||�}|��rdSt�}i}|r*t||����g�}	nt||��g�}	g}
|��D]b\}}|\}
}}|�|�|	|�rO|||<n4|
t	j
kr^|
�|�|||<n%|rm|
jsl|
�|�|||<n|
t	j
krw|||<n||vr�t	j||f||<|r�|
t	j
kr�|\}}}}}|	|�s�|
�|�q8t|
�dk�r|j�td�t|
��t||
�t��}d}|d��}|
D]}||vr�|d|}|�|t	j|��df|�q�|j���/tj|||d|dddd	�|j}|�t	jg�D]
\}}}|j|d
d
d�q�Wd�n	1�swYt|�d}||@}|�r_|�s_|��}|D]0}||�}|	|�}|�sO|�rO|�|�}t	j|dfd
f||<�q.|�r]|�s]t	jgd
f||<�q.|� |�dS)zAFilter updates to only lay out files that match the sparse rules.NcSsg|]}|���qSr()r:)rG�pctxr(r(r)rJvsz(filterupdatesactions.<locals>.<listcomp>rsCtemporarily included %d file(s) in the sparse checkout for merging
s%temporarily adding to sparse checkoutFrorpTrr�r�)!r2rMr{r�r�p1r:�filemaprr�ACTION_MERGEr��no_op�
ACTION_FORGETr�rrrvrrmr|r}�manifestr~�
ACTION_GET�flagsrL�parentchanger��
getactionsr�rR�
setactions) r.�wctx�mctx�branchmerger��oldrevs�oldsparsematch�files�
prunedactionsr��temporaryfilesr�r!�type�argsr=�f1�f2�fa�move�anc�tmresultr��wctxmanifest�fctxrLr�r$�changedprofiles�mf�old�newr(r(r)�filterupdatesactionsqs�







�


����

���	���
��r�cCsbt�}|�|j�|�|j�|�|j�t|�}d}|D]}||�s0|j�td�|�|}q|r:t	�
td���|j}|d}	g}
g}g}|	��}
t|
�}t
��}|D]`}||�}||�}|rc|rk|r�|r�||vr�|
�|�}|j�|�r�|�|tj|fd�|�|�qU|�|tj|dfd�|
�|�qU|r�|r�|s�|s�||vr�|�|�||vr�|�|tjgd�qUd}|D]}|j�td�|�|}q�|r�t	�
td���t�|�D]\}}||vr�||�}||�}|r�|s�|�|�q�t
j|||d|dddd�|
D]}|j|d	d	d
��q|D]}|j|ddd
��q|D]}|j|d	d	d	d��q|
||fS)aRefreshes working directory by taking sparse config into account.

    The old status and sparse matcher is compared against the current sparse
    matcher.

    Will abort if a file with pending changes is being excluded or included
    unless ``force`` is True.
    Fspending changes to '%s'
s2could not update sparseness due to pending changesror�sjcannot change sparseness due to pending changes (delete the files or use --force to bring them back dirty)NrpTrr)rsrt�possibly_dirty)rr9rwrxryr{rrrrrrLr�r|r}r��wvfsrur~r�ACTION_EXECr�r�r�r�	iteritemsr�r�)r.�
origstatus�origsparsematch�force�pendingr��abort�frLr;rx�lookupr�r�r�r�r�r�r��fl�stater(r(r)�refreshwdir�s�
��
�
���	
��
�
r�cCsV||}t||���d}|t|���@r%|��}t|�}t|||dd�t|�dS)z1Perform actions after a working directory commit.r�T�r�N)rAr:rr�rvr{r�r�)r.rHr;r$r�r�r(r(r)�aftercommitIsr�c
	Cs|����|j�d�}t|j|d�\}}}	|��}
t|�}t|j�}tj	|vr6|r6|j�
tj	�t�|�ntj	|vrG|j�
tj	�t�|�zt||||�t||
||d�WWd�Sty�|j|kr{|j��|j|O_t�|�t||||	��w1s�wYdS)z5Update the sparse config and working directory state.r1r�N)�lockr3r4r*rrvr{rr�SPARSE_REQUIREMENT�discardr
�writereporequirementsrrfr��	Exceptionra)
r.r"r#r$r��removingr �oldincludes�oldexcludes�oldprofiles�	oldstatus�oldmatch�oldrequiresr(r(r)�_updateconfigandrefreshwdirZs6

�



�


��r�c	Cs�|���T|j���6|j�d�}t|j|d�\}}}|s.|s.	Wd�Wd�dSt|t�t�||d�Wd�n1sCwYWd�dSWd�dS1s[wYdS)z�Clears include/exclude rules from the sparse config.

    The remaining sparse config only has profiles, if defined. The working
    directory is refreshed, as needed.
    r1Nr�)	�wlockrLr�r3r4r*rr�r)r.r�r r"r#r$r(r(r)�
clearrules�s�P�r�cCs�|����|j����|j�d�}t|j|d�\}}}t|�\}}	}
d}|D][}tj	t�
|�dd��}
|
��}Wd�n1sAwYt|j|d�\}}}t|�t|�t|�}|�
||�|�
||	�|�
||
�t|�t|�t|�|kr�d}q&d}}}d}|r�t||
�}t||�}t||	�}ttt|||||d	��}t|j||||g|�R�Wd�n1s�wYWd�dSWd�dS1s�wYdS)
z�Import sparse config rules from files.

    The updated sparse config is written out and the working directory
    is refreshed, as needed.
    r1Fsrb)�modeNTr)rrrr�)r�rLr�r3r4r*rrRr�	posixfile�
expandpath�readrr9r�r��printchanges)r.�opts�pathsr�r r"r#r$�	aincludes�	aexcludes�	aprofiles�changedrcrb�	iincludes�	iexcludes�	iprofiles�oldsize�profilecount�includecount�excludecount�fcountsr(r(r)�importfromfiles�sJ
�
��
���
�P�r�r(c

s������������j�����j�d�}
t�j|
d�\}}}
|r,t�}t�}t�}nt|�}t|�}t|
�}��fdd�}||�}||�}||�}||�}||�}|�	|�|�	|�|�	|�|�
|�|�
|�|�
|�t||
�t|
|�}t||�t||�}t||�t||�}ttt
�|||||d��}t�j||||g|�R�Wd�n1s�wYWd�n1s�wYWd�dSWd�dS1s�wYdS)zuPerform a sparse config update.

    The new config is written out and a working directory refresh is performed.
    r1cs�tdd�|D��rt�td����r|S�j���}}g}|D]-}t�|d�\}}|tjvs3|durH|r9|dndt	�
|||�}|�|�q |�|�q |S)Ncss�|]	}tj�|�VqdSrk)�os�path�isabs)rG�patr(r(r)�	<genexpr>�s�z7updateconfig.<locals>.normalize_pats.<locals>.<genexpr>spaths cannot be absolute�:r�)�anyrrrr��getcwdr��	_patsplit�cwdrelativepatternkindsr
�	canonpathr�)�patsr��cwd�abspats�kindpat�kindr��ap�r.�usereporootpathsr(r)�normalize_pats�s�z$updateconfig.<locals>.normalize_pats)r�r�N)r�r�rLr�r3r4r*rr�difference_updater9rr�r�r�)r.r�r�r��reset�delete�
enableprofile�disableprofiler�r	r �
oldinclude�
oldexcluder��
newinclude�
newexclude�newprofilesr
r�r�r�r�r(rr)�updateconfig�sh 
�





������
���Prc	Cs�|�d|��[}|��|�|jdtd�|�|�|jdtd�|�|�|jdtd�|�|��sY|�|jdtd	�|�|�|jd
td�|�|�|jdtd
�|�Wd�dSWd�dS1sdwYdS)z/Print output summarizing sparse config changes.r1sprofiles_addedsProfiles changed: %d
sinclude_rules_addedsInclude rules changed: %d
sexclude_rules_addedsExclude rules changed: %d
sfiles_addedsFiles added: %d
s
files_droppedsFiles dropped: %d
sfiles_conflictingsFiles conflicting: %d
N)�	formatter�	startitem�	condwrite�verboser�isplain)	rr�r�r�r�rxr��conflicting�fmr(r(r)r� sH���
����"�r�)T)NT)F)FF)r(r(Fr(r(r(FF)rrrrrr)+�
__future__rr��i18nrrHr�rrr�rr|r	rr
rrr
r�utilsrr2r*r0rArRr^rfrhrjrmr�r�r{r�r�r�r�r�r�rr�r(r(r(r)�<module>sT,F<
%
=
se
�
)
4
�_�

https://t.me/RX1948 - 2025