HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //usr/lib64/python2.7/site-packages/hgext/convert/p4.pyc
�
1�3\c@@s�ddlmZddlZddlZddlmZddlmZmZddl	m
Z
mZmZddl
mZd�Zd	�Zd
ejfd��YZdS(i(tabsolute_importN(t_(terrortutil(tdateutiltprocutilt
stringutili(tcommoncc@sGy/x(tr-tj|�}|s%Pn|VqWWntk
rBnXdS(s,Yield the dictionary objects generated by p4N(tTruetmarshaltloadtEOFError(tftd((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pytloaditers	

cC@s?d	d
ddg}x&|D]\}}|j||�}qW|S(
sQPerforce 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%2At*s%23t#s%40t@s%25t%(s%2AR(s%23R(s%40R(s%25R(treplace(tfilenametreplacementstktv((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pytdecodefilename$s	t	p4_sourcecB@s�eZdd�Zd�Zd�Zd�Zejd��Z	ejd��Z
ejd��Zejd��Zejd��Z
ejd	��Zd
�Zd�Zd�Zdd
�Zd�Zd�Zd�Zd�ZRS(cC@sddlm}tt|�j|||d|�d|krj|jd�rjtjtd�|��ntj	ddt
�i|_|jj
d	d
|j�|_tjd�|_tjd�|_tjd
�|_|r
t|�dkr
tjtd���ndS(Ni(tconvcmdtrevst/s//s%%s does not look like a P4 repositorytp4taborttconvertsp4.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):[^$
]*\$s8p4 source does not support specifying multiple revisions(tRtsuperRt__init__t
startswithRtNoRepoRt	checktooltFalsetrevmaptuitconfigt
orig_encodingtencodingtretcompiletre_typetre_keywordstre_keywords_oldtlenRtAbort(tselfR(trepotypetpathRR((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyR"3s "
	cC@s
||_dS(s�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'((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyt	setrevmapNscC@sndtj|�}tj|dd�}i}x9t|�D]+}|jdd�}|r;t||<q;q;W|S(sRead changes affecting the pathsp4 -G changes -s submitted %stmodetrbtchangeN(Rt
shellquotetpopenRtgettNoneR(R3R5tcmdtstdoutt	p4changesR
tc((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyt_parse_view[sc&C@s	i}i}i}i}i}i}g}	|jtd��d|kr�|j|j|��|jd�r�|jd�r�id|d 6}
q�idd6}
n�dtj|�}tj	tj
|dd	��}i}
x�|D]�}
|
jd
�r�||
j�\}}|j|j|��|jd�rU|jd�rU|d }|d }n|d}||jd�d
}||
|<q�q�W|j
�}|jdt�|
j
�}|jdtdt�|jjdd�}|jtd��d)}x�|D]�}|r$t|�t|�kr$q�n|jrRt|�t|jd�krRq�n||jkrm|}q�n|r|g}ng}|j|�}|j||�}|jjt�}t|�dkr�|djd�}nd}d|jt|�d
d!f}|jtj|d�d�g}i}g}d}x�d||kr.d||kr.|d|}d)}xK|D]C} |j �j| j ��ryt!|
| |t| ��}PqyqyW|r!|j"||d|f�|||<|j#d|�dkr|j"|�n|||<n|d
7}q>Wxd|D]\}||}dtj|�}!tj
|!dd	�}"d)}#x�t$|"�D]�}d)}$d}x�d||kr=|d||kr0|d|dkr0d}%xYd ||%f|kr,|d!||%fd"kr|d ||%f}$Pn|%d
7}%q�Wn|d
7}q�W|$r�|$|kr�||$}#Pq�q�W|#ru|#||<q6|j%td#�||f�q6W|||<|||<|||<|}q�W|r�t|�dkr�|g}	ni|d$6|d%6|d&6|	d'6|d(6S(*s4Prepare list of P4 filenames and revisions to importsreading p4 views
Rs//s/...R i����sp4 -G client -o %sR7R8tViews...iitkeytreverseRsp4.startrevscollecting p4 changelists
is
s **empty changelist description**s%s %si����iPs
sdepotFile%dsrev%dsaction%dsmove/addsp4 -G filelog %sschange%ds	file%d,%dshow%d,%ds
moved froms*cannot find source for copied file: %s@%s
t	changesettfilestcopiestheadst	depotnameN(&tstatusRtupdateRBR#tendswithRR:R	R
R;tsplittfindtkeystsorttintR1RR(R)R=RR't_fetch_revisiont_construct_committdesct
splitlinestrstriptrevtreprRtellipsistlowerRtappendR<Rtwarn(&R3R(R5R@RFt	files_mapt
copies_mapt	localnameRJRItviewsR>t
clientspectclienttsviewtcviewt	viewordertstartrevtlastidR9tparentsR
RAtdescarrt	shortdescttRGRHtcopiedfilestitoldnameRRtflcmdtflstdouttcopiedfilenamet
copiedoldnametj((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyt_parsefs�




( #










cC@s|j|j|j�S(N(RuR(R5(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyt_parse_once�scC@s|jdS(NRH(Rv(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyRH�scC@s|jdS(NRG(Rv(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyRG�scC@s|jdS(NRF(Rv(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyRFscC@s|jdS(NRI(Rv(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyRIscC@s|jdS(NRJ(Rv(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyRJscC@s|jS(N(RI(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pytgetheadsscC@sBdtjd|j||f�}d}x�tr�tj|dd�}d}g}d}xkt|�D]]}	|	d}
|	jd�}|
dkr�|s�t|	d|�}Pq�|�n|
d	kr�|	jd
�}|dkr�dS|j	j
|	d�}
|
r�d}|
jd�pd|
jd�p)d}d|krBd}n|
jd�dkr`d}nd|krx|j}q�d|kr�|j
}q�q�n(|
dks�|
dkr�|j|�nd}qgW|s-Pq-q-W|dkr�dSdj|�}|r|jd|�}n|dkr8|jd�r8|d }n||fS( Nsp4 -G print %ss%s#%sR7R8tcodetdataRtgenerictstattactiontpurgetdeletesmove/deletettypeR iitxitsymlinktltkoRttexttbinarys$\1$s
i����(R}R~smove/delete(NN(NN(RR:RJR=RR;RR<tIOErrorR.tmatchtgroupR0R/R\tjointsubRM(R3tnameRXR>t	lasterrorR?R7tcontentstkeywordsR
RxRyR|tp4typetflags((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pytgetfiles\!	
			

cC@s<|rtjtd���n|j||j|t�fS(Ns'convert from p4 does not support --full(RR2RRGRHtset(R3RXtfull((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyt
getchangesRscC@s�|j|jdd��}t|d�df}|dkrFg}ntjd|j|d�dtj|d�d	|d|d
dd|dd
i|dd6|dd6�S(se
        Constructs a common.commit object from an unmarshalled
        `p4 describe` output
        RUR ttimeitauthortusertdates%Y-%m-%d %H:%M:%S %1%2RitbranchRXR9textraRtconvert_revisionN(trecodeR<RRR=RtcommitRtdatestr(R3tobjRiRUR�((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyRTWs	cC@s,d|}tj|dd�}tj|�S(sXReturn an output of `p4 describe` including author, commit date as
        a dictionary.sp4 -G describe -s %sR7R8(RR;R	R
(R3RXR>R?((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyRSfs
cC@sh||jkr|j|S||jkrK|j|�}|j|dd�Stjtd�|��dS(NRis1cannot find %s in the revmap or parsed changesets(RFR'RSRTR=RR2R(R3RXR
((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyt	getcommitmscC@siS(N((R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pytgettagsvscC@s(tg|j|D]}|d^q�S(Ni(tsortedRG(R3RXRnR�((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pytgetchangedfilesysN(t__name__t
__module__R=R"R6RBRuRt
propertycacheRvRHRGRFRIRJRwR�R�RTRSR�R�R�(((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyR2s$	
		�		@					(t
__future__RR	R,tmercurial.i18nRt	mercurialRRtmercurial.utilsRRRR RRRtconverter_sourceR(((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyt<module>s