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

�]Lb��@s4ddlmZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZmZmZmZmZm
Z
mZmZmZddlmZdd	lmZmZe� d
�Z!e�"d�Z#e#duZ$ej%Z%ej&Z&ej'Z(ej)Z)Gdd
�d
e&�Z*Gdd�de&�Z+dd�Z,dd�Z-e�.ej/�Gdd�de0��ZdS)�)�absolute_importN�)�_)�delattr)�tracing)�dirstatemap�encoding�error�match�node�pathutil�policy�pycompat�scmutil�sparse�util)�	timestamp)�dirstater�parsersrc@�eZdZdZdd�ZdS)�	repocachezfilecache for files in .hg/cCs|j�|�S�N)�_opener�join��self�obj�fname�r�4/usr/lib/python3/dist-packages/mercurial/dirstate.pyr<�zrepocache.joinN��__name__�
__module__�__qualname__�__doc__rrrrrr9�rc@r)�	rootcachez*filecache for files in the repository rootcCs
|�|�Sr)�_joinrrrrrC�
zrootcache.joinNr!rrrrr'@r&r'c��fdd�}|S)Ncs6|��sd}|�j;}t�|���|g|�Ri|��S)Nz.calling `%s` outside of a parentchange context��pendingparentchanger"r	�ProgrammingError�r�args�kwargs�msg��funcrr�wrapH�


z%requires_parents_change.<locals>.wrapr�r3r4rr2r�requires_parents_changeG�r7cr*)Ncs6|��rd}|�j;}t�|���|g|�Ri|��S)Nz-calling `%s` inside of a parentchange contextr+r.r2rrr4Sr5z(requires_no_parents_change.<locals>.wraprr6rr2r�requires_no_parents_changeRr8r9c@s�eZdZ	d�dd�Zdd�Zejdd��Zdd	�Ze	d
d��Z
edd
��Ze
d�dd��Zedd��Zdd�Zed�dd��Ze	dd��Ze	dd��Ze	dd��Ze	dd��Zd d!�Zd"d#�Ze	d$d%��Zd&d'�Zd�d)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�ZeZ d3d4�Z!d5d6�Z"d7d8�Z#ed9d:��Z$d;d<�Z%d�d=d>�Z&d?d@�Z'dAdB�Z(dCdD�Z)dEdF�Z*dGdH�Z+e,d�dIdJ��Z-e,dKdL��Z.e,dMdN��Z/e,dOdP��Z0e1dQdR��Z2e1			(d�dSdT��Z3dUdV�Z4dWdX�Z5d�dYdZ�Z6d�d[d\�Z7d�d]d^�Z8d_d`�Z9d�dadb�Z:dcdd�Z;dedf�Z<dgdh�Z=didj�Z>dkdl�Z?dmdn�Z@dodp�ZAdqdr�ZBdsdt�ZCdudv�ZDd�dxdy�ZEdzd{�ZFd|d}�ZGd~d�ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd(S)�rFc		Cs�||_||_||_||_||_||_||_t�|�|_	d|_
d|_||_i|_
d|_d|_d|_d|j|_i|_d|_tj|_|jdS)z�Create a new dirstate object.

        opener is an open()-like callable that can be used to open the
        dirstate file; root is the root of the directory tracked by
        the dirstate.
        Frsdirstatesdirstate-tracked-hints
%s.pendingN)�_use_dirstate_v2�_use_tracked_hint�_nodeconstantsr�	_validate�_root�_sparsematchfnr�normasprefix�_rootdir�_dirty�_dirty_tracked_set�_ui�
_filecache�_parentwriters�	_filename�_filename_th�_pendingfilename�_plchangecallbacks�_origplr�_mapcls�_cwd)	r�opener�ui�root�validate�
sparsematchfn�
nodeconstants�use_dirstate_v2�use_tracked_hintrrr�__init___s(
zdirstate.__init__cCs
|jdS)zRmake sure the parents are loaded

        Used to avoid a race condition.
        N��_pl�rrrr�prefetch_parents�s
zdirstate.prefetch_parentsccs(�|jd7_dV|jd8_dS)z�Context manager for handling dirstate parents.

        If an exception occurs in the scope of the context manager,
        the incoherent dirstate won't be written when wlock is
        released.
        rN�rFrYrrr�parentchange�s�zdirstate.parentchangecCs
|jdkS)zsReturns true if the dirstate is in the middle of a set of changes
        that modify the dirstate parent.
        rr[rYrrrr,�s
zdirstate.pendingparentchangecCs$|�|j|j|j|j|j�|_|jS)zAReturn the dirstate contents (see documentation for dirstatemap).)rLrDrr>r<r:�_maprYrrrr]�s�z
dirstate._mapcCs|��S)z�The matcher for the sparse checkout.

        The working directory may not include every file from a manifest. The
        matcher obtained by this property will match a path if it is to be
        included in the working directory.
        )r?rYrrr�_sparsematcher�szdirstate._sparsematcher�branchc
CsLz|j�d���p
dWSty%}z|jtjkr�WYd}~dSd}~ww)Nr_sdefault)r�read�strip�IOError�errno�ENOENT)r�instrrr�_branch�s��zdirstate._branchcCs
|j��Sr)r]�parentsrYrrrrX�s
zdirstate._plcCs|j�|�Sr)r]�
hastrackeddir)r�drrr�hasdir�r zdirstate.hasdir�	.hgignorecCs<|��}|s
t��Sdd�|D�}tj|jdg||jjd�S)NcSsg|]}d|�qS)s
include:%sr��.0�frrr�
<listcomp>��z$dirstate._ignore.<locals>.<listcomp>���warn)�_ignorefiles�matchmod�neverr
r>rDrs)r�files�patsrrr�_ignore�s
zdirstate._ignorecCs|j�dd�otjdkS)N�uisslash�/)rD�
configboolr�osseprYrrr�_slash�szdirstate._slashcC�t�|j�Sr)r�	checklinkr>rYrrr�
_checklink�szdirstate._checklinkcCstt�|j��Sr)�boolr�	checkexecr>rYrrr�
_checkexec��zdirstate._checkexeccCst�|�d��S)N�.hg)r�fscasesensitiver(rYrrr�
_checkcase�szdirstate._checkcasecCs
|j|Sr)rA)rrnrrrr(�s
zdirstate._joincsg����fdd�}|S)aSbuild a callable that returns flags associated with a filename

        The information is extracted from three possible layers:
        1. the file system if it supports the information
        2. the "fallback" information stored in the dirstate if any
        3. a more expensive mechanism inferring the flags from the parents.
        cs�d}d}z
t���|��}Wn
tyYdSw�jr$t�|�r#dSn"��|�}|jr2|j	r1dSn�s:��
����d|�}d|vrFdS�jrRt�|�rPdSdS|dur[��|�}|j
re|jrcdSdS|durw�sq��
����d|�}d|vr}dSdS)Nrq�lr�x)�os�lstatr(�OSErrorr�r�
statislink�	get_entry�has_fallback_symlink�fallback_symlink�appendr��
statisexec�has_fallback_exec�
fallback_exec)�x�entry�fallback_value�st��
buildfallback�
fallback_funcrrr�	get_flags�sL�
�
�
�
�z$dirstate.flagfunc.<locals>.get_flagsr)rr�r�rr�r�flagfunc�s
)zdirstate.flagfunccCs|j�dd�}|r|St��S)Nrzsforcecwd)rD�configr�getcwd)r�forcecwdrrrrM(sz
dirstate._cwdcCsL|j}||jkr
dS|j}t�|�s|tj7}|�|�r$|t|�d�S|S)aReturn the path from which a canonical path is calculated.

        This path should be used to resolve file patterns or to convert
        canonical paths back to file paths for display. It shouldn't be
        used to get real file paths. Use vfs functions instead.
        rqN)rMr>r�endswithseprr}�
startswith�len)r�cwd�rootseprrrr�0s



zdirstate.getcwdNcCs4|dur|��}t�|j||�}|jrt�|�S|Sr)r�r�pathtor>r~�pconvert)rrnr��pathrrrr�Ds
zdirstate.pathtocCs|j�|�}|dur
t�S|S)z-return a DirstateItem for the associated pathN)r]�get�DirstateItem)rr�r�rrrr�Lszdirstate.get_entrycCs
||jvSr)r])r�keyrrr�__contains__Sr)zdirstate.__contains__cCstt|j��Sr)�iter�sortedr]rYrrr�__iter__Vszdirstate.__iter__cCrr)r�	iteritemsr]rYrrr�itemsYr zdirstate.itemscs�fdd��jD�S)Ncsg|]}��|��qSr)r=)rm�prYrrro_sz$dirstate.parents.<locals>.<listcomp>rWrYrrYrrg^szdirstate.parentscC�|�|jd�S)Nr�r=rXrYrrr�p1a�zdirstate.p1cCr�)Nrr�rYrrr�p2dr�zdirstate.p2cCs|jd|jjkS)zTrue if a merge is in progressr)rXr<�nullidrYrrr�in_mergegszdirstate.in_mergecCrr)r�tolocalrfrYrrr�branchlr zdirstate.branchcCsn|dur|jj}|jdkrtd��d|_|jd}|jdur"|j|_|jj}||ko-||k}|jj|||d�S)z�Set dirstate parents to p1 and p2.

        When moving from two parents to one, "merged" entries a
        adjusted to normal and previous copy records discarded and
        returned by the call.

        See localrepo.setparents()
        NrsKcannot set dirstate parent outside of dirstate.parentchange context managerTr)�fold_p2)	r<r�rF�
ValueErrorrBrXrKr]�
setparents)rr�r��oldp2r�r�rrrr�os	
�

zdirstate.setparentscCst|jj�|t�|��|jddddd�}z|�|jd�|��|jd}|r/|�	�WdSWdS|�
��)Nr_�wT��
atomictemp�
checkambig�
s_branch)�	__class__rf�setr�	fromlocalr�write�closerE�refresh�discard)rr�rn�cerrr�	setbranch�s
�zdirstate.setbranchcCs:dD]}||jvrt||�qd|_d|_d|_d|_dS)aCauses the next access to reread the dirstate.

        This is different from localrepo.invalidatedirstate() because it always
        rereads the dirstate. Use localrepo.invalidatedirstate() if you want to
        check whether the dirstate has changed before rereading it.)r]rfryFrN)�__dict__rrBrCrFrK)r�arrr�
invalidate�s

�
zdirstate.invalidatecCs>||krdSd|_|dur||jj|<dS|jj�|d�dS)z=Mark dest as a copy of source. Unmark dest if source is None.NT)rBr]�copymap�pop)r�source�destrrr�copy�sz
dirstate.copycCs|jj�|d�Sr)r]r�r�)r�filerrr�copied�r�zdirstate.copiedcC�|jjSr)r]r�rYrrr�copies�szdirstate.copiescCsXd|_|j�|�}|dus|js|�|�|j�|�}|r%|jj�|d�|r*d|_|S)aUa "public" method for generic code to mark a file as tracked

        This function is to be called outside of "update/merge" case. For
        example by a command like `hg add X`.

        if reset_copy is set, any existing copy information will be dropped.

        return True the file was previously untracked, False otherwise.
        TN)	rBr]r��tracked�_check_new_tracked_filename�set_trackedr�r�rC)r�filename�
reset_copyr��pre_trackedrrrr��s
zdirstate.set_trackedcCs |j�|�}|rd|_d|_|S)a
a "public" method for generic code to mark a file as untracked

        This function is to be called outside of "update/merge" case. For
        example by a command like `hg remove X`.

        return True the file was previously tracked, False otherwise.
        T)r]�
set_untrackedrBrC)rr��retrrrr��s
	zdirstate.set_untrackedcCs<d|_|j|js|�|�|\}}}|j�||||�dS)zFrecord that the current state of the file on disk is known to be cleanTN)rBr]r�r��	set_clean)rr��parentfiledata�mode�size�mtimerrrr��s


zdirstate.set_cleancCsd|_|j�|�dS)z<record that the current state of the file on disk is unknownTN)rBr]�set_possibly_dirty)rr�rrrr��szdirstate.set_possibly_dirtycCs�|jr
d}t�|��|j�|�}|durd}n|j}|s0|s0|j�|�dur/|j�|�d|_n
|s=|r=|dur=|jr=dS|jj|||dd�dS)a,Set a file as tracked in the parent (or not)

        This is to be called when adjust the dirstate to a new parent after an history
        rewriting operation.

        It should not be called during a merge (p2 != nullid) and only within
        a `with dirstate.parentchange():` context.
        s7update_file_reference should not be called when mergingNFT)�has_meaningful_mtime)	r�r	r-r]r�r��reset_staterB�added)rr��
p1_trackedr1r��
wc_trackedrrr�update_file_p1�s*
�
�zdirstate.update_file_p1c	CsRd|_|j�|�}|durd}n|j}||krd|_|jj||||||d�dS)a�update the information about a file in the dirstate

        This is to be called when the direstates parent changes to keep track
        of what is the file situation in regards to the working copy and its parent.

        This function must be called within a `dirstate.parentchange` context.

        note: the API is at an early stage and we might need to adjust it
        depending of what information ends up being relevant and useful to
        other processing.
        TNF)�p2_infor�r�)rBr]r�r�rCr�)	rr�r�r�r��possibly_dirtyr��	old_entry�prev_trackedrrr�update_files
�zdirstate.update_filecCs�t�|�|j�|�rtd�}|t�|�;}t�|��t	�
|�D]-}|j�|�r+dS|j�|�}|durM|jsMtd�}|t�|�t�|�f;}t�|��q dS)Ns directory %r already in dirstates#file %r in dirstate clashes with %r)
r�
checkfilenamer]rhrr�bytestrr	�Abortr�finddirsr��removed)rr�r1rir�rrrr�@s


��z$dirstate._check_new_tracked_filenamec
Cs�|durtj�tj�|j|��}|s4|s0d|vr0|�dd�\}}|�|d|d�}|d|}|S|}|Sd|vrZ|�dd�\}}|�|d|d�}|jd|}	|dt�||	�}nt�||j�}|||<|S)Nr{rFT)	r�r��lexistsrr>�rsplit�
_normalizer�fspath)
rr��normed�
ignoremissing�exists�storemaprirn�folded�rrrr�
_discoverpathPs$�
�zdirstate._discoverpathcCsHt�|�}|jj�|d�}|dur"|r|}|S|�|||||jj�}|Sr)r�normcaser]�filefoldmapr�r�rr��isknownr�r�r�rrrr�_normalizefilejs
��zdirstate._normalizefilecCs`t�|�}|jj�|d�}|dur|jj�|d�}|dur.|r#|}|S|�|||||jj�}|Sr)rrr]rr��
dirfoldmaprrrrrr�vs
��zdirstate._normalizecCs|jr
|�|||�S|S)aL
        normalize the case of a pathname when on a casefolding filesystem

        isknown specifies whether the filename came from walking the
        disk, to avoid extra filesystem access.

        If ignoremissing is True, missing path are returned
        unchanged. Otherwise, we try harder to normalize possibly
        existing path components.

        The normalized case is determined based on the following precedence:

        - version of name already stored in the dirstate
        - version of name stored on disk
        - version provided via command arguments
        )r�r�)rr�rr�rrr�	normalize�szdirstate.normalizecCs|j��d|_dS)NT)r]�clearrBrYrrrr�s

zdirstate.clearcCs�|dur
|}g}|��n-t|�dkr,g}g}|D]}||vr%|�|�q|�|�qnt|�}|t|�@}||}|jdurC|j|_|j�||jj	�|D]}|j
rY|�|�qN|jj|ddd�qN|D]}|j�|�qed|_
dS)N�
T)r�r�)rr�r�r�rKrXr]r�r<r�r�r�r�rB)r�parent�allfiles�changedfiles�	to_lookup�to_droprn�changedfilessetrrr�rebuild�s:
�
�
zdirstate.rebuildcCr�)z�Return identity of dirstate itself to detect changing in storage

        If identity of previous dirstate is equal to this, writing
        changes based on the former dirstate out can keep consistency.
        )r]�identityrYrrrr�szdirstate.identitycs��jsdS�jo
�j}�r3�jd�jf��fdd�ddd�|r1�jd�jf��fdd�ddd�dS�fd	d�}|�j��}���|�Wd�n1sOwY|rt|�j��}���|�Wd�dS1smwYdSdS)
N�dirstate-1-mainc����|�Sr��_writedirstate�rn�r�trrr�<lambda>��z dirstate.write.<locals>.<lambda>�plainT��location�
post_finalizesdirstate-2-key-postcrr)�_write_tracked_hintrrrrr�rcs�j|dddd�S)Nr�Tr�)rrrYrrr�s)rBr;rC�addfilegeneratorrGrHrr")rr�	write_keyr�rnrrrr��s:���"��zdirstate.writecCs|j�|j�d|_dS)zOremove the tracked_hint file

        To be used by format downgrades operationFN)r�unlinkrHr;rYrrr�delete_tracked_hint�s
zdirstate.delete_tracked_hintcCs||j|<dS)a%add a callback to be called when the wd parents are changed

        Callback will be called with the following arguments:
            dirstate, (oldp1, oldp2), (newp1, newp2)

        Category is a unique identifier to allow overwriting an old callback
        with a newer callback.
        N)rJ)r�category�callbackrrr�addparentchangecallback�s	z dirstate.addparentchangecallbackcCsd|jdur#|j|jkr#tt�|j��D]\}}|||j|j�qd|_|j�||�d|_d|_	dS)NF)
rKrXr�rr�rJr]r�rBrC)rrr��cr(rrrrs
�
zdirstate._writedirstatecCs"t�t��j�}|�d|�dS)Ns1
%s
)r�hex�uuid�uuid4�bytesr�)rrrnr�rrrr"szdirstate._write_tracked_hintcCs2|�|�rdSt�|�D]
}|�|�rdSqdS)NTF)ryrr�)rrnr�rrr�
_dirignores

�zdirstate._dirignorec	Csng}tj�|�d��r|�|�d��|j�d�D]\}}|dks&|�d�r4|�tj�|j	t
�|���q|S)Nrkrzsignoresignore.)r�r�r�r(r�rD�configitemsr�rrAr�
expandpath)rrw�namer�rrrrts�zdirstate._ignorefilescCs�t�|���}t�}|rX|��}tj||jjdd�}|D]4\}}}t�	|d�\}	}
|	dkr7|
|vr6|�
|
�qtj|jdg|g|jjd�}||�rP|||fSq|�
|�|sdS)NT)�
sourceinfosglobs
subincluderqrr)N���rq)�collections�dequertr��popleftru�readpatternfilerDrs�	_patsplitr�r
r>�add)rrnrw�visited�i�patterns�pattern�lineno�line�kindr��mrrr�_ignorefileandline&s,
�
��
�zdirstate._ignorefileandlinec"CsXdd�}|j}|j}tj}tj}tj}tj}	tj}
|j	}g}|j
}
g}|j
}|��s1|jr1|j
}nd}t|���}|��d\}}|t|�kr�|t|�kr�||d}|||kr^|d7}qA|t|�kr{||�|�r{||=|t|�kr{||�|�sk|d7}|t|�kr�|t|�ksM|r�d|vr�dg}d}t�|�}d|d<|D]�}|r�||d	d
�}n|}||vr�q�z<|||��}||j�}||kr�||vr�d||<|
||f�n||	ks�||
kr�|||<n||||��||vr�d||<Wq�t�y!}z%||v�rd||<n|j�|��r||�n	||t�|j��WYd}~q�d}~ww|���rCt|�D]}|dk�s7||v�r9�q+||��sA||=�q+|���r�|j�r�i}t�|�D]'\}}|du�r^�qSt� |�}|�!|�}|du�rtt"�}|||<|�#|��qSt�|�D]&\}}t|�dk�r�|D]} |�$| |d
d|jj%�}!| |!k�r�d|| <�q��q�|||fS)a�Get stat data about the files explicitly specified by match.

        Return a triple (results, dirsfound, dirsnotfound).
        - results is a mapping from filename to stat result. It also contains
          listings mapping subrepos and .hg to None.
        - dirsfound is a list of files found to be directories.
        - dirsnotfound is a list of files that the dirstate thinks are
          directories and that were not found.cSsvtd�}t�|�rtd�}n't�|�rtd�}nt�|�r"td�}nt�|�r,td�}n	t�|�r5td�}td�|S)Nsunknownscharacter devicesblock devicesfifossockets	directorys"unsupported file type (type is %s))r�stat�S_ISCHR�S_ISBLK�S_ISFIFO�S_ISSOCK�S_ISDIR)r�rArrr�badtypeFs








z'dirstate._walkexplicit.<locals>.badtypeN)rrr{rrqr�FT)&�badr]r�r�rD�S_IFMT�S_IFDIR�S_IFREG�S_IFLNKr(r��isexactr�r�r�rw�sortr�r��dict�fromkeys�st_moder�rjr�
strtolocal�strerror�anypats�listrr�rrr�r�r:rr	)"rr
�subreposrJ�badfn�dmapr��getkind�dirkind�regkind�lnkkindr�	dirsfound�foundadd�dirsnotfound�notfoundaddr
rwr<�j�subpath�results�ff�nfr�rArernr��nc�paths�normr�rrrr�
_walkexplicit<s�
��	


�


��

�



�
�
zdirstate._walkexplicitTcs�|r	tj�tj�n|r�j��j�ntj�tj��j�	�����j�
�j�tj�t	j
}tj�tj
�
tj��j�d}}���rEd}tj�n���rKd}|sY�jrY�j��j�d}n�j�d����|�\�}	}
�
r}|	D]}�
|d�qk|
D]}�
|�qv|o�|	p�|
}�fdd�|	D�}	���������	�
���
��fdd�}|	D]\}
}�p�|
|k}||g|�q�|D]}�|=q��d	=|�sB|�sB�s҈r�d
d��D�}n
�	�fdd��D�}|��|�r(tj�jdd�}t|�D]6}��r�|dd��v�rd�|<q�|�|��r!z
|�|���|<Wq�t�y d�|<Yq�wd�|<q�St|�}t��fd
d�|D��D]	}|�t|�<�q8�S)a3
        Walk recursively through the directory tree, finding all files
        matched by match.

        If full is False, maybe skip some known-clean files.

        Return a dict mapping filename to stat-like object (either
        mercurial.osutil.stat instance or return value of os.stat()).

        FTNrcsg|]
}�|d�s|�qS)rr)rmri)�	dirignorerrrosz!dirstate.walk.<locals>.<listcomp>c
s|j}|�r
t�dt|��|��}��|�}|sq|dks"|dkr$d}d}|dkr,d}z!t�d|����|�d|d�}Wd�n1sGwYWn)tyv}z|jtj	tj
fvrq����|�t
�|j��WYd}~q�d}~ww|D]�\}}	}
|r�||vr�qy�r��|r�|d	|p�|dd�}n
|r�|d	|p�|}|�
v�r|	�krƈ|�s��	r��	|�||�|�vrňs��|�r�d�
|<qy|	�ks�|	�kr�|�vr݈s؈|�r�|
�
|<qy�s�|�r�|�s�|s�
|d
d�}|
�
|<qy|�v�r��s�|��rd�
|<qy|sdSdS)Nzdirstate.walk worksthissallrqr�z!dirstate.walk.traverse listdir %sT)rD�skipr{F)r�r�counterr�r��visitchildrenset�logr�rc�EACCESrdrKr�rrUrV)�work�
alreadynormed�wadd�nd�visitentriesrn�entriesrernrAr�rh)r]r[�ignorer�listdirr_r
�matchalways�matchfn�	matchtdirr
�
normalizefiler^rfrrr�traversesv
�����	�
������zdirstate.walk.<locals>.traverser�cSsg|]}|�qSrrrlrrrroTscs g|]}|�vr�|�r|�qSrrrl)r|rfrrroVs )�cachedcsg|]}�|��qSrr)rmr<)rrrro{rp)rrvryr/�alwaysr|�traversedirr]rzr�r�rDrMrNrOr(rP�prefixr�r�rrlrQr�pathauditorr>r��checkr��	statfiles�next)rr
rY�unknown�ignored�fullr��exact�	skipstep3rsrbrirrvrt�s�visit�
audit_pathrh�ivr�r)rmr]r[ryrrzr_r
r{r|r}r
r~r^rfrr�walk�s�

(A�
�
�z
dirstate.walkcCsj|j�dd�}|durtj�dd|�|j�ddd�}|s#dtjd<t�|jj||j	|�
�|jt|�t|�t|�t|j
��	\}}}	}
}}}
}}}}}|j|O_|j
r_|D]}|�
|�qW|jjr�|D]/}t|t�r|\}}td�||f}|j�|�qetd	�}|j�|t�|j	|j	|�d
f�qe|D]
\}}|�|t�|��q�tj||	|
|||
|d�}||fS)NsworkersnumcpussRAYON_NUM_THREADSs%dsenabledT�1s!%s: ignoring invalid syntax '%s'
s*skipping unreadable pattern file '%s': %s
sNo such file or directory)�modifiedr�r��deletedr�r��clean)rD�	configintr�environ�
setdefaultr|�rustmod�statusr]rArtr�r�r�rBrs�
isinstance�tuplerr�	canonpathrKrUr)r�matcher�
list_clean�list_ignored�list_unknown�numcpus�workers_enabled�lookupr�r�r�r�r�r�r��warningsrK�	traversed�dirty�dir�item�	file_path�syntaxr1�fn�messager�rrr�_rust_statuss�
��

�
����
�	zdirstate._rust_statusc*	Cs,|||}}}gggggf\}	}
}}}ggg}}
}|j}|��d}tjtjtjf}tdur4d}n|jr:d}n|r?d}n
tj	rEd}nt
||�sLd}zt�|j
�}Wnty_d}Ynw|r{z|�||||�}||fWStjyzYnwdd�}|j}|j}|	j}|
j}|j}|r�|jn|}|r�|jn|}|j}|
j}|r�|jn|}|j}|j}|j} |j}!|jj}"|p�|jdu}#t�|j|||||#d��D]�\}$}%||$�s�|s�||$�r�||$�r�|r�||$�n||$�q�||$�}&|&j}'|&j}(|%s�|&jr�||$�q�|&j �r||$�q�|&j!�r||$�q�|&j"�r||$�q�|&j�r�|!�s*|&j#�r*||$�q�| �s6|&j$�r6||$�q�|(dk�rT|(|%j%k�rI|(|%j%t&@k�sY|'|%j'Ad@�rT| �sY|$|"v�rpt(�)|%j'��rk|(|%j%k�rk||$�q�||$�q�|&�*t�+|%���s~||$�q�|�r�||$�q�t,�-|
|||
|||�})|	|)|fS)	a|Determine the status of the working copy relative to the
        dirstate and return a pair of (unsure, status), where status is of type
        scmutil.status and:

          unsure:
            files that might have been modified since the dirstate was
            written, but need to be read to be sure (size is the same
            but mtime differs)
          status.modified:
            files that have definitely been modified since the dirstate
            was written (different size or mode)
          status.clean:
            files that have definitely not been modified since the
            dirstate was written
        TNFcSsdSrrrrrr�noop
szdirstate.status.<locals>.noop)r�r�@).r]�preloadru�
alwaysmatcher�exactmatcher�includematcherr�r�r�enabledr�r�
get_fs_nowrr�r��
FallbackErrorr��__getitem__r�r�r/r�r�r�r�rr�r�r�r�r�r�r�r�r�r��st_size�
_rangemaskrTrD�S_ISLNK�mtime_likely_equal_to�mtime_ofrr�)*rr
rYr�r�r��listignored�	listclean�listunknownr�r�r�r�r�r[�use_rust�allowed_matchers�mtime_boundary�resr��	dcontains�dget�ladd�madd�aadd�uadd�iadd�radd�dadd�cadd�mexactrmr�r�r�r�r�r��tr�r�r�rrrr��s��
�����







��



��
zdirstate.statuscs�|j�tdur|jj����r���S���}���r$�fdd�|D�S���r7t�fdd�|D��r7t|�S�fdd��D�S)zT
        return files in the dirstate (in whatever state) filtered by match
        Ncsg|]}|�vr|�qSrrrl�r[rrrom�z$dirstate.matches.<locals>.<listcomp>c3s�|]}|�vVqdSrr)rmr�r�rr�	<genexpr>ns�z#dirstate.matches.<locals>.<genexpr>csg|]}�|�r|�qSrrrl)r
rrrorr�)	r]r�r��keysrwrPr��allrX)rr
rwr)r[r
r�matches_szdirstate.matchescCs|r|jS|jSr)rIrGrrrr�_actualfilenametszdirstate._actualfilenamec	s�����}||ksJ��js�j�|�s!����j|dddd���r;�jd�jf��fdd�ddd��j|dd	��j�|�t	j
�j�|��j�|�dd
�dS)z&Save current dirstate into backup filer�Tr�rcrrrrrrrr�rz%dirstate.savebackup.<locals>.<lambda>rr)r )�hardlinkN)r�rBrr�rr#rG�registertmp�	tryunlinkr�copyfiler)rr�
backupnamer�rrr�
savebackupzs,
��


�zdirstate.savebackupcCsR|��|�|�}|j}t�|�|�|�|��r|�|�dS|j||dd�dS)zRestore dirstate by backup fileT)r�N)r�r�rr�samefilerr%�rename)rrr�r��orrr�
restorebackup�s
zdirstate.restorebackupcCs|j�|�dS)zClear backup fileN)rr%)rrr�rrr�clearbackup�r�zdirstate.clearbackupc
cs��d}d}d}d}|��D]5\}}|j}	|	dvr"||vr"|||	fV|	dvr0||vr0|||	fV|	dvrB||vrB||vrB|||	fVq
|D]}|�|�j}	|	dvrW|||	fVqEd	S)
zEcheck the dirstate content again the parent manifest and yield errorss%%s in state %s, but not in manifest1
s&%s in state %s, but also in manifest1
s+%s in state %s, but not in either manifest
s(%s in manifest1, but listed as state %s
snr�a�msnrmN)r��stater�)
r�m1�m2�missing_from_p1�unexpected_in_p1�missing_from_ps�missing_from_dsrnr�r�rrr�verify�s(����zdirstate.verify)Fr)FFN)FN)FF)T)Nr"r#r$rVrZ�
contextlib�contextmanagerr\r,�
propertycacher]�propertyr^rrfrXrjr'ryr~r�r�r�r(r�rMr�r�r�r�r�r�r�rgr�r�r�r�r�r�r�r�r�r�r9r�r�r�r�r7r�r�r�rrr�r
rrrr�r&r)rr"r/rtrCrlr�r�r�r�r�r�r�r�r�rrrrr]s�
�-









7








'�+



(!
=N()1�
__future__rr5r�rcr�rDr,�i18nrrr�hgdemandimportr�rrr	r
rurrr
rrr�
dirstateutilsr�
interfacesr�intdirstate�
interfaceutil�	importmodr�
importrustr��HAS_FAST_DIRSTATE_V2r��	filecache�	rangemaskr�r�rr'r7r9�implementer�	idirstate�objectrrrr�<module>s44




https://t.me/RX1948 - 2025