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

�+�b_.�@sTddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZddlmZmZmZm
Z
mZmZmZddlmZejZd	Zd
Zdd�Zd
gddgddgdgddgd�Zdd�Zdd�Z ddd�Z!dd�Z"Gdd�de#�Z$Gdd �d e#�Z%Gd!d"�d"e#�Z&e&e$d#d$�d%d$�d&d$�d'd$�e%d(�Z'd.d,d-�Z(dS)/�)�absolute_importN�)�_��nullrev)�open)�error�	formatter�match�pycompat�scmutil�util�vfs)�
stringutili�i�cCs�|rt�|�}nXt|t�s"td��tj�|�}|��}t	�
|g�D]$}|�|�rB|dt|��}qhqBtj�t�
|��}t�|�}|�d�s�|d7}|�d�r�|dd�}|�d�s�tj�|�s�d|vr�t�td���|S)	zWchoose prefix to use for names in archive.  make sure prefix is
    safe for consumers.s dest must be string if no prefixN�/s./�s../s/../s*archive prefix contains illegal components)r
�normpath�
isinstance�bytes�
ValueError�os�path�basename�lower�exts�get�endswith�lenZ	localpathZpconvert�
startswith�isabsr�Abortr)�dest�kind�prefixrZsfxZlpfx�r$�8/usr/lib64/python3.9/site-packages/mercurial/archival.py�
tidyprefix)s&




r&s.tars.tbz2s.tar.bz2s.tgzs.tar.gzs.zips.txzs.tar.xz)�tar�tbz2�tgz�zip�txzcs6t�t�D]&\}}t�fdd�|D��r
|Sq
dS)Nc3s|]}��|�VqdS�N)r)�.0�ext�r!r$r%�	<genexpr>P�zguesskind.<locals>.<genexpr>)rZ	iteritemsr�any)r!r"�
extensionsr$r/r%�	guesskindNs
r4cCs|D]}||S|tSr,r)�repo�revr$r$r%�_rootctxUsr7sy
repo: {root}
node: {ifcontains(rev, revset("wdir()"), "{p1node}{dirty}", "{node}")}
branch: {branch|utf8}
{ifeq(latesttagdistance, 0, join(latesttag % "tag: {tag}", "\n"),
      separate("\n",
               join(latesttag % "latesttag: {tag}", "\n"),
               "latesttagdistance: {latesttagdistance}",
               "changessincelatesttag: {changessincelatesttag}"))}
cCs�|��}d|j�ddt�i}t��}t�|j|d|�}|��|j|d�|j	t
|���d�|��dur�d}|j
d	d
�r~d}|j	|d�|��|��S)
z!build content of .hg_archival.txtstemplatesexperimentalsarchivemetatemplatesarchive��ctx)�rootNr1T)�missing�+)�dirty)r5�uiZconfig�_defaultmetatemplater
�stringior	Z	startitem�context�datar7�hexr6r=�end�getvalue)r9r5Zopts�outZfmr=r$r$r%�
buildmetadatams"��rGc@sJeZdZdZejrejZnGdd�dej�Zddd�Z	dd�Z
d	d
�ZdS)
�taritzawrite archive to tar file or stream.  can write uncompressed,
    or compress with gzip or bzip2.c@seZdZdd�Zdd�ZdS)ztarit.GzipFileWithTimecOsNd}d|vr|�d�}|dur*t��|_n||_tjj|g|�Ri|��dS)N�mtime)�pop�time�	timestamp�gzip�GzipFile�__init__)�self�args�kwrLr$r$r%rO�s
ztarit.GzipFileWithTime.__init__cCs�|j�d�|j�d�|j}|r8|�d�r8|dd�}d}|rFtj}|j�t�|��t�|jt	|j
��|j�d�|j�d�|r�|j�|d�dS)	Ns��s.gz���r����)�fileobj�write�namerrMZFNAMErZbytechrZwrite32u�intrL)rP�fname�flagsr$r$r%�_write_gzip_header�s �z)tarit.GzipFileWithTime._write_gzip_headerN)�__name__�
__module__�__qualname__rOr^r$r$r$r%�GzipFileWithTime�s
rbr1csJ��_d�_d���fdd�	}t|t�r8|d|d��_n|d|d��_dS)	Nr1c
s��dkrb|dd�}|s&t||d�}�j|t�|d�tj|�d�}|�_tj�	|t�|�|�Szt�|t�|��|�WStj
y�}zt�t
�|���WYd}~n
d}~00dS)N�gzrr�b)rI)rrbrZsysstr�zlib�Z_BEST_COMPRESSIONrX�tarfileZTarFile�taropenZCompressionErrorrr rZforcebytestr)�moderZrXZ	gzfileobj�e�r"rIrPr$r%rh�s,����ztarit.__init__.<locals>.taropensw:)rZsw|)rX)r1N)rIrXrr�z)rPr!rIr"rhr$rkr%rO�s
ztarit.__init__cCspt�|�}t�|�}|j|_t|�|_|rPtj|_d|_	t�|�|_
d}d|_n||_	t|�}|j�
||�dS)N�r)r�fsdecodergZTarInforIr�sizeZSYMTYPE�typeriZlinknamer@rl�addfile)rPrZri�islinkrB�ir$r$r%rq�s


z
tarit.addfilecCs|j��|jr|j��dSr,)rl�closerX�rPr$r$r%�done�s
z
tarit.doneN)r1)r_r`ra�__doc__r�ispy3rMrNrbrOrqrvr$r$r$r%rH�s
#rHc@s*eZdZdZd
dd�Zdd�Zdd�Zd	S)�zipitz]write archive to zip file or stream.  can write uncompressed,
    or compressed with deflate.TcCs^t|t�rt�|�}t�|d|r&tjp*tj�|_d}||kr@|}||_	t
�|�dd�|_dS)N�wi���)
rrrrn�zipfile�ZipFile�ZIP_DEFLATEDZ
ZIP_STOREDrlrIrK�gmtime�	date_time)rPr!rI�compressZepochr$r$r%rO�s

�zzipit.__init__c
Csvt�t�|�|j�}|jj|_d|_t	}|r4d}t
}||Bd>|_|jt
�ddddt|j��7_|j�||�dS)N�rm�s<hhBliUT�r)r|ZZipInforrnr�rl�compressionZ
compress_typeZ
create_system�
_UNX_IFREG�
_UNX_IFLNKZ
external_attrZextra�struct�packr[rIZwritestr)rPrZrirrrBrsZftyper$r$r%rq�s 

�z
zipit.addfilecCs|j��dSr,)rlrtrur$r$r%rvsz
zipit.doneN)T�r_r`rarwrOrqrvr$r$r$r%ry�s
ryc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�fileitz$write archive as files in directory.cCs||_t�|j�|_||_dSr,)�basedir�vfsmodr�openerrI)rPrZrIr$r$r%rOszfileit.__init__cCsv|r|j�||�dS|j|ddd�}|�|�|��tj�|j|�}t�||�|j	durrt�
||j	|j	f�dS)N�wF)Z
atomictemp)r��symlinkrYrtrr�joinr��chmodrI�utime)rPrZrirrrB�fZdestfiler$r$r%rqs

zfileit.addfilecCsdSr,r$rur$r$r%rv)szfileit.doneNr�r$r$r$r%r�sr�cCst||d�S)Nsbz2�rH�rZrIr$r$r%�<lambda>0r1r�cCst||d�S)Nrcr�r�r$r$r%r�1r1cCst||d�S)Nsxzr�r�r$r$r%r�2r1cCst||d�S)NF)ryr�r$r$r%r�3r1)�filesr'r(r)r+suzipr*Tr1Fc	s�|dkrtjst�td���|dkr8�rDt�td���nt||�������fdd�}	|tvrpt�td�|���|�t|||p����d��|s�t�	��}�j
�d	d
�r�d}
||
�r�|	|
dd
�fdd��t��
��|��}t|�}|�r�|��t�����t��|�fg��j
jtd�td�|d�}
|
�d�|D]D}��|�}|	|d|v�r`d�pbdd|v�|j�|
j|d��q>|
��|�r�t�j�D]<}��|�}t�||�}�|d}||��||��7}�q�|dk�r�t�td����� �|S)acreate archive of repo as it was at node.

    dest can be name of directory, name of archive file, or file
    object to write archive to.

    kind is type of archive to create.

    decode tells whether to put files through decode filters from
    hgrc.

    match is a matcher to filter names of files to write to archive.

    prefix is name of path to put before every archive member.

    mtime is the modified time, in seconds, or None to use the changeset time.

    subrepos tells whether to include subrepos.
    r+s,xz compression is only available in Python 3r�s*cannot give prefix when archiving to filescs.|�}�r��||�}���||||�dSr,)Z
wwritedatarq)rZrirrZgetdatarB)�archiver�decoder#r5r$r%rY_szarchive.<locals>.writesunknown archive type '%s'rsuisarchivemetas.hg_archival.txti�Fcst��Sr,)rGr$r8r$r%r�qr1zarchive.<locals>.<lambda>s	archiving)Zunit�total�xi��l)�itemrs"no files match the archive pattern)!rrxrr rr&�	archivers�daterZmatchallr>Z
configbool�listZmanifest�walkr�sortZ
prefetchfilesr6Z
matchfilesZmakeprogress�updater]rBZ	incrementZcomplete�sortedZsubstateZ
workingsub�matchmodZ
subdirmatcher�archiverv)r5r!�noder"r�r
r#rIZsubreposrYrZ�filesr�Zprogressr�ZffZsubpath�subZsubmatchZ	subprefixr$)r�r9r�r#r5r%r�8sV
��

(

r�)TNr1NF))Z
__future__rrMrr�rgrKr|reZi18nrr�rrr�rr	r
r�rr
rr�Zutilsrr@r�r�r&rr4r7r?rG�objectrHryr�r�r�r$r$r$r%�<module>sZ$
�	

�^/��

Youez - 2016 - github.com/yon3zu
LinuXploit