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: //proc/self/root/lib64/python2.7/site-packages/hgext/convert/convcmd.pyo
�
1�3\c@@sHddlmZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZmZmZmZmZmZmZm
ZmZmZmZejZejZejZejZej Z ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&ej'Z'ej(Z(ej)Z)ej*Z*da+d	�Z,d
�Z-de!dfd
e"dfde*dfde&dfde#dfde'dfde$dfde dfde(dfg	Z.de%fde)fgZ/d�Z0d�Z1de2fd��YZ3de2fd��YZ4e5e5d�Z6dS(i(tabsolute_importN(t_(tencodingterrorthgtpycompattscmutiltutil(tdateutili(tbzrtcommontcvstdarcstfilemaptgittgnuarchRtmonotonetp4t
subversiontasciicC@sQt|tj�r+|jtjt�d�S|jd�jtjt�d�SdS(Ntreplacesutf-8(t
isinstanceRtunicodetencodetsysstrt
orig_encodingtdecode(ts((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytrecode9scC@s7|j|pd|�}|s3|jd|�}n|S(s�
    >>> bmap = {b'default': b'branch1'}
    >>> for i in [b'', None]:
    ...     mapbranch(i, bmap)
    'branch1'
    'branch1'
    >>> bmap = {b'None': b'branch2'}
    >>> for i in [b'', None]:
    ...     mapbranch(i, bmap)
    'branch2'
    'branch2'
    >>> bmap = {b'None': b'branch3', b'default': b'branch4'}
    >>> for i in [b'None', b'', None, b'default', b'branch5']:
    ...     mapbranch(i, bmap)
    'branch3'
    'branch4'
    'branch4'
    'branch4'
    'branch5'
    tdefaulttNone(tget(tbrancht	branchmap((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyt	mapbranch@sRt
branchsortRtsvnRt
sourcesortRtmtnRR	Rc
C@sg}|rK|gtD]}|d^qkrKtjtd�|��nxptD]h\}}}y0|sw||kr�|||||�|fSWqRttfk
r�}	|j|	�qRXqRW|js�x+|D] }	|jdt	j
|	��q�Wntjtd�|��dS(Nis"%s: invalid source repository types%s
s%%s: missing or unsupported repository(tsource_convertersRtAbortRtNoRepotMissingTooltappendtquiettwriteRtbytestr(
tuitpathttypetrevst
exceptionsRtnametsourcetsortmodetinst((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyt
convertsourcers)	
!cC@s�|rE|gtD]}|d^qkrEtjtd�|��nx�tD]�\}}y'|sn||kr~||||�SWqLtk
r�}|jtd�|�qLtk
r�}tjd|��qLXqLWtjtd�|��dS(Nis'%s: invalid destination repository typesconvert: %s
s%s
s%s: unknown repository type(tsink_convertersRR(RR)tnoteR*(R/R0R1RR4tsinkR7((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytconvertsink�s)tprogresssourcecB@s5eZd�Zd�Zd�Zd�Zd�ZRS(cC@s@||_||_|jtd�dtd�d|�|_dS(Ns
getting filestunittfilesttotal(R/R5tmakeprogressRtprogress(tselfR/R5t	filecount((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyt__init__�s		cC@s&|jjd|�|jj||�S(Ntitem(RBt	incrementR5tgetfile(RCtfiletrev((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyRH�scC@s|jj|�S(N(R5ttargetfilebelongstosource(RCttargetfilename((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyRK�scC@s|jj|�S(N(R5t	lookuprev(RCRJ((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyRM�scC@s|jj�dS(N(RBtcomplete(RC((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytclose�s(t__name__t
__module__RERHRKRMRO(((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR=�s
				t	convertercB@skeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZRS(cC@s�||_||_||_||_i|_i|_d|_t||�|_	|jj�}|r�t
jj|�r�|j
|�n|jd�r�|j
|jd��|jj�|_n|j|jd��|_t||jd��|_dS(Nt	authormapt	splicemapR!(R5tdestR/toptstcommitcachetauthorsRt
authorfiletmapfiletmaptosR0texistst
readauthormapRtparsesplicemapRTR!(RCR/R5RUt
revmapfileRVRY((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyRE�s 							cC@ss|s
iSi}y2t|d�}xttj|��D]\}}|j�dj�}|sfq8ntjd|dd�}t|�}dt	|�ko�dkns�t
jtd�||d	f��nx|D]}|j
j|�q�W|d|d	d!|d}}	}
|	|
kr/|	||<q8|	|
||<q8WWn*tk
rnt
jtd
�|��nX|S(s� check and validate the splicemap format and
            return a child/parents dictionary.
            Format checking has two parts.
            1. generic format which is same across all source types
            2. specific format checking which may be different for
               different source type.  This logic is implemented in
               checkrevformat function in source files like
               hg.py, subversion.py etc.
        trbitdatat
whitespacet,iis8syntax error in %s(%d): child parent1[,parent2] expectedis-splicemap file not found or error reading %s:(topent	enumerateRtiterfilet
splitlinestrstripR
tshlexertlisttlenRR(RR5tcheckrevformattIOError(RCR0tmtfptitlinetlextparttchildtp1tp2((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR_�s0""
#

cC@s>t|�}t�}i}|jj�}|jjtd�dtd�d|�}x�|r/|jd�}||kr~qWn||jkr�|j|}|t	ksW|j
j|�r�qWq�n|j|�|j
t|��|j|�}	g||<x/|	jD]$}
||j|
�|j|
�qWqWW|j�|S(s`Return a mapping that identifies the uncommitted parents of every
        uncommitted changeset.tscanningR>t	revisionsR@i(RktsetR5t
numcommitsR/RARtpopR[tSKIPREVRUthascommitfrommaptaddtupdateRltcachecommittparentsR+RN(RCtheadstvisittknownR�R{RBtnRotcommittp((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytwalktree�s.	!		
	


cC@s�x�t|�D]�}||krc|jj|jj||��s
|jjtd�|�q
q
ng}xn||D]b}|jj|jj||��r�qtn||kr�tj	td�|��n|j
|�qtW|||<q
WdS(s�A splicemap redefines child/parent relationships. Check the
        map contains valid revision identifiers and merge the new
        links in the source graph.
        s8splice map revision %s is not being converted, ignoring
sunknown splice map parent: %sN(tsortedRUthascommitforsplicemapR[RR/twarnRRR(R+(RCR�RTtctpcR�((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytmergesplicemaps!!c@s �fd�}�fd�}�fd�}�fd�}�fd�}|dkrc|�}na|dkr{|�}nI|dkr�|�}n1|d	kr�|�}ntjtd
�|��|��\}	}
g}i}x|
r�||
�}
|
j|
�|j|
�x�|	j|
g�D]�}||krig�|D]}|�jkrA|^qA||<ny||j|
�Wn<tk
r�tjtd�t|�t|
�f��nX||s$|
j	d|�d||<q$q$Wq�Wt|�t��krtjtd
���n|S(snReturn an ordering such that every uncommitted changeset is
        preceded by all its uncommitted ancestors.c@s�tjt|��}t�}i}g}x�|r�|j�}||krQq-n|j|�|j|g�t}xP||D]D}|�jkr�|j	|�t
}n|j|g�j	|�qW|s-|j	|�q-q-W||fS(sReturn a (children, roots) tuple where 'children' maps parent
            revision identifiers to children ones, and 'roots' is the list of
            revisions without parents. 'parents' must be a mapping of revision
            identifier to its parents ones.
            (tcollectionstdequeR�RztpopleftRt
setdefaulttFalseR[R+tTrue(R�R�tseentchildrentrootsR�t	hasparentR�(RC(s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytmapchildrens&		

	c@sdg���fd�}|S(sIf the previously converted revision has a child in the
            eligible revisions list, pick it. Return the list head
            otherwise. Branch sort attempts to minimize branch
            switching, which is harmful for Mercurial backend
            compression.
            c@sG|d}x,|D]$}�d�|kr|}PqqW|�d<|S(Ni((tnodestnextR�(R�tprev(s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytpicknextHs


N(R(R�(R�(R�s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytmakebranchsorter@s	c@s"�fd���fd�}|S(sSource specific sort.c@s�j|jS(N(RWtsortkey(R�(RC(s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyt<lambda>Ttc@st|d��dS(Ntkeyi(R�(R�(tkeyfn(s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR�Us((R�(RC(R�s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytmakesourcesorterRsc@s"�fd���fd�}|S(sClose order sort.c@s$d�j|jk�j|jfS(NRO(RWtextraR�(R�(RC(s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR�[sc@st|d��dS(NR�i(R�(R�(R�(s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR�]s((R�(RC(R�s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytmakeclosesorterYsc@s+i���fd���fd�}|S(sSort revisions by date.c@s4|�kr,tj�j|j��|<n�|S(N(Rt	parsedateRWtdate(R�(tdatesRC(s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytgetdateds c@s-tg|D]}�|�|f^q
�dS(Ni(tmin(R�R�(R�(s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR�is((R�(RC(R�R�s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytmakedatesorterasR#tdatesortR%t	closesortsunknown sort mode: %ss cycle detected between %s and %sisnot all revisions were sortedN(RR(RtremoveR+RR[t
ValueErrorRtinsertRRl(RCR�R6R�R�R�R�R�R�R�tactivesRtpendingsR�R�R�((R�RCs;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyttoposortsF!
	

3
 
cC@s�|j}|r�|jjtd�|�t|d�}x8|jD]-}|jtjd||j|f��qBW|j	�ndS(Nswriting author map file %s
swb+s%s=%s
(
RYR/tstatusRReRXR-RttonativeeolRO(RCRYtofiletauthor((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytwriteauthormap�s	cC@sTt|d�}x4|D],}|j�}|s|jd�rDqny|jdd�\}}Wn@tk
r�td�}|jj|||j�f�qnX|j�}|j�}|j	j
|�d|fkrtd�}|jj|||f�||j	|<qntd�}|jj
|||j	||f�qW|j�dS(NRat#t=is,ignoring bad line in author map file %s: %s
smapping author %s to %s
s5overriding mapping for author %s, was %s, will be %s
(Retstript
startswithtsplitR�RR/R�RiRXRRtdebugR�RO(RCRYtafileRrt	srcauthort	dstauthortmsgRo((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR^�s*

 
(cC@sY|jj|�}|jj|j|j�|_t|j|j�|_||j|<|S(N(	R5t	getcommitRXRR�R"R R!RW(RCRJR�((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR��s

c	@s��j|}�jjd�}�jj||�}t|t�rv|tkrXt}n
�j|}|�j|<dS|\}}}g}	|j	r�xW|j	D]I}
|
�jkr��j
|
�n|	j�j|
�j|
jf�q�Wn�j
j|j|	�yh�j|}�jjtd�td�j|�|f�g|D]}�jj||�^qJ}WnNtk
r�g|	D]}
|
d^q�}|j�fd�|jD��nXt|	�dkr�t�}nt|�dkrt�j�jt|��}n,t�j�jt|�t|�d�}�j
j|||||�j||�}|j��jj||�|�j|<dS(	Ntfullsspliced in %s as parents of %s
s and ic3@s+|]!}|�jkr�j|VqdS(N(R[(t.0tx(RC(s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pys	<genexpr>�siii(RWRVRR5t
getchangesRtbytesR}R[R�R�R+R RUt	setbranchRTR/R�RtjointKeyErrortextendt
optparentsRlRzR=t	putcommitROt	converted(RCRJR�R�tchangesRUR?tcopiestcleanp2t	pbranchesR�R�R�tbR5tnewnode((RCs;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pytcopy�sL
	

	
,
!
cC@sIz7|jj�|jj�|jj|j�|jjtd��|jj�}|j	|�}|j
||j�|jjtd��|j||�}t
|�}d}|jjtd��|jjtd�dtd�dt
|��}x�t|�D]�\}}|d8}|j|j}	d	|	krI|	j�d
}	n|jjd|t|	�f�|jjtd�t|��|j|�|j|�qW|j�|jjd
d�s�|jj�}
i}xG|
D]?}|
|}
|jj|
t�tkr�|j|
||<q�q�W|r�|r�|jj|�\}}|r�|r�g|jj�D]}|d|kre|^qe}|r�||j|d
d
<q�q�q�n|jj�}i}xG|D]?}||}
|jj|
t�tkr�|j|
||<q�q�W|r,|r,|jj |�n|j!�Wd|j"�XdS(Nsscanning source...
ssorting...
sconverting...
t
convertingR>RyR@is
is%d %s
ssource: %s
tconverttskiptags(#R5tbeforeRUt	setrevmapR[R/R�RtgetheadsR�R�RTR�RlRRARfRWtdescRhRR:R�R�RNt
configbooltgettagsRR}tputtagst	iteritemstgetbookmarkstputbookmarksR�tcleanup(RCR6R�R�tttnumR�RBRqR�ttagstctagstktvtnrevt
tagsparenttettagsparentst	bookmarkst
cbookmarks((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR��sb


  



!

cC@s3z|jj�Wd|jj�X|jj�dS(N(RUtafterR5R[RO(RC((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR�0s(
RPRQRER_R�R�R�R�R^R�R�R�R�(((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyRR�s		*			z	
			/	?cK@sZtj|�}tjadt_|jd�sF|jd�|d<n|sytj|�d}|jtd�|�nt	|||jd��}t
j|�}y1t|||jd�|jd��\}}Wn8t
k
rx!|jD]}tj|t�q�W�nXd}	g|	D]}
|j|
�r|
^q}t|�d
krgtjtd���n|rz|d}n|}|dkr�|j�r�tjtd���n|dkr�|j�r�tjtd���n|jd�}|rtj|||�}|jt�n|s1|j�}nt|||||�}
|
j|�dS(NsUTF-8RSRXs-hgsassuming destination %s
t	dest_typetsource_typeRJR#R�R%R�is!more than one sort mode specifiedis1--sourcesort is not supported by this data sources0--closesort is not supported by this data sourceR
(R#R�R%R�(RtbyteskwargsRRRRtdefaultdestR�RR<RtwrapconvertsinkR8t	ExceptiontcreatedtshutiltrmtreeR�RlRR(thasnativeorderthasnativecloseR
tfilemap_sourcetsetfilemapmodeR`RRR�(R/tsrcRUR`RVtdestctsrcctdefaultsortR0t	sortmodesRoR6tfmapR�((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyR�7sH		
(
(7t
__future__RR�R\R�tmercurial.i18nRt	mercurialRRRRRRtmercurial.utilsRR�R	R
RRR
RRt	hgconvertRRRRZR*R)R}t
bzr_sourcetconvert_cvstconvert_gittdarcs_sourcetgnuarch_sourcetmercurial_sinktmercurial_sourcetmonotone_sourcet	p4_sourcetsvn_sinkt
svn_sourceRRR"R'R9R8R<tobjectR=RRRR�(((s;/usr/lib64/python2.7/site-packages/hgext/convert/convcmd.pyt<module>sT.L																	"			
��