-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/hgext/convert/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyc

ó
Ì\,Tc@sddlmZmZmZmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZddlmZddlmZdd	lmZdd
lmZddlZddlZddlZddlZddlmZmZmZdd
l m!Z!da"d„Z#dedfde
dfdedfdedfdedfdedfdedfdedfdedfg	Z$de
fdefgZ%d„Z&d„Z'de(fd„ƒYZ)de(fd „ƒYZ*e+e+d!„Z,dS("iÿÿÿÿ(tNoRepotMissingTooltSKIPREVtmapfile(tconvert_cvs(tdarcs_source(tconvert_git(tmercurial_sourcetmercurial_sink(t
svn_sourcetsvn_sink(tmonotone_source(tgnuarch_source(t
bzr_source(t	p4_sourceN(thgtutiltencoding(t_tasciicCs<t|tƒr|jtdƒS|jdƒjtdƒSdS(Ntreplacesutf-8(t
isinstancetunicodetencodet
orig_encodingtdecode(ts((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytrecodestcvst
branchsorttgittsvnRt
sourcesorttdarcstmtntgnuarchtbzrtp4c
Csg}|rK|gtD]}|d^qkrKtjtdƒ|ƒ‚nxmtD]e\}}}y-|sw||kr||||ƒ|fSWqRttfk
r¶}	|j|	ƒqRXqRW|jséx"|D]}	|jd|	ƒqËWntjtdƒ|ƒ‚dS(Nis"%s: invalid source repository types%s
s%%s: missing or unsupported repository(	tsource_convertersRtAbortRRRtappendtquiettwrite(
tuitpathttypetrevt
exceptionsRtnametsourcetsortmodetinst((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyt
convertsource1s)	
cCsï|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'RRtnoteR(R+R,R-RR0tsinkR3((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytconvertsink@s)tprogresssourcecBs,eZd„Zd„Zd„Zd„ZRS(cCs(||_||_||_d|_dS(Ni(R+R1t	filecountt	retrieved(tselfR+R1R:((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyt__init__Ns			cCsM|jd7_|jjtdƒ|jd|d|jƒ|jj||ƒS(Nis
getting filestitemttotal(R;R+tprogressRR:R1tgetfile(R<tfileR.((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyRATscCs|jj|ƒS(N(R1t	lookuprev(R<R.((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyRCZscCs|jjtdƒdƒdS(Ns
getting files(R+R@RtNone(R<((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytclose]s(t__name__t
__module__R=RARCRE(((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyR9Ms			t	convertercBskeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„ZRS(cCsü||_||_||_||_i|_i|_d|_t||ƒ|_	|jjƒ}|rˆt
jj|ƒrˆ|j
|ƒn|jdƒrÂ|j
|jdƒƒ|jjƒ|_n|j|jdƒƒ|_t||jdƒƒ|_dS(Nt	authormapt	splicemapt	branchmap(R1tdestR+toptstcommitcachetauthorsRDt
authorfileRtmaptosR,texistst
readauthormaptgettparsesplicemapRJRK(R<R+R1RLt
revmapfileRMRP((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyR=as 							cCs|s
iSi}y>t|dƒ}x(t|ƒD]\}}|jƒdjƒ}|s]q/ntj|dtƒ}t|_|jd7_t|ƒ}dt	|ƒko³dknsÞt
jtdƒ||dfƒ‚nx|D]}|j
j|ƒqåW|d|dd!|d}}	}
|	|
kr;|	||<q/|	|
||<q/WWn*tk
rzt
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.
        tritposixt,iis8syntax error in %s(%d): child parent1[,parent2] expectedis-splicemap file not found or error reading %s:(topent	enumeratet
splitlinestrstriptshlextTruetwhitespace_splitt
whitespacetlisttlenRR'RR1tcheckrevformattIOError(R<R,tmtfptitlinetlextparttchildtp1tp2((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyRV|s4	"
#

c	Cs&|}tƒ}i}xñ|r|jdƒ}||kr?qn||jkr‚|j|}|tks|jj|ƒr‚qq‚n|j|ƒ|jjt	dƒt
|ƒdt	dƒƒ|j|ƒ}g||<x/|jD]$}||j
|ƒ|j
|ƒqÝWqW|jjt	dƒdƒ|S(s`Return a mapping that identifies the uncommitted parents of every
        uncommitted changeset.itscanningtunitt	revisionsN(tsettpopRQRRLthascommitfrommaptaddR+R@RRdtcachecommittparentsR(RD(	R<theadstvisittknownRxtnRgtcommittp((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytwalktree¨s(		
	
+
cCsì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(tsortedRLthascommitforsplicemapRQRUR+twarnRRR'R((R<RxRJtctpcR~((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytmergesplicemapÁs!!cs ‡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.csåt|ƒ}tƒ}i}g}x·|rÚ|jdƒ}||krKq$n|j|ƒ|j|gƒt}xP||D]D}|ˆjkr¤|j|ƒt}n|j|gƒj|ƒqyW|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.
            i(	R€RsRtRvt
setdefaulttFalseRQR(R`(RxRztseentchildrentrootsR|t	hasparentR~(R<(s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytmapchildrenÜs&		

	csdg‰‡‡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.
            csG|d}x,|D]$}ˆdˆ|kr|}PqqW|ˆd<|S(Ni((tnodestnextR|(Rxtprev(s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytpicknexts


N(RD(R(Rx(Rs9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytmakebranchsorterýs	cs"‡fd†‰‡fd†}|S(sSource specific sort.csˆj|jS(N(RNtsortkey(R|(R<(s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyt<lambda>scst|dˆƒdS(Ntkeyi(R€(R(tkeyfn(s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyRs((R(R<(R•s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytmakesourcesorterscs"‡fd†‰‡fd†}|S(sClose order sort.cs$dˆj|jkˆj|jfS(NRE(RNtextraR’(R|(R<(s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyR“scst|dˆƒdS(NR”i(R€(R(R•(s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyRs((R(R<(R•s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytmakeclosesorterscs+i‰‡‡fd†‰‡fd†}|S(sSort revisions by date.cs4|ˆkr,tjˆj|jƒˆ|<nˆ|S(N(Rt	parsedateRNtdate(R|(tdatesR<(s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytgetdate!s cs-tg|D]}ˆ|ƒ|f^q
ƒdS(Ni(tmin(RR|(Rœ(s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyR&s((R(R<(R›Rœs9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytmakedatesortersRtdatesortR t	closesortsunknown sort mode: %ss cycle detected between %s and %sisnot all revisions were sortedN(RR'RtremoveR(RURQt
ValueErrorRtinsertRDRd(R<RxR2RŒR‘R–R˜RžRR‰tactivesRtpendingsR|RƒR~((RxR<s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyttoposortØsF!
	

3
 
cCs{|j}|rw|jjtdƒ|ƒt|dƒ}x/|jD]$}|jd||j|fƒqBW|jƒndS(Nswriting author map file %s
sw+s%s=%s
(RPR+tstatusRR[ROR*RE(R<RPtofiletauthor((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytwriteauthormapRs	"cCsTt|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(NRXt#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
(R[tstript
startswithtsplitR¢RR+R‚R^RORURDtdebugR§RE(R<RPtafileRjt	srcauthort	dstauthortmsgRg((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyRT[s*

 
(cCse|jj|ƒ}|jj|j|jƒ|_|jjt|jƒ|jƒ|_||j|<|S(N(	R1t	getcommitRORUR©RKtstrtbranchRN(R<R.R}((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyRwws
$
cCsæ|j|}|jj|ƒ}t|tƒra|tkrCt}n
|j|}||j|<dS|\}}g}|jrÖxW|jD]I}||jkr«|j|ƒn|j	|j||j|j
fƒq†Wn|jj|j
|ƒyY|j
|}	|jjtdƒ|	|fƒg|	D]}
|jj|
|
ƒ^q#}	Wn.tk
rug|D]}|d^q\}	nXt|j|jt|ƒƒ}|jj|||	|||jƒ}
|jƒ|jj||
ƒ|
|j|<dS(Nsspliced in %s as parents of %s
i(RNR1t
getchangesRt
basestringRRQRxRwR(R·RLt	setbranchRJR+R§RRUtKeyErrorR9Rdt	putcommitREt	converted(R<R.R}tchangesRLtfilestcopiest	pbranchesRRxR~tbR1tnewnode((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytcopyƒs<
	

	
,
!
c	Cs4z"|jjƒ|jjƒ|jj|jƒ|jjtdƒƒ|jjƒ}|j	|ƒ}|j
||jƒ|jjtdƒƒ|j||ƒ}t
|ƒ}d}|jjtdƒƒxÑt|ƒD]Ã\}}|d8}|j|j}d|kr|jƒd}n|jjd|t|ƒfƒ|jjtdƒt|ƒƒ|jjtd	ƒ|d
tdƒdt
|ƒƒ|j|ƒqÔW|jjtd	ƒdƒ|jjƒ}	i}
xG|	D]?}|	|}|jj|tƒtkrÐ|j||
|<qÐqÐW|r™|
r™|jj|
ƒ\}
}|
r™|r™g|jjƒD]}|d|krS|^qS}|r–|
|j|dd<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...
is
is%d %s
ssource: %s
t
convertingRqRrR?( R1tbeforeRLt	setrevmapRQR+R§RtgetheadsRR…RJR¦RdRDR\RNtdescR]RR6R@RÄtgettagsRURtputtagst	iteritemstgetbookmarkstputbookmarksRªtcleanup(R<R2RyRxtttnumRƒRiRÉttagstctagstktvtnrevt
tagsparenttettagsparentst	bookmarkst
cbookmarks((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pytconvert¥s^


  $




cCs3z|jjƒWd|jjƒX|jjƒdS(N(RLtafterR1RQRE(R<((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyRÏâs(
RFRGR=RVRR…R¦RªRTRwRÄRÜRÏ(((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyRH`s		,			z					"	=cKs9tjadt_|jdƒs7|jdƒ|d<n|sjtj|ƒd}|jtdƒ|ƒnt|||jdƒƒ}y1t|||jdƒ|jdƒƒ\}}Wn8t	k
rðx!|j
D]}tj|t
ƒqÐW‚nXd}	g|	D]}
|j|
ƒrþ|
^qþ}t|ƒd
krItjtdƒƒ‚n|rY|dp\|}|dkr|jƒrtjtdƒƒ‚n|dkrÁ|jƒrÁtjtdƒƒ‚n|jdƒ}|rûtj|||ƒ}|jt
ƒn|s|jƒ}nt|||||ƒ}
|
j|ƒdS(NsUTF-8RIROs-hgsassuming destination %s
t	dest_typetsource_typeR.RRŸR R is!more than one sort mode specifiedis1--sourcesort is not supported by this data sources0--closesort is not supported by this data sourcetfilemap(s
branchsortsdatesorts
sourcesorts	closesort(RRRURtdefaultdestR§RR8R4t	ExceptiontcreatedtshutiltrmtreeR`RdRR'thasnativeorderthasnativecloseRàtfilemap_sourcetsetfilemapmodeRWRHRÜ(R+tsrcRLRWRMtdestctsrcctdefaultsortR,t	sortmodesRgR2tfmapRƒ((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyRÜés@		
((-tcommonRRRRRRR!RRRRRRt
subversionR	R
tmonotoneRR#RR$R
R%RRàRRRäR_t	mercurialRRtmercurial.i18nRRRR&R5R4R8tobjectR9RHRDRÜ(((s9/usr/lib/python2.7/dist-packages/hgext/convert/convcmd.pyt<module>s@"$				
ÿŠ

Copyright © 2017 || Recoded By Mr.Bumblebee