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/hgext/convert/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/hgext/convert/__pycache__/darcs.cpython-310.pyc
o

^�Ub~!�@s�ddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZddlm
Z
ddlmZejZzddlmmmZddlmmmZWniey�zddlmmmZddlmmmZWnEey�zddlmmZddlmmZWn'ey�zddlmmZddlmmZWn	ey�YnwYnwYnwYnwGdd	�d	ejej�Z dS)
�)�absolute_importN)�_)�error�pycompat�util)�dateutil�)�commoncs�eZdZddd�Zdd�Zdd�Zd�fdd	�	Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Z�ZS)�darcs_sourceNcCstjj|||||d�tj�||d�tj�tj�|d��s&tt	d�|��tj
ddd�|�d���d�
�}|dkrEt�t	d	�|��d
t�vrQt�t	d���tj�|�|_d|_i|_i|_i|_|��}|rx|dvrvtt	d
�|��dS|j�t	d��dS)N)�revssdarcss_darcss(%s does not look like a darcs repository)�debnames	--versionrs2.1s,darcs version 2.1 or newer needed (found %r)sElementTrees*Python ElementTree module is not available)s	darcs-1.0shasheds3%s repository format is unsupported, please upgrades#failed to detect repository format!)r	�converter_source�__init__�commandline�os�path�exists�join�NoRepor�	checktool�run0�
splitlines�stripr�Abort�globals�realpath�lastrev�changes�parents�tags�format�ui�warn)�selfr!�repotyperr�versionr �r&�5/usr/lib/python3/dist-packages/hgext/convert/darcs.pyr/s:
�
����	zdarcs_source.__init__c	Cs�tjdtj�|j�dd�|_|jd|jd�\}}|�|�|jddd|jd�}d}d}|�	d	�D]3}|�
d
�}|�dd�}|�d
�rM|dd��
�}n|durX||j|<d}||j|<|g|j|<|}q2g|j|<dS)Nsconvert-�-)�prefixsinit��repodirschangesT)�
xml_output�summaryr+spatchshash�name�sTAG �)r�mkdtemprr�basename�tmppath�run�	checkexit�xml�findall�get�findtext�
startswithrrrr)	r#�output�status�tree�tagname�child�elt�node�namer&r&r'�beforeWs,�

�



zdarcs_source.beforecCs&|j�d|j�tj|jdd�dS)Nscleaning up %s
T)�
ignore_errors)r!�debugr3�shutil�rmtree�r#r&r&r'�afterpszdarcs_source.aftercs(t|tj�r|�d�}tt|��||�S)Nzlatin-1)�
isinstancer�unicode�encode�superr
�recode)r#�s�encoding��	__class__r&r'rNts
zdarcs_source.recodecKsNt�}tdd�}|j|fi|��}|j|j|d�|��|�|j�|��S)Nslatin-1)rP)�parser)	�ElementTree�	XMLParser�_run�parse�stdout�waitr5�
returncode�getroot)r#�cmd�kwargs�etreerS�pr&r&r'r6|s
zdarcs_source.xmlcCs\|jdd|jd�\}}|�|�t�d|tj�}|sdSd�tdd�|�d��	d�D���S)	N�showsrepor*z^\s*Format:\s*(.*)$�,css�|]}|��VqdS�N)r)�.0�fr&r&r'�	<genexpr>�s�z&darcs_source.format.<locals>.<genexpr>r)
r4rr5�re�search�	MULTILINEr�sorted�group�split)r#r;r<�mr&r&r'r �s
$zdarcs_source.formatcCsTg}|jddd|jd�\}}|�|�|�d�D]}|dd�}|r'|�|�q|S)Nr`sfilesT)�no_directoriesr+�
�)r4r3r5rk�append)r#�manr;r<�linerr&r&r'�manifest�s

�

�zdarcs_source.manifestcCs
|jdSrb)rrHr&r&r'�getheads�s
zdarcs_source.getheadscCst|j|}d}t�|�d�|�}|�d�d|�dd�}d}tj|�|�d��t�||�|�|��	�|j
|d	�S)
Ns%a %b %d %H:%M:%S %Z %Ys
local_dater.rnscommentr/s%Y-%m-%d %H:%M:%S %1%2sauthor)�author�date�descr)rr�strdater8r9r	�commitrN�datestrrr)r#�revr@�
dateformatrvrw�
newdateformatr&r&r'�	getcommit�s

�zdarcs_source.getcommitc
Csn|jd|jdd|ddd|jd�\}}|r5|�d�dkr"|�||�|jdd|jd	�\}}|�||�dSdS)
NspullTshash %ss
/bin/false)�all�match�no_test�no_posthook�external_merger+sWe have conflicts in���srevert)rr+)r4rr3�findr5)r#r{r;r<r&r&r'�pull�s 
�
�zdarcs_source.pullcCs2|r	t�td���i}g}d}|j|�d���D]o}|jdvr!q|jdkr~|dur.|��}|�d�|�d�}}||vrP|�	||f�|�	||f�|||<q|d}|D]&}	|	�
|�s^qV|d|	t|�d�}
|�	|	|f�|�	|
|f�|	||
<qVq|�	|j�
�|f�q|�|�||_t|�|t�fS)Ns*convert from darcs does not support --fullssummary)s
add_directorysremove_directorysmovesfromsto�/)rrrrr��getchildren�tagrsr8rpr:�len�textrr�rri�set)r#r{�full�copiesrrqr@�source�destrd�fdestr&r&r'�
getchanges�s:




�
zdarcs_source.getchangesc
Cs�||jkrt�td���tj�|j|�}z
t�	|�}t�
|�j}Wnty;}z|j
t
jkr6WYd}~dS�d}~ww|d@rBdpCd}||fS)Nsinternal calling inconsistency)NN�I�xr/)rrrrrrrr3r�readfile�lstat�st_mode�IOError�errno�ENOENT)r#rBr{r�data�mode�instr&r&r'�getfile�s

��zdarcs_source.getfilecCs|jSrb)rrHr&r&r'�gettags�szdarcs_source.gettagsrb)�__name__�
__module__�__qualname__rrCrIrNr6r rsrtr~r�r�r�r��
__classcell__r&r&rQr'r
.s
("r
)!�
__future__rr�rrfrF�mercurial.i18nr�	mercurialrrr�mercurial.utilsr�r	r�"xml.etree.cElementTree.ElementTreer^�cElementTreerT� xml.etree.cElementTree.XMLParserrU�ImportError�!xml.etree.ElementTree.ElementTree�xml.etree.ElementTree.XMLParser�$elementtree.cElementTree.ElementTree�"elementtree.cElementTree.XMLParser�#elementtree.ElementTree.ElementTree�!elementtree.ElementTree.XMLParserr
rr
r&r&r&r'�<module>sF�������

https://t.me/RX1948 - 2025