\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlZddlmZddlmZmZddl m Z m Z m Z ddl mZdZd 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 d d 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@seZddZdZdZdZejdZ ejdZ ejdZ ejdZ ejdZ ejd Zd Zd Zd Zdd ZdZdZdZdZRS(cC@sddlm}tt|j|||d|d|krj|jd rjtjtd|ntj ddt i|_ |j j d d |j|_tjd |_tjd |_tjd |_|r t|dkr tjtdndS(Ni(tconvcmdtrevst/s//s%%s does not look like a P4 repositorytp4taborttconverts p4.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_typet re_keywordstre_keywords_oldtlenRtAbort(tselfR(trepotypetpathRR((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyR"3s "    cC@s ||_dS(sSets 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 setrevmapNs cC@sndtj|}tj|dd}i}x9t|D]+}|jdd}|r;t||Wxd|D]\}||}dtj|}!tj |!dd }"d)}#xt$|"D]}d)}$d}xd||kr=|d||kr0|d|dkr0d}%xYd ||%f|kr,|d!||%fd"kr|d ||%f}$Pn|%d 7}%qWn|d 7}qW|$r|$|kr||$}#PqqW|#ru|#||t clientspectclienttsviewtcviewt viewordertstartrevtlastidR9tparentsR RAtdescarrt shortdescttRGRHt copiedfilestitoldnameRRtflcmdtflstdouttcopiedfilenamet copiedoldnametj((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyt_parsefs        (  #            cC@s|j|j|jS(N(RuR(R5(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyt _parse_oncescC@s |jdS(NRH(Rv(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyRHscC@s |jdS(NRG(Rv(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pyRGscC@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.pyRJ scC@s|jS(N(RI(R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pytgetheadsscC@sBdtjd|j||f}d}xtrtj|dd}d}g}d}xkt|D]]} | d} | jd} | dkr|st| d| }Pq|n| d kr| jd } | dkrdS|j j | d} | rd}| j dpd| j dp)d}d|krBd}n| j ddkr`d}nd|krx|j }qd|kr|j }qqn(| dks| dkr|j| nd}qgW|s-Pq-q-W|dkrdSdj|}|r|jd|}n|dkr8|jdr8|d }n||fS( Nsp4 -G print %ss%s#%sR7R8tcodetdataRtgenerictstattactiontpurgetdeletes move/deletettypeR iitxitsymlinktltkoRttexttbinarys$\1$s i(R}R~s move/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<|rtjtdn|j||j|tfS(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|ddf}|dkrFg}ntjd|j|ddtj|dd |d|d dd |d d i|d d6|d d6S(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|ddStjtd|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 getcommitms cC@siS(N((R3((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pytgettagsvscC@s(tg|j|D]}|d^qS(Ni(tsortedRG(R3RXRnR((s6/usr/lib64/python2.7/site-packages/hgext/convert/p4.pytgetchangedfilesysN(t__name__t __module__R=R"R6RBRuRt propertycacheRvRHRGRFRIRJRwRRRTRSRRR(((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.pyts