403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/__pycache__/dirstate.cpython-39.opt-1.pyc
a

�+�b��@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@seZdZdZdd�ZdS)�	repocachezfilecache for files in .hg/cCs|j�|�S�N)�_opener�join��self�obj�fname�r�8/usr/lib64/python3.9/site-packages/mercurial/dirstate.pyr<szrepocache.joinN��__name__�
__module__�__qualname__�__doc__rrrrrr9src@seZdZdZdd�ZdS)�	rootcachez*filecache for files in the repository rootcCs
|�|�Sr)�_joinrrrrrCszrootcache.joinNrrrrrr$@sr$cs�fdd�}|S)Ncs6|��s d}|�j;}t�|���|g|�Ri|��S)Nz.calling `%s` outside of a parentchange context��pendingparentchanger r	�ProgrammingError�r�args�kwargs�msg��funcrr�wrapHs


z%requires_parents_change.<locals>.wrapr�r.r/rr-r�requires_parents_changeGsr1cs�fdd�}|S)Ncs6|��r d}|�j;}t�|���|g|�Ri|��S)Nz-calling `%s` inside of a parentchange contextr&r)r-rrr/Ss


z(requires_no_parents_change.<locals>.wraprr0rr-r�requires_no_parents_changeRsr2c@s�eZdZd�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��Z2e1d�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Znormasprefix�_rootdir�_dirty�_dirty_tracked_set�_ui�
_filecache�_parentwriters�	_filename�_filename_th�_pendingfilename�_plchangecallbacks�_origplr�_mapcls�_cwd)	r�openerZui�rootZvalidateZ
sparsematchfnZ
nodeconstantsZuse_dirstate_v2Zuse_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�szdirstate.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�r>rKrrr�parentchange�szdirstate.parentchangecCs
|jdkS)zsReturns true if the dirstate is in the middle of a set of changes
        that modify the dirstate parent.
        rrMrKrrrr'�szdirstate.pendingparentchangecCs$|�|j|j|j|j|j�|_|jS)zAReturn the dirstate contents (see documentation for dirstatemap).)rDr<rr7r5r3�_maprKrrrrO�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.
        )r8rKrrr�_sparsematcher�szdirstate._sparsematcher�branchc
CsPz|j�d���pdWStyJ}z|jtjkr4�WYd}~dSd}~00dS)NrQsdefault)r�read�strip�IOError�errno�ENOENT)r�instrrr�_branch�szdirstate._branchcCs
|j��Sr)rO�parentsrKrrrrJ�szdirstate._plcCs|j�|�Sr)rO�
hastrackeddir)r�drrr�hasdir�szdirstate.hasdir�	.hgignorecCs<|��}|st��Sdd�|D�}tj|jdg||jjd�S)NcSsg|]}d|�qS)s
include:%sr��.0�frrr�
<listcomp>��z$dirstate._ignore.<locals>.<listcomp>rb��warn)�_ignorefiles�matchmod�neverr
r7r<rd)r�filesZpatsrrr�_ignore�s
zdirstate._ignorecCs|j�dd�otjdkS)N�uisslash�/)r<�
configboolr�osseprKrrr�_slash�szdirstate._slashcCst�|j�Sr)r�	checklinkr7rKrrr�
_checklink�szdirstate._checklinkcCstt�|j��Sr)�boolr�	checkexecr7rKrrr�
_checkexec�szdirstate._checkexeccCst�|�d��S)N�.hg)rZfscasesensitiver%rKrrr�
_checkcase�szdirstate._checkcasecCs
|j|Sr)r9)rr`rrrr%�szdirstate._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}zt���|��}Wnty0YdS0�jrHt�|�r�dSnD��|�}|jrd|j	r�dSn(�st��
����d|�}d|vr�dS�jr�t�|�r�dSnT|dur���|�}|j
r�|jr�dSn0|dur�sވ�
����d|�}d|vr�dSdS)Nrb�lr�x)�os�lstatr%�OSErrorrprZ
statislink�	get_entry�has_fallback_symlinkZfallback_symlink�appendrsZ
statisexec�has_fallback_execZ
fallback_exec)�x�entryZfallback_value�st��
buildfallbackZ
fallback_funcrrr�	get_flags�sB



z$dirstate.flagfunc.<locals>.get_flagsr)rr�r�rr�r�flagfunc�s
)zdirstate.flagfunccCs|j�dd�}|r|St��S)Nrjsforcecwd)r<Zconfigr�getcwd)rZforcecwdrrrrE(sz
dirstate._cwdcCsP|j}||jkrdS|j}t�|�s.|tj7}|�|�rH|t|�d�S|SdS)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.
        rbN)rEr7rZendswithseprrm�
startswith�len)r�cwdZrootseprrrr�0s



zdirstate.getcwdNcCs4|dur|��}t�|j||�}|jr0t�|�S|Sr)r�r�pathtor7rnZpconvert)rr`r��pathrrrr�Ds
zdirstate.pathtocCs|j�|�}|durt�S|S)z-return a DirstateItem for the associated pathN)rO�get�DirstateItem)rr�r�rrrr{Lszdirstate.get_entrycCs
||jvSr)rO)r�keyrrr�__contains__Sszdirstate.__contains__cCstt|j��Sr)�iter�sortedrOrKrrr�__iter__Vszdirstate.__iter__cCst�|j�Sr)r�	iteritemsrOrKrrr�itemsYszdirstate.itemscs�fdd��jD�S)Ncsg|]}��|��qSr)r6)r_�prKrrra_rbz$dirstate.parents.<locals>.<listcomp>rIrKrrKrrY^szdirstate.parentscCs|�|jd�S)Nr�r6rJrKrrr�p1aszdirstate.p1cCs|�|jd�S)Nrr�rKrrr�p2dszdirstate.p2cCs|jd|jjkS)zTrue if a merge is in progressr)rJr5�nullidrKrrr�in_mergegszdirstate.in_mergecCst�|j�Sr)rZtolocalrXrKrrr�branchlszdirstate.branchcCsn|dur|jj}|jdkr"td��d|_|jd}|jdurD|j|_|jj}||koZ||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)	r5r�r>�
ValueErrorr:rJrCrO�
setparents)rr�r�Zoldp2r�r�rrrr�os	
�

zdirstate.setparentscCsv|jj�|t�|��|jddddd�}z2|�|jd�|��|jd}|rX|�	�Wn|�
��Yn0dS)NrQ�wT�Z
atomictemp�
checkambig�
s_branch)�	__class__rX�setrZ	fromlocalr�write�closer=Zrefresh�discard)rr�r`Zcerrr�	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.)rOrXriFrN)�__dict__rr:r;r>rC)r�arrr�
invalidate�s
zdirstate.invalidatecCs<||krdSd|_|dur(||jj|<n|jj�|d�dS)z=Mark dest as a copy of source. Unmark dest if source is None.NT)r:rO�copymap�pop)r�source�destrrr�copy�sz
dirstate.copycCs|jj�|d�Sr)rOr�r�)r�filerrr�copied�szdirstate.copiedcCs|jjSr)rOr�rKrrr�copies�szdirstate.copiescCsXd|_|j�|�}|dus |js*|�|�|j�|�}|rJ|jj�|d�|rTd|_|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)	r:rOr��tracked�_check_new_tracked_filename�set_trackedr�r�r;)r�filenameZ
reset_copyr�Zpre_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)rO�
set_untrackedr:r;)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)r:rOr�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)r:rO�set_possibly_dirty)rr�rrrr��szdirstate.set_possibly_dirtycCs�|jrd}t�|��|j�|�}|dur.d}n|j}|s`|s`|j�|�durz|j�|�d|_n|sz|rz|durz|jrzdS|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(rOr�r��reset_stater:�added)rr��
p1_trackedr,r��
wc_trackedrrr�update_file_p1�s(
�zdirstate.update_file_p1c	CsRd|_|j�|�}|dur d}n|j}||kr4d|_|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�)r:rOr�r�r;r�)	rr�r�r�r�Zpossibly_dirtyr�Z	old_entryZprev_trackedrrr�update_files�zdirstate.update_filecCs�t�|�|j�|�r6td�}|t�|�;}t�|��t	�
|�D]X}|j�|�rTq�|j�|�}|dur@|js@td�}|t�|�t�|�f;}t�|��q@dS)Ns directory %r already in dirstates#file %r in dirstate clashes with %r)
rZ
checkfilenamerOrZrrZbytestrr	ZAbortr�finddirsr��removed)rr�r,r[r�rrrr�@s

z$dirstate._check_new_tracked_filenamec
Cs�|dur tj�tj�|j|��}|sd|s^d|vr^|�dd�\}}|�|d|d�}|d|}q�|}nbd|vr�|�dd�\}}|�|d|d�}|jd|}	|dt�||	�}nt�||j�}|||<|S)NrkrFT)	rxr��lexistsrr7�rsplit�
_normalizer�fspath)
rr��normed�
ignoremissing�existsZstoremapr[r`�folded�rrrr�
_discoverpathPs zdirstate._discoverpathcCsFt�|�}|jj�|d�}|durB|r,|}n|�|||||jj�}|Sr)r�normcaserO�filefoldmapr�r��rr��isknownr�r�r�r�rrr�_normalizefilejs
�zdirstate._normalizefilecCs^t�|�}|jj�|d�}|dur2|jj�|d�}|durZ|rD|}n|�|||||jj�}|Sr)rr�rOr�r��
dirfoldmapr�r�rrrr�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
        )rur�)rr�r�r�rrr�	normalize�szdirstate.normalizecCs|j��d|_dS)NT)rO�clearr:rKrrrr��s
zdirstate.clearcCs�|dur|}g}|��nZt|�dkrXg}g}|D]"}||vrJ|�|�q2|�|�q2nt|�}|t|�@}||}|jdur�|j|_|j�||jj	�|D](}|j
r�|�|�q�|jj|ddd�q�|D]}|j�|�q�d|_
dS)N�
T)r�r�)r�r�r}r�rCrJrOr�r5r�r�r�r�r:)r�parentZallfilesZchangedfilesZ	to_lookupZto_dropr`Zchangedfilessetrrr�rebuild�s8

�zdirstate.rebuildcCs|jjS)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.
        )rO�identityrKrrrr��szdirstate.identitycs��js
dS�jo�j}�rf�jd�jf��fdd�ddd�|rb�jd�jf��fdd�ddd�dS�fd	d�}|�j��}���|�Wd�n1s�0Y|r�|�j��}���|�Wd�n1s�0YdS)
N�dirstate-1-maincs���|�Sr��_writedirstate�r`�r�trrr�<lambda>�rbz dirstate.write.<locals>.<lambda>�plainT��locationZ
post_finalizesdirstate-2-key-postcs���|�Sr)�_write_tracked_hintr�r�rrr��rbcs�j|dddd�S)Nr�Tr�)rr�rKrrr��rb)r:r4r;�addfilegeneratorr?r@r�r�)rr�Z	write_keyr�r`rr�rr��s4��*zdirstate.writecCs|j�|j�d|_dS)zOremove the tracked_hint file

        To be used by format downgrades operationFN)r�unlinkr@r4rKrrr�delete_tracked_hint�szdirstate.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)rB)r�category�callbackrrr�addparentchangecallback�s	z dirstate.addparentchangecallbackcCsd|jdurF|j|jkrFtt�|j��D]\}}|||j|j�q&d|_|j�||�d|_d|_	dS)NF)
rCrJr�rr�rBrOr�r:r;)rr�r��cr�rrrr�s
�zdirstate._writedirstatecCs"t�t��j�}|�d|�dS)Ns1
%s
)r�hex�uuidZuuid4�bytesr�)rr�r`r�rrrr�szdirstate._write_tracked_hintcCs2|�|�rdSt�|�D]}|�|�rdSqdS)NTF)rirr�)rr`r�rrr�
_dirignores

zdirstate._dirignorec	Csng}tj�|�d��r&|�|�d��|j�d�D]6\}}|dksL|�d�r2|�tj�|j	t
�|���q2|S)Nr]rjsignoresignore.)rxr�r�r%r}r<Zconfigitemsr�rr9rZ
expandpath)rrh�namer�rrrreszdirstate._ignorefilescCs�t�|���}t�}|r�|��}tj||jjdd�}|D]h\}}}t�	|d�\}	}
|	dkrn|
|vr8|�
|
�q8tj|jdg|g|jjd�}||�r8|||fSq8|�
|�qdS)NT)Z
sourceinfosglobs
subincluderbrc)N���rb)�collections�dequerer��popleftrfZreadpatternfiler<rdZ	_patsplitr}r
r7�add)rr`rhZvisited�i�patterns�pattern�lineno�line�kindr��mrrr�_ignorefileandline&s(
�
�zdirstate._ignorefileandlinec"Cs@dd�}|j}|j}tj}tj}tj}tj}	tj}
|j	}g}|j
}
g}|j
}|��sb|jrb|j
}nd}t|���}|��d\}}|t|�kr�|t|�kr�||d}|||kr�|d7}q�|t|�kr�||�|�r�||=q�|d7}q�|r�d|vr�dg}d}t�|�}d|d<|D�]}|�r.||d	d
�}n|}||v�r@�qz�|||��}||j�}||k�r�||v�rtd||<|
||f�n>||	k�s�||
k�r�|||<n ||||��||v�r�d||<Wndt�y&}zJ||v�r�d||<n*|j�|��r||�n||t�|j��WYd}~n
d}~00�q|���rnt|�D].}|dk�s>||v�rZ�q>||��s>||=�q>|���r6|j�r6i}t�|�D]N\}}|du�r��q�t� |�}|�!|�}|du�r�t"�}|||<|�#|��q�t�|�D]L\}}t|�dk�r�|D].} |�$| |d
d|jj%�}!| |!k�rd|| <�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�}nNt�|�r0td�}n:t�|�rDtd�}n&t�|�rXtd�}nt�|�rjtd�}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�rrrr�badtypeFs








z'dirstate._walkexplicit.<locals>.badtypeN)rrrkrrbrtFT)&�badrOrxryr�S_IFMT�S_IFDIR�S_IFREG�S_IFLNKr%r}�isexactrur�r�rh�sortr�r��dict�fromkeys�st_moderzr\r�
strtolocal�strerrorZanypats�listrr�rr�r�r�r�r�r�)"rr
�subreposr
Zbadfn�dmapryZgetkind�dirkind�regkind�lnkkindrZ	dirsfoundZfoundadd�dirsnotfoundZnotfoundaddr�rhr��jZsubpath�resultsZff�nfr�rrWr`r�Znc�pathsZnormr�r�rrr�
_walkexplicit<s�












,






�
zdirstate._walkexplicitTcs�|rtj�tj�n|r$�j��j�ntj�tj��j�	�����j�
�j�tj�t	j
}tj�tj
�
tj��j�d}}���r�d}tj�n���r�d}|s��jr��j��j�d}n
�j�d����|�\�}	}
�
r�|	D]}�
|d�q�|
D]}�
|�q�|�o
|	�p|
}�fdd�|	D�}	���������	�
���
��fdd�}|	D]&\}
}��p`|
|k}||g|��qJ|D]}�|=�qv�d	=|�s�|�s���s���r�d
d��D�}n�	�fdd��D�}|��|�r`tj�jdd�}t|�D]p}��r�|dd��v�rd�|<nH|�|��rRz|�|���|<Wnt�yNd�|<Yn0nd�|<�q�n4t|�}t��fd
d�|D��D]}|�t|�<�q��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)r_r[)�	dirignorerrrarbz!dirstate.walk.<locals>.<listcomp>c
sF|j}|�rBt�dt|��|��}��|�}|s4q|dksD|dkrHd}d}|dkrXd}zBt�d|��"��|�d|d�}Wd�n1s�0YWn^ty�}zF|jtj	tj
fvr����|�t
�|j��WYd}~q�WYd}~n
d}~00|D�]>\}}	}
|�r||v�rq���rD�|�r8|d	|�p:|dd�}n|�rX|d	|�pZ|}|�
vr�|	�k�r��|��s��	�r��	|�||�|�v�r>��s��|��r>d�
|<q�|	�k�s�|	�k�r |�v�r��s�|��r|
�
|<n4��s��|��r>�|��s>|�s�
|d
d�}|
�
|<q�|�vr���s6�|�r�d�
|<q�qdS)Nzdirstate.walk worksthissallrbrtz!dirstate.walk.traverse listdir %sT)r�skiprkF)r}rZcounterr�r�Zvisitchildrenset�logrzrUZEACCESrVrr�rrr)�work�
alreadynormedZwadd�ndZvisitentriesr$�entriesrWr`rr�r )rr�ignorer�listdirrr
�matchalways�matchfn�	matchtdirr��
normalizefilerrrrr�traversesd
4�	�




�
zdirstate.walk.<locals>.traversertcSsg|]}|�qSrrr^rrrraTrbcs g|]}|�vr�|�r|�qSrrr^)r-rrrraVrb)�cachedcsg|]}�|��qSrr)r_r�)rrrra{rb)rrgrir��alwaysr-�traversedirrOr+rxryrr
rrr%r�prefixrur�r�r"rrZpathauditorr7r��checkrzZ	statfiles�next)rr
r�unknown�ignored�fullry�exactZ	skipstep3r&rr[r0r(r'�sZvisitZ
audit_pathr Zivr�r)r#rrr*rr+rr
r,r-r.r�r/rrrr�walk�s�

(A
��
z
dirstate.walkcCsp|j�dd�}|dur(tj�dd|�|j�ddd�}|sFdtjd<t�|jj||j	|�
�|jt|�t|�t|�t|j
��	\}}}	}
}}}
}}}}}|j|O_|j
r�|D]}|�
|�q�|jj�r.|D]`}t|t��r|\}}td�||f}|j�|�q�td	�}|j�|t�|j	|j	|�d
f�q�|D]\}}|�|t�|���q2tj||	|
|||
|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��deletedr7r8�clean)r<Z	configintr�environ�
setdefaultrl�rustmod�statusrOr9rersrqr3r:rd�
isinstance�tuplerrZ	canonpathrrr)rZmatcherZ
list_cleanZlist_ignoredZlist_unknownZnumcpusZworkers_enabled�lookupr>r�r�r?r@r8r7�warningsrZ	traversedZdirty�dir�itemZ	file_pathZsyntaxr,�fn�messagerDrrr�_rust_statuss�
��

�
����
�	zdirstate._rust_statusc*	CsJ|||}}}gggggf\}	}
}}}ggg}}
}|j}|��d}tjtjtjf}tdurhd}n0|jrtd}n$|r~d}ntj	r�d}nt
||�s�d}zt�|j
�}Wnty�d}Yn0|r�z|�||||�}||fWStjy�Yn0dd�}|j}|j}|	j}|
j}|j}|�r(|jn|}|�r8|jn|}|j}|
j}|�rT|jn|}|j}|j}|j} |j}!|jj}"|�p�|jdu}#t�|j|||||#d��D�]�\}$}%||$��s�|�s�||$��r�||$��r�|�r�||$�n||$��q�||$�}&|&j}'|&j}(|%�s|&j�r||$��q�|&j �r,||$�n�|&j!�r>||$�n�|&j"�rP||$�n�|&j�r�|!�sp|&j#�rp||$�n�| �s�|&j$�r�||$�n�|(dk�r�|(|%j%k�r�|(|%j%t&@k�s�|'|%j'Ad@�r�| �s�|$|"v�r�t(�)|%j'��r�|(|%j%k�r�||$�n||$�n*|&�*t�+|%���s||$�n|�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
        TNFcSsdSrrr�rrr�noop
szdirstate.status.<locals>.noop)r9r�@).rOZpreloadrfZ
alwaysmatcherZexactmatcherZincludematcherrCrurZenabledrErZ
get_fs_nowrrzrMZ
FallbackErrorr��__getitem__r}r:r�rsrpr�r3rr�r<r�r�r�r�r�r�r|r~�st_size�
_rangemaskrr�S_ISLNKZmtime_likely_equal_toZmtime_ofrrD)*rr
rr8r@r7ZlistignoredZ	listcleanZlistunknownrGr>r�r�r?rZuse_rustZallowed_matchersZmtime_boundary�resrNZ	dcontainsZdgetZladdZmaddZaaddZuadd�iaddZraddZdaddZcaddZmexactr#rrror�r9rKr��tr�r�rDrrrrD�s��

��






������


�zdirstate.statuscs�|j�tdur|jj����r&���S���}���rH�fdd�|D�S���rnt�fdd�|D��rnt|�S�fdd��D�S)zT
        return files in the dirstate (in whatever state) filtered by match
        Ncsg|]}|�vr|�qSrrr^�rrrramrbz$dirstate.matches.<locals>.<listcomp>c3s|]}|�vVqdSrr)r_rKrWrr�	<genexpr>nrbz#dirstate.matches.<locals>.<genexpr>csg|]}�|�r|�qSrrr^)r
rrrarrb)	rOrCr2�keysrhrr4�allr)rr
rhr)rr
r�matches_szdirstate.matchescCs|r
|jS|jSdSr)rAr?r�rrr�_actualfilenametszdirstate._actualfilenamec	s�����}�js�j�|�s6����j|dddd���rj�jd�jf��fdd�ddd��j|dd	��j�|�t	j
�j�|��j�|�dd
�dS)z&Save current dirstate into backup filer�Tr�r�cs���|�Srr�r�r�rrr��rbz%dirstate.savebackup.<locals>.<lambda>r�r�)r�)ZhardlinkN)r\r:rr�r�r�r?ZregistertmpZ	tryunlinkr�copyfiler)rr��
backupnamer�rr�r�
savebackupzs*
��

�zdirstate.savebackupcCsP|��|�|�}|j}t�|�|�|�|��r<|�|�n|j||dd�dS)zRestore dirstate by backup fileT)r�N)r�r\rr�samefilerr��rename)rr�r^r��orrr�
restorebackup�s
zdirstate.restorebackupcCs|j�|�dS)zClear backup fileN)rr�)rr�r^rrr�clearbackup�szdirstate.clearbackupc
cs�d}d}d}d}|��D]j\}}|j}	|	dvrB||vrB|||	fV|	dvr^||vr^|||	fV|	dvr||vr||vr|||	fVq|D]$}|�|�j}	|	dvr�|||	fVq�d	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{)
rZm1Zm2Zmissing_from_p1Zunexpected_in_p1Zmissing_from_psZmissing_from_dsr`r�rgrrr�verify�s zdirstate.verify)F)N)N)F)FFN)FN)FN)FF)N)T)Nr r!r"rHrL�
contextlib�contextmanagerrNr'�
propertycacherO�propertyrPrrXrJr\r$rirnrprsrur%r�rEr�r�r{r�r�r�r�rYr�r�r�r�r�r�r�r�r�r�r2r�r�r�r�r1r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rerr"r<rMrDr[r\r_rcrdrhrrrrr]s��
-









7








'�+



(!
=N()1Z
__future__rr�rirUrxrr�Zi18nrrrZhgdemandimportr�rrr	r
rfrrr
rrrZ
dirstateutilsrZ
interfacesrZintdirstateZ
interfaceutilZ	importmodrZ
importrustrCZHAS_FAST_DIRSTATE_V2rkZ	filecacheZ	rangemaskrRr�rr$r1r2ZimplementerZ	idirstate�objectrrrr�<module>s24




Youez - 2016 - github.com/yon3zu
LinuXploit