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

�]Lb_.�@s^ddlmZddlZddlZddlZddlZddlZddlZddlZddl	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�|�}n,t|t�std��tj�|�}|��}t	�
|g�D]}|�|�r3|dt|��}nq!tj�t�
|��}t�|�}|�d�sK|d7}|�d�rV|dd�}|�d�setj�|�sed|vrlt�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�len�	localpath�pconvert�
startswith�isabsr�Abortr)�dest�kind�prefixr�sfx�lpfx�r(�4/usr/lib/python3/dist-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|SqdS)Nc3s�|]}��|�VqdS�N)r)�.0�ext�r#r(r)�	<genexpr>Ps�zguesskind.<locals>.<genexpr>)r�	iteritemsr�any)r#r$�
extensionsr(r3r)�	guesskindNs
�r8cCs|D]}||S|tSr0r)�repo�revr(r(r)�_rootctxUsr;sy
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�|��durEd}|j
d	d
�r?d}|j	|d�|��|��S)
z!build content of .hg_archival.txtstemplatesexperimentalsarchivemetatemplatesarchive��ctx)�rootN�T)�missing�+)�dirty)r9�ui�config�_defaultmetatemplater
�stringior	�	startitem�context�datar;�hexr:rB�end�getvalue)r=r9�opts�out�fmrBr(r(r)�
buildmetadatams"��rPc@sJeZdZdZejr
ejZn	Gdd�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�}|durt��|_n||_tjj|g|�Ri|��dS)N�mtime)�pop�time�	timestamp�gzip�GzipFile�__init__)�self�args�kwrUr(r(r)rX�s
ztarit.GzipFileWithTime.__init__cCs�|j�d�|j�d�|j}|r|�d�r|dd�}d}|r#tj}|j�t�|��t�|jt	|j
��|j�d�|j�d�|rN|j�|d�dSdS)	Ns��s.gz���r����)�fileobj�write�namerrV�FNAMEr�bytechr�write32u�intrU)rY�fname�flagsr(r(r)�_write_gzip_header�s"��z)tarit.GzipFileWithTime._write_gzip_headerN)�__name__�
__module__�__qualname__rXrjr(r(r(r)�GzipFileWithTime�s
rnr?csL��_d�_d���fdd�	}t|t�r|d|d��_dS|d|d��_dS)	Nr?c
s��dkr1|dd�}|st||d�}�j|t�|d�tj|�d�}|�_tj�	|t�|�|�Sz
t�|t�|��|�WStj
yS}zt�t
�|���d}~ww)N�gzrr�b)rR)rrnr�sysstr�zlib�Z_BEST_COMPRESSIONra�tarfile�TarFile�taropen�CompressionErrorrr"r�forcebytestr)�modercra�	gzfileobj�e�r$rRrYr(r)rv�s0������ztarit.__init__.<locals>.taropensw:)rcsw|)ra)r?N)rRrarr�z)rYr#rRr$rvr(r|r)rX�s
ztarit.__init__cCspt�|�}t�|�}|j|_t|�|_|r(tj|_d|_	t�|�|_
d}d|_n||_	t|�}|j�
||�dS)N�r)r�fsdecodert�TarInforRr�size�SYMTYPE�typery�linknamerFr}�addfile)rYrcry�islinkrI�ir(r(r)r��s


z
tarit.addfilecCs"|j��|jr|j��dSdSr0)r}�closera�rYr(r(r)�done�s
�z
tarit.doneN)r?)rkrlrm�__doc__r�ispy3rVrWrnrXr�r�r(r(r(r)rQ�s
#rQc@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�r
t�|�}t�|d|rtjptj�|_d}||kr |}||_	t
�|�dd�|_dS)N�wi���)
rrrr�zipfile�ZipFile�ZIP_DEFLATED�
ZIP_STOREDr}rRrT�gmtime�	date_time)rYr#rR�compress�epochr(r(r)rX�s

�zzipit.__init__c
Csvt�t�|�|j�}|jj|_d|_t	}|rd}t
}||Bd>|_|jt
�ddddt|j��7_|j�||�dS)N�r~�s<hhBliUT�r)r��ZipInforrr�r}�compression�
compress_type�
create_system�
_UNX_IFREG�
_UNX_IFLNK�
external_attr�extra�struct�packrgrR�writestr)rYrcryr�rIr��ftyper(r(r)r��s 

�z
zipit.addfilecCs|j��dSr0)r}r�r�r(r(r)r�sz
zipit.doneN)T�rkrlrmr�rXr�r�r(r(r(r)r��s

r�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�fileitz$write archive as files in directory.cCs||_t�|j�|_||_dSr0)�basedir�vfsmodr�openerrR)rYrcrRr(r(r)rXs
zfileit.__init__cCsz|r|j�||�dS|j|ddd�}|�|�|��tj�|j|�}t�||�|j	dur;t�
||j	|j	f�dSdS)N�wF)�
atomictemp)r��symlinkrbr�rr�joinr��chmodrR�utime)rYrcryr�rI�f�destfiler(r(r)r�s

�zfileit.addfilecCsdSr0r(r�r(r(r)r�)szfileit.doneNr�r(r(r(r)r�s
r�cC�t||d�S)Nsbz2�rQ�rcrRr(r(r)�<lambda>0�r�cCr�)Nror�r�r(r(r)r�1r�cCr�)Nsxzr�r�r(r(r)r�2r�cCr�)NF)r�r�r(r(r)r�3r�)�filesr+r,r-r/suzipr.Tr?Fc	s�|dkrtjst�td���|dkr�rt�td���nt||�������fdd�}	|tvr8t�td�|���|�t|||pG���d��|sPt�	��}�j
�d	d
�rhd}
||
�rh|	|
dd
�fdd��t��
��|��}t|�}|r�|��t�����t��|�fg��j
jtd�td�|d�}
|
�d�|D]}��|�}|	|d|vr�dp�dd|v�|j�|
j|d�q�|
��|r�t�j�D]}��|�}t�||�}�|d}||��||��7}q�|dkr�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��||�}���||||�dSr0)�
wwritedatar�)rcryr��getdatarI)�archiver�decoder%r9r(r)rb_szarchive.<locals>.writesunknown archive type '%s'rsuisarchivemetas.hg_archival.txti�Fcst��Sr0)rPr(r<r(r)r�qszarchive.<locals>.<lambda>s	archiving)�unit�total�xi��l)�itemrs"no files match the archive pattern)!rr�rr"rr*�	archivers�dater�matchallrC�
configbool�list�manifest�walkr�sort�
prefetchfilesr:�
matchfiles�makeprogress�updaterirI�	increment�complete�sorted�substate�
workingsub�matchmod�
subdirmatcher�archiver�)r9r#�noder$r�r
r%rR�subreposrbrc�filesr��progressr��ff�subpath�sub�submatch�	subprefixr()r�r=r�r%r9r)r�8sX�
��

$
r�)TNr?NF))�
__future__rrVrr�rtrTr�rr�i18nrr�rrr�rr	r
r�rr
rr��utilsrrFr�r�r*rr8r;rErP�objectrQr�r�r�r�r(r(r(r)�<module>s\$
�	

�^/��

https://t.me/RX1948 - 2025