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__/dirstatemap.cpython-39.opt-1.pyc
a

�+�b_�@s�ddlmZddlZddlmZddlmZmZmZm	Z	m
Z
mZddlm
ZmZe�d�Ze�d�ZejZedurzejZnejZd	ZGd
d�de�ZGdd
�d
e�Zedur�Gdd
�d
e�ZdS)�)�absolute_importN�)�_)�error�pathutil�policy�pycompat�txnutil�util)�docket�v2�parsersZdirstatei���c@s�eZdZdZdZdZdd�Zdd�Zd2dd�Zd	d
�Z	dd�Z
d
d�Zdd�Zd3dd�Z
d4dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd5d%d&�Zd'd(�Zd6d*d+�Zed,d-��Zd.d/�Zd0d1�ZdS)7�_dirstatemapcommonz�
    Methods that are identical for both implementations of the dirstatemap
    class, with and without Rust extensions enabled.
    NcCsF||_||_||_||_||_d|_d|_d|_d|_d|_	d|_
dS)Nsdirstate�F)�_use_dirstate_v2�_nodeconstantsZ_ui�_opener�_root�	_filename�_nodelen�_parents�
_dirtyparents�_docket�_pendingmode)�selfZui�opener�rootZ
nodeconstantsZuse_dirstate_v2�r�;/usr/lib64/python3.9/site-packages/mercurial/dirstatemap.py�__init__2sz_dirstatemapcommon.__init__cCs
|jdS)z5Loads the underlying data, if it's not already loadedN��_map�rrrr�preloadAsz_dirstatemapcommon.preloadcCs|j�||�S�N)r!�get)r�key�defaultrrrr%Esz_dirstatemapcommon.getcCs
t|j�Sr$)�lenr!r"rrr�__len__Hsz_dirstatemapcommon.__len__cCs
t|j�Sr$��iterr!r"rrr�__iter__Ksz_dirstatemapcommon.__iter__cCs
||jvSr$r )rr&rrr�__contains__Nsz_dirstatemapcommon.__contains__cCs
|j|Sr$r )r�itemrrr�__getitem__Qsz_dirstatemapcommon.__getitem__cCsdS)z�incremente the dirstate counter if applicable

        This might be a no-op for some subclass who deal with directory
        tracking in a different way.
        Nr�r�filename�	old_entryrrr�
_dirs_incrYsz_dirstatemapcommon._dirs_incrFcCsdS)z�decremente the dirstate counter if applicable

        This might be a no-op for some subclass who deal with directory
        tracking in a different way.
        Nr)rr1r2�remove_variantrrr�
_dirs_decr`sz_dirstatemapcommon._dirs_decrcCsdS)z record updated state of an entryNr�r�f�entryrrr�_refresh_entrygsz!_dirstatemapcommon._refresh_entrycCsdS)z�add a new dirstate entry (or replace an unrelated one)

        The fact it is actually new is the responsability of the caller
        Nrr6rrr�
_insert_entryjsz _dirstatemapcommon._insert_entrycCsdS)z�remove any entry for file f

        This should also drop associated copy information

        The fact we actually need to drop it is the responsability of the callerNr�rr7rrr�_drop_entrypsz_dirstatemapcommon._drop_entrycCs ||}|��|�||�dS)z<record that the current state of the file on disk is unknownN)�set_possibly_dirtyr9)rr1r8rrrr=ysz%_dirstatemapcommon.set_possibly_dirtycCs<||}|t@}|�|||�|�||�|j�|d�dS)z$mark a file as back to a clean stateN)�	rangemask�	set_cleanr9�copymap�pop)rr1�mode�size�mtimer8rrrr?s
z_dirstatemapcommon.set_cleancCs�d}|�|�}|dur<|�|�tdd�}|�||�d}n@|jsh|�||�|��|�||�d}n|��|�||�|S)NFT)�
wc_tracked)r%r3�DirstateItemr:Ztracked�set_trackedr9r=)rr1�newr8rrrrG�s"

�z_dirstatemapcommon.set_trackedcCsZ|�|�}|durdS|j|||jd�|js>|j�|d�|��|�||�dSdS)z4Mark a file as no longer tracked in the dirstate mapNF)r2r4T)r%r5Zadded�p2_infor@rA�
set_untrackedr9r6rrrrJ�s
z _dirstatemapcommon.set_untrackedTc
Cs||j�|d�|sB|sB|sB|j�|�}|�|�|j||d�dS|j�|�}|�||�t|||||d�}	|�||	�dS)ahSet a entry to a given state, diregarding all previous state

        This is to be used by the part of the dirstate API dedicated to
        adjusting the dirstate after a update/merge.

        note: calling this might result to no entry existing at all if the
        dirstate map does not see any point at having one for this file
        anymore.
        N)r2)rE�
p1_trackedrI�has_meaningful_mtime�parentfiledata)	r@rAr!r%r<r5r3rFr:)
rr1rErKrIrLZhas_meaningful_datarMr2r8rrr�reset_state�s 
�z_dirstatemapcommon.reset_statecCsLt�|j|j|j�\}}|jdurB|j|krB|��t�t	d���||_|S)Ns1working directory state may be changed parallelly)
r	Z
trypendingrrrr�closer�Abortr)r�fprBrrr�_opendirstatefile�s�z$_dirstatemapcommon._opendirstatefile���c
Csrz8|���}|�|�Wd�WS1s,0YWn4tyl}z|jtjkrV�WYd}~dSd}~00dS)N�)rR�read�IOError�errno�ENOENT)rrCrQ�errrrr�_readdirstatefile�s
.z$_dirstatemapcommon._readdirstatefilecCs2|js,|jst�d��tj�|��|j�|_|jS)Ns'dirstate only has a docket in v2 format)	rrrZProgrammingError�	docketmod�DirstateDocket�parserZrr"rrrr�s�
�z_dirstatemapcommon.docketc	s��j}tj����t|�|�}|���|r6|��d��j�	�|�|�	|�
��|��|jr�|���d��fdd�	}|r�d|j}|�
||�n|�|�_dS)Nrcs�j���Sr$)r�unlink)Z_tr��
data_filenamerrr�<lambda>rTz7_dirstatemapcommon.write_v2_no_append.<locals>.<lambda>sdirstate-v2-clean-)N)rr[r\Z
with_new_uuid�parentsr(r`�addr�write�	serializerO�uuidZaddpostcloser)	r�tr�st�meta�packedZ
old_docketZ
new_docketr^�categoryrr_r�write_v2_no_append�s$�
z%_dirstatemapcommon.write_v2_no_appendcCs�|js�|jr|jj|_nt|jd}|�|�}t|�}||krb|d|j�||jd|j�f|_n*|dkr~|jj|jjf|_nt	�
td���|jS)N�rs(working directory state appears damaged!)rrrrbrrZr(r�nullidrrPr)rZread_lenrh�lrrrrbs$

���z_dirstatemapcommon.parents)N)N)NF)FFFTTN)rS)�__name__�
__module__�__qualname__�__doc__r!r@rr#r%r)r,r-r/r3r5r9r:r<r=r?rGrJrNrRrZ�propertyrrlrbrrrrr's@


	�
*



rc@s�eZdZdZedd��Zedd��Zdd�Zdd	�ZeZ	d
d�Z
dd
�Zd.dd�Zdd�Z
dd�Zedd��Zd/dd�Zd0dd�Zedd��Zedd��Zd d!�Zd"d#�Zed$d%��Zed&d'��Zd(d)�Zd*d+�Zd,d-�ZdS)1�dirstatemapa�Map encapsulating the dirstate's contents.

    The dirstate contains the following state:

    - `identity` is the identity of the dirstate file, which can be used to
      detect when changes have occurred to the dirstate file.

    - `parents` is a pair containing the parents of the working copy. The
      parents are updated by calling `setparents`.

    - the state map maps filenames to tuples of (state, mode, size, mtime),
      where state is a single character representing 'normal', 'added',
      'removed', or 'merged'. It is read by treating the dirstate as a
      dict.  File state is updated by calling various methods (see each
      documentation for details):

      - `reset_state`,
      - `set_tracked`
      - `set_untracked`
      - `set_clean`
      - `set_possibly_dirty`

    - `copymap` maps destination filenames to their source filename.

    The dirstate also provides the following views onto the state:

    - `filefoldmap` is a dict mapping normalized filenames to the denormalized
      form that they appear as in the dirstate.

    - `dirfoldmap` is a dict mapping normalized directory names to the
      denormalized form that they appear as in the dirstate.
    cCsi|_|��|jSr$)r!rUr"rrrr!Ps�dirstatemap._mapcCsi|_|j|jSr$)r@r!r"rrrr@Vs�dirstatemap.copymapcCs\|j��|j��|�|jj|jj�t�|d�t�|d�t�|d�t�|d�dS)N�_dirs�_alldirssfilefoldmap�
dirfoldmap)r!�clearr@�
setparentsrrnr
�clearcachedpropertyr"rrrr{\s

�dirstatemap.clearcCst�|j�Sr$)r�	iteritemsr!r"rrr�itemses�dirstatemap.itemsccs.|��D] \}}||j|j|j|jfVqdS)z�
        Return an iterator of (filename, state, mode, size, mtime) tuples

        `all` is unused when Rust is not enabled
        N)r��staterBrCrD)r�allr1r.rrr�
debug_iterks�dirstatemap.debug_itercCs
|j��Sr$)r!�keysr"rrrr�ts�dirstatemap.keysFcCsZ||f|_d|_i}|rVt�|j�D]0\}}|jr$|j�|d�}|rL|||<|��q$|S)NT)	rrrrr!rIr@rA�drop_merge_data)r�p1�p2�fold_p2�copiesr7�s�sourcerrrr|ys

�dirstatemap.setparentscCs�tj�|j�|j��|_|jr>|jj	s*dS|j�
|j���}n|��}|sNdSt�
td�rnt�t|�d�|_|jr�|jj}|jj}t�tj�}||j|j||�nt�tj�}||j|j|�}|js�|j|�|jj|_|jj|_|jj|_dS)Nsdict_new_presized�G)r
�filestat�frompathr�joinr�identityrrrfrUr`rZZsafehasattrr
Zdict_new_presizedr(r!rb�
tree_metadataZnogcr�parse_dirstater@rr|r-r/r%)rrh�prir�rrrrU�s0�


zdirstatemap.readcCs^|jr,t�|j|j�\}}|�||||�n(t�|j|j|���}|�|�|�	�d|_
dS)NF)rrZ
pack_dirstater!r@rlr
rbrdrOr)rrgrhrjrirrrrd�s�
�dirstatemap.writecCs|j|jSr$�r!r�r"rrrr��s�dirstatemap.identityNcCsF|dus|jr$d|jvr$|j�|�|durBd|jvrB|j�|�dS)z-incremente the dirstate counter if applicableN�_dirs�_alldirs)�removed�__dict__r��addpathr�r0rrrr3�s���zdirstatemap._dirs_incrcCs�|dur@d|jvr$|js$|j�|�d|jvrZ|sZ|j�|�n|rZd|jvrZ|j�|�d|jvr|t�|�}|j�	|d�dS)z-decremente the dirstate counter if applicableNr�r��filefoldmap)
r�r�r�Zdelpathr�r�r
�normcaser�rA)rr1r2r4�normedrrrr5�s

zdirstatemap._dirs_decrcCsnz
tj}WntyYn0||jtjtj�Si}tj}t�	|j�D]\}}|j
sF||||�<qFd|d<|S)zeReturns a dictionary mapping normalized case paths to their
        non-normalized versions.
        �.)r
Zmake_file_foldmap�AttributeErrorr!r
ZnormcasespecZnormcasefallbackr�rrr�)rZmakefilefoldmapr7r��namer�rrrr��s
��dirstatemap.filefoldmapcCs&i}tj}|jD]}||||�<q|Sr$)r
r�r��rr7r�r�rrr�
dirfoldmap�s

�dirstatemap.dirfoldmapcCs
||jvS)zo
        Returns True if the dirstate contains a tracked (not removed) file
        in this directory.
        )r��r�drrr�
hastrackeddirs�dirstatemap.hastrackeddircCs
||jvS)zn
        Returns True if the dirstate contains a file (tracked or removed)
        in this directory.
        )r�r�rrr�hasdirs�dirstatemap.hasdircCstj|jdd�S)NT)Zonly_tracked�r�dirsr!r"rrrr�szdirstatemap._dirscCst�|j�Sr$r�r"rrrr�szdirstatemap._alldirscCs|js|j�|d�dSr$)�any_trackedr!rAr6rrrr9s�dirstatemap._refresh_entrycCs||j|<dSr$r r6rrrr:#s�dirstatemap._insert_entrycCs |j�|d�|j�|d�dSr$)r!rAr@r;rrrr<&s�dirstatemap._drop_entry)F)N)NF)rprqrrrs�
propertycacher!r@r{r�rr�r�r|rUrdr�r3r5r�r�r�r�r�r�r9r:r<rrrrru,s<#

		
6

	





ruc@s�eZdZedd��Zedd��Zdd�Zdd�Zd	d
�Z	e	Z
dd�Zd%dd�Zedd��Z
dd�Zedd��Zdd�Zdd�Zedd��Zdd�Zdd�Zd d!�Zd"d#�Zd$S)&rucCs�tj�|j�|j��|_|jrb|jj	r:|j�
|j���}nd}tj
�||jj|jj�|_|jj}ntj
�|���\|_}|r�|js�|j|�|jj|_|jj|_|jj|_|jS)z<
            Fills the Dirstatemap when called.
            rT)r
r�r�rr�rr�rrrfrUr`�rustmodZDirstateMapZnew_v2�	data_sizer�r!rbZnew_v1rZrr|r-r/r%)r�datarbrrrr!1s(��
�





rvcCs
|j��Sr$)r!r@r"rrrr@RsrwcCs|j�|�S)z�
            Return an iterator of (filename, state, mode, size, mtime) tuples

            `all`: also include with `state == b' '` dirstate tree nodes that
            don't have an associated `DirstateItem`.

            )r!r�)rr�rrrr�Vsr�cCsF|j��|�|jj|jj�t�|d�t�|d�t�|d�dS)Nrxryrz)r!r{r|rrnr
r}r"rrrr{`s
�r~cCs
|j��Sr$)r!r�r"rrrr�isr�cCs
t|j�Sr$r*r"rrrr�osr�Fc
Csx||f|_d|_i}|rtdd�|j��D�}|j}|D]<}|�|�}|j�|d�}	|	r^|	||<|��|�||�q6|S)NTcSsg|]\}}|jr|�qSr)rI)�.0r7r�rrr�
<listcomp>~sz*dirstatemap.setparents.<locals>.<listcomp>)	rrr!r�r%r@rAr��set_dirstate_item)
rr�r�r�r�Zfiles_with_p2_infoZrust_mapr7�er�rrrr|ts 
�
r�cCs|j|jSr$r�r"rrrr��sr�c
Cs*|js<|��\}}|j�||�}|�|�|��d|_dS|jjdu}|j�	|�\}}}|�r|j}	|	�
�}
|r�|�|
|	j�|�
|
d��.}|�|	j�|�|�}|dur�Wd�n1s�0Y|	jt|�7_|��|	_||	_|�|	���|��n|�||||�t�|d�d|_dS)NFsr+bs_map)rrbr!Zwrite_v1rdrOrrrfZwrite_v2r`rcr�r�seekr(r�rerlr
r})
rrgrhr�r�rjZ
can_appendri�appendrr`rQZwrittenrrrrd�s6



r�cCs
|j��S)zmReturns a dictionary mapping normalized case paths to their
            non-normalized versions.
            )r!Zfilefoldmapasdictr"rrrr��sr�cCs|j�|�Sr$)r!r�r�rrrr��sr�cCs|j�|�Sr$)r!r�r�rrrr��sr�cCs*i}tj}|j��D]}||||�<q|Sr$)r
r�r!Ztracked_dirsr�rrrr��s
r�cCs&|js|j�|�n|j�||�dSr$)r�r!�drop_item_and_copy_source�addfiler6rrrr9�sr�cCs|j�||�dSr$)r!r�r6rrrr:�sr�cCs|j�|�dSr$)r!r�r;rrrr<�sr�cCs|j�||�dSr$)r!r�)rr&�valuerrr�__setitem__�szdirstatemap.__setitem__N)F)rprqrrr�r!rtr@r�r{r�rr�r|r�rdr�r�r�r�r9r:r<r�rrrrru-s.
 

	

%

	)Z
__future__rrWZi18nr�rrrrr	r
Z
dirstateutilsrr[rZ	importmodr
Z
importrustr�r�rFr>�objectrrurrrr�<module>s& 	



Youez - 2016 - github.com/yon3zu
LinuXploit