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

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/hgext/convert/__pycache__/p4.cpython-39.opt-1.pyc
a

�+�b	3�@s~ddlmZddlZddlZddlmZddlmZmZddl	m
Z
mZmZddl
mZdd	�Zd
d�ZGdd
�d
ej�ZdS)�)�absolute_importN)�_)�error�util)�dateutil�procutil�
stringutil�)�commonccs4zt�|�}|sq|VqWnty.Yn0dS)z,Yield the dictionary objects generated by p4N)�marshal�load�EOFError)�f�d�r�6/usr/lib64/python3.9/site-packages/hgext/convert/p4.py�loaditers
rcCs&gd�}|D]\}}|�||�}q|S)aQPerforce escapes special characters @, #, *, or %
    with %40, %23, %2A, or %25 respectively

    >>> decodefilename(b'portable-net45%252Bnetcore45%252Bwp8%252BMonoAndroid')
    'portable-net45%2Bnetcore45%2Bwp8%2BMonoAndroid'
    >>> decodefilename(b'//Depot/Directory/%2525/%2523/%23%40.%2A')
    '//Depot/Directory/%25/%23/#@.*'
    ))s%2A�*)s%23�#)s%40�@)s%25�%)�replace)�filenameZreplacements�k�vrrr�decodefilename&s	rcs�eZdZd&�fdd�	Zdd�Zdd�Zdd	�Zejd
d��Z	ejdd
��Z
ejdd��Zejdd��Zejdd��Z
ejdd��Zdd�Zdd�Zdd�Zd'dd�Zdd�Zd d!�Zd"d#�Zd$d%�Z�ZS)(�	p4_sourceNcs�ddlm}tt|�j||||d�d|vrH|�d�sHt�td�|��tj	ddd	�i|_
|j�d
d|j
�|_t�d�|_t�d
�|_t�d�|_|r�t|�dkr�t�td���dS)Nr	)�convcmd)�revs�/�//s%%s does not look like a P4 repository�p4F)�abort�convertsp4.encodingsE([a-z]+)?(text|binary|symlink|apple|resource|unicode|utf\d+)(\+\w+)?$sA\$(Id|Header|Date|DateTime|Change|File|Revision|Author):[^$\n]*\$s\$(Id|Header):[^$\n]*\$s8p4 source does not support specifying multiple revisions)�r�superr�__init__�
startswithr
ZNoReporZ	checktool�revmap�ui�configZ
orig_encoding�encoding�re�compile�re_type�re_keywords�re_keywords_old�lenr�Abort)�selfr)Zrepotype�pathrr��	__class__rrr&;s0
������zp4_source.__init__cCs
||_dS)a�Sets the parsed revmap dictionary.

        Revmap stores mappings from a source revision to a target revision.
        It is set in convertcmd.convert and provided by the user as a file
        on the commandline.

        Revisions in the map are considered beeing present in the
        repository and ignored during _parse(). This allows for incremental
        imports if a revmap is provided.
        N)r()r3r(rrr�	setrevmap^szp4_source.setrevmapcCsJdt�|�}tj|dd�}i}t|�D]}|�dd�}|r(d||<q(|S)zRead changes affecting the pathsp4 -G changes -s submitted %s�rb��mode�changeNT)r�
shellquote�popenr�get)r3r4�cmd�stdout�	p4changesr�crrr�_parse_viewks
zp4_source._parse_viewc&Csvi}i}i}i}i}i}g}	|�td��d|vrr|�|�|��|�d�rh|�d�rh|dd�di}
nddi}
n�dt�|�}t�	tj
|d	d
��}i}
|D]�}
|
�d�r�||
��\}}|�|�|��|�d�r�|�d�r�|dd�}|dd�}|d
d�}||�d�dd�}||
|<q�t
|��td�}t
|
��tdd�}|j�dd�}|�td��d}|D�]�}|�r�t|�t|�k�r��qh|j�r�t|�t|jd�k�r��qh||jv�r�|}�qh|�r�|g}ng}|�|�}|�||�}|j�d�}t|�dk�r|d�d�}nd}d|j|f}|�t�|d�d�g}i}g}d}d||v�rd||v�r|d|}d}|D]<} |���| ����r|t|
| |t| �d��}�q��q||�r|�||d|f�|||<|� d|�dk�r�|�|�|||<|d7}�qL|D�]}||}dt�|�}!tj
|!d	d
�}"d}#t!|"�D]�}d}$d}d ||v�r�|d ||k�r�|d|dk�r�d}%d!||%f|v�r�|d"||%fd#k�r�|d!||%f}$�q�|%d7}%�q�|d7}�qV|$�rJ|$|v�rJ||$}#�q�qJ|#�r|#||<n|�"td$�||f��q|||<|||<|||<|}�qh|�rft|�dk�rf|g}	||||	|d%�S)&z4Prepare list of P4 filenames and revisions to importsreading p4 views
rr s/...N����sp4 -G client -o %sr8r9sViews...�r	)�keyT)rG�reverser#sp4.startrevscollecting p4 changelists
rs
s **empty changelist description**s%s %s�P�
sdepotFile%dsrev%dsaction%dsmove/addsp4 -G filelog %sschange%ds	file%d,%dshow%d,%ds
moved froms*cannot find source for copied file: %s@%s
)�	changeset�files�copies�heads�	depotname)#�statusr�updaterCr'�endswithrr<rrr=�split�find�sorted�keys�intr1r)r*rr(�_fetch_revision�_construct_commit�desc�
splitlines�rstrip�revrZellipsis�lowerr�appendr>r�warn)&r3r)r4rA�	changesetZ	files_mapZ
copies_mapZ	localname�	depotname�headsZviewsr?Z
clientspecZclientZsviewZcviewZ	vieworderZstartrevZlastidZchange�parentsrrBZdescarrZ	shortdesc�t�files�copiesZcopiedfiles�iZoldnamerrZflcmdZflstdoutZcopiedfilenameZ
copiedoldname�jrrr�_parsevs�



 



��

���zp4_source._parsecCs|�|j|j�S�N)rjr)r4�r3rrr�_parse_onceszp4_source._parse_oncecCs
|jdS)NrM�rmrlrrrrgszp4_source.copiescCs
|jdS)NrLrnrlrrrrfszp4_source.filescCs
|jdS)NrKrnrlrrrraszp4_source.changesetcCs
|jdS)NrNrnrlrrrrcszp4_source.headscCs
|jdS)NrOrnrlrrrrbszp4_source.depotnamecCs|jSrk)rcrlrrr�getheads szp4_source.getheadscCs�dt�d|j||f�}d}tj|dd�}d}g}d}t|�D]�}	|	d}
|	�d�}|
dkr�|szt|	d|�}�q>n|�n�|
d	k�r|	�d
�}|dvr�dS|j�|	d
�}
|
�r8d}|
�	d�p�d|
�	d�p�d}d|vr�d}|
�	d�dkr�d}d|v�r|j
}nd|v�r8|j}n|
dk�s.|
dk�r8|�|�d}qB|s �qHq |du�rVdSd�
|�}|�rr|�d|�}|dk�r�|�d��r�|dd�}||fS)Nsp4 -G print %ss%s#%sr8r9scodesdataserrorsgenericsstatsaction)spurgesdeletesmove/delete)NNstyperEr	��xrFssymlink�lsko�kstextsbinarys$\1$rJ���)rr<rbr=rr>�IOErrorr.�match�groupr0r/r_�join�subrR)r3�namer]r?Z	lasterrorr@r:�contents�keywordsr�code�data�actionZp4type�flagsrrr�getfile#s^�


�




zp4_source.getfilecCs*|rt�td���|j||j|t�fS)Ns'convert from p4 does not support --full)rr2rrfrg�set)r3r]Zfullrrr�
getchangeseszp4_source.getchangesc
Csj|�|�dd��}t|d�df}|dur.g}tj|�|d�t�|d�||d|d|d|dd	�d
�S)ze
        Constructs a common.commit object from an unmarshalled
        `p4 describe` output
        sdescrEstimerNsusers%Y-%m-%d %H:%M:%S %1%2r;)r!sconvert_revision)Zauthor�daterdrZ�branchr]Zextra)Zrecoder>rWr
ZcommitrZdatestr)r3�objrdrZr�rrrrYjs
�zp4_source._construct_commitcCs d|}tj|dd�}t�|�S)zXReturn an output of `p4 describe` including author, commit date as
        a dictionary.sp4 -G describe -s %sr8r9)rr=rr)r3r]r?r@rrrrX~szp4_source._fetch_revisioncCsL||jvr|j|S||jvr6|�|�}|j|dd�St�td�|��dS)N)rds1cannot find %s in the revmap or parsed changesets)rar(rXrYrr2r)r3r]rrrr�	getcommit�s




�zp4_source.getcommitcCsiSrkrrlrrr�gettags�szp4_source.gettagscCstdd�|j|D��S)NcSsg|]}|d�qS)rr)�.0�xrrr�
<listcomp>�rEz-p4_source.getchangedfiles.<locals>.<listcomp>)rUrf)r3r]rhrrr�getchangedfiles�szp4_source.getchangedfiles)N)N)�__name__�
__module__�__qualname__r&r7rCrjrZ
propertycachermrgrfrarcrbror�r�rYrXr�r�r��
__classcell__rrr5rr:s2#






B

r)Z
__future__rrr,Zmercurial.i18nrZ	mercurialrrZmercurial.utilsrrrr$r
rrZconverter_sourcerrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit