Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/site-packages/hgext/convert/subversion.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@s�ddlZddlZddlZddlZddlZddlZddlZddlZ	ddl
mZmZm
Z
mZddlmZe
jZddlmZddlmZmZmZmZmZddlmZmZmZmZddlmZy�ddlm Z m!Z!ddl"Z"ddl#Z"ddlZ"ddl$Z"ddl%Z"ddl&Z&ddl'Z'e'j(d	d
dde)�Wne*k
r�e+Z"nXd
e,fd��YZ-d�Z.d�Z/d�Z0d�Z1de2fd��YZ3de4e5d�Z6d�Z7de2fd��YZ8d�Z9d�Z:ie:d6e:d6e9d6Z;d�Z<d efd!��YZ=d"Z>d#eefd$��YZ?dS(%i�N(tstrutiltscmutiltutiltencoding(t_(tStringIO(tNoRepotMissingTooltcommitt
encodeargst
decodeargs(tcommandlinetconverter_sourcetconverter_sinktmapfile(tmakedatetimestamp(tSubversionExceptiontPooltignoretmodulessvn.coretcategorytSvnPathNotFoundcBseZRS((t__name__t
__module__(((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR'scCsn|jdd�\}}|jdd�}d}t|�dkrSd|d}n|dd|t|�fS(s8Parse a revision string and return (uuid, path, revnum).t@it/tii(trsplittsplittlentint(trevturltrevnumtpartstmod((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytrevsplit*scCstj|d�S(Ns!$&'()*+,-./:=@_~(turllibtquote(ts((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR&3scCs�y tjjtjj|��SWntk
r3nXtjj|�r�tjj	tjj
|��}tjdkr�dtj	|�}nt
j|�}dt|�}ntjj|�S(NtntRs	file://%s(tsvntclientt
url_from_pathtcoretsvn_path_canonicalizeRtostpathtisdirtnormpathtabspathtnameRRttolocalR&(R/((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytgeturl=s 
cCs.tjj�}tjj|_||j_|S(N(R)R,tsvn_opt_revision_ttsvn_opt_revision_numbertkindtvaluetnumber(R:toptrev((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR;MstchangedpathcBseZd�ZRS(cCs(|j|_|j|_|j|_dS(N(t
copyfrom_pathtcopyfrom_revtaction(tselftp((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt__init__Ts(RRRB(((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR<Ssic	s�d���fd�}y>tjd|�}	tjj|	j|||||||�WnOtk
r|tjd���n?t	k
r�}
tjt
|
����nXtjd����j�tj
d�dS(Ni�csb|dk	r<x-|j�D]\}}t|�||<qWntj|||||f���dS(N(tNonet	iteritemsR<tpickletdump(t
orig_pathsR!tauthortdatetmessagetpooltktv(tfptprotocol(s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytreceiver\s
R i(t	transporttSvnRaTransportR)tratget_logtIOErrorRERFRCt	ExceptiontstrtcloseR.t_exit(RNR tpathststarttendtlimittdiscover_changed_pathststrict_node_historyRPtttinst((RNROs</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt
get_log_childYs

cKsmtdkr$tjtd���ntjtj�tjtj�t	tjj
��}ttj|�dS(siFetch SVN log in a subprocess and channel them back to parent to
    avoid memory collection issues.
    s5debugsvnlog could not load Subversion python bindingsN(R)RCRtAbortRt	setbinarytsyststdintstdoutR
treadRb(tuitoptstargs((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytdebugsvnlogxst	logstreamcBs)eZdZd�Zd�Zd�ZRS(s$Interruptible revision log iterator.cCs
||_dS(N(t_stdout(R@Rg((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyRB�sccs�x�tr�ytj|j�}Wn&tk
rGtjtd���nXy|\}}}}}Wn@tt	fk
r�|dkr�Pntjtd�|��nX|VqWdS(Ns>Mercurial failed to run itself, check hg executable is in PATHslog stream exception '%s'(tTrueREtloadRntEOFErrorRRcRt	TypeErrort
ValueErrorRC(R@tentryRGR!RHRIRJ((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt__iter__�s	
cCs&|jr"|jj�d|_ndS(N(RnRXRC(R@((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyRX�s	
(RRt__doc__RBRuRX(((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyRm�s		cCs:x3dD]+}tjjtjj||��stSqWtS(Ntlocksthookstformattdb(RwRxsformatRz(R.R/texiststjointFalseRo(RiR/tprototx((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt	filecheck�s
!cCs�y5tj�}|jd||f�}|j�}Wn\tjk
r�}|jdkrp|jtd��tS|j	j�}nt
k
r�tSXd|kS(Ns%s://%s/!svn/ver/0/.svni�swsvn: cannot probe remote repository, assume it could be a subversion repository. Use --source-type if you know better.
s#<m:human-readable errcode="160013">(turllib2tbuild_openertopenRht	HTTPErrortcodetwarnRRoRNRVR}(RiR/R~topenertrsptdataRa((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt	httpcheck�s
thttpthttpstfilecCs@y�|jdd�\}}|dkr�tjdkr�|d dkr�|dd!j�r�|dd!j�dkr�|d d	|d}ntj|�}nWn)tk
r�d}tjj	|�}nX|dkr�
j|�}ntj
|d
��}x<d|kr;||||�r"tS|jdd�d}qWtS(Ns://iR�R(Riis%3a/s:/cWstS(N(R}(Rk((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt<lambda>�si(RR.R3tisalphatlowerR%turl2pathnameRsR/R2RtpconverttprotomaptgetRoRR}(RiR R~R/tcheck((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytissvnurl�s$2
t
svn_sourcecBs�eZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zdd	�Zd
�Z
dd�Zd�Zd
�Zd�Zd�Zd�Zdd�Zdd�Zdeed�ZRS(c	Cs0tt|�j||d|�|jd�p||jd�p|tjj|�rptjjtjj|d��p|t||�s�t	t
d�|��ntdkr�t
t
d���nyAtjjtjjf}|dkr�t
d	�|��nWn#tk
rt
t
d
���nXi|_d}y@|jd�}|dkrnt||d�}|| }nWntk
r�nXt|�|_d
|_y�tjd|j�|_|jj|_|jj|_tjj|j�|_t j!|jt"|j��|_#d|_$|j#|_%i|_&i|_'tjj(|j�|_)Wn4t*k
r�|j+�t	t
d�|j��nX|r�yt|�}Wq�tk
r�t,j-t
d�|��q�Xn|j.j/ddd�j0d�|_1|j.j/dddd�|_2y1t|j2�|_2|j2dkr=d|_2nWn-tk
rmt,j-t
d�|j2��nXy|j3|j#|�|_4Wnt5k
r�d|_4nX|j4s�t,j-t
d�|j#��n|j6|j4�|_7d|_8tjjtjj|d��r||_9n	d|_9d|_:dS(NRssvn://s
svn+ssh://s.svns-%s does not look like a Subversion repositorys)could not load Subversion python bindingsiis=Subversion python bindings %d.%d found, 1.4 or later requireds=Subversion python bindings are too old, 1.4 or later requiredRisUTF-8R s"svn: revision %s is not an integertconverts	svn.trunkttrunkRssvn.startrevtdefaults(svn: start revision %s is not an integersno revision found in module %ss.svn/entries(ii(;tsuperR�RBt
startswithR.R/R{R|R�RRR)RCRR,t
SVN_VER_MAJORt
SVN_VER_MINORtAttributeErrortlastrevstrfindRRsR5R RRQRRRSR*tctxtget_repos_roottbaseurlR%tunquoteRRt
prevmodulet
rootmoduletcommitsRZtget_uuidtuuidRt	tracebackRRcRitconfigtstript	trunknametstartrevtlatesttheadRR!tlast_changedt
_changescachetwct	convertfp(R@RiR RtversionR�tat((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyRB�s�!

	
	"			


 


		!	cCsji}xT|j�D]F}t|�\}}}|j||�}||kr|||<qqW||_dS(N(titerkeysR$t
setdefaultR�(R@trevmapR�trevidR�RR!t
lastrevnum((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt	setrevmap;scCsWy>tjj|jjd�dt|�|t|j�tSWnt	k
rRtSXdS(NR(
R)R*tlsR trstripR&R}R�RoR(R@R/R;((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR{Ds&
c
s��fd�}�fd�}t�j�}d}|d|�}|d|��_|d|�}|r��jpud}�jd|7_�j�j�j��_�js�tjtd��j��q�n�jg�_	�jdk	rd	|�jpdf�_n|r�jjd�}t
jj|dt|�|t�j�}x�t|�D]�}	d
|||	f}
||
�j�s�q_n�j|
�j�}|s��jjtd�|	�q_n�jjtd�|	�j|�f��j	j|�q_Wn�jr��j	r�t�j	�d
krJtjtd���n�j�j	d�}|�jkr�tjtd��j��q�n�j	S(Ncs"�j||�}|tjjkS(N(t
_checkpathR)R,tsvn_node_dir(R/R!R8(R@(s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR0Nscs��jjdd|�}|dk	r;|j�dkr;dS|pD|jd�}�j||�s��jj|�r�|dkr�dS|r�tjt	d�||f��ndS�jj
t	d�||f�|S(NR�ssvn.RRR�s&expected %s to be at %r, but not foundsfound %s at %r
(RiR�RCR�R{RtendswithRRcRtnote(R3RtcfgpathR/(R@(s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt
getcfgpathRs RR�ttagstbranchesRsno revision found in module %ss%s/%ss%s/%s/%ssignoring empty branch %s
sfound branch %s at %d
is>svn: start revision is not supported with more than one branchis.svn: no revision found after start revision %d(R;R�R�RR�R�RRcRtheadsRCR R�R)R*R�R&R}R�tsortedRiR�R!tappendR�R(
R@R0R�Rt	oldmoduleR�R�trpathtbranchnamestbranchRtbrevidR!((R@s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytgetheadsLsR		cCs9|jr'|jd|kr'|jdSd|_|j|\}}|rm|j|||�\}|_}n�t|�\}}}tjj|j	t
|�t|�t|j
�}	g|	j�D]'\}
}|jtjjkr�|
^q�}i}t�|_|j�t||gt|��}|j|=||fS(Nii(R�RCRZtexpandpathstremovedR$R)R*R�R�R&R;RoR�RDR8R,t
svn_node_filetsettsorttzipR(R@RRZtparentstfilestcopiesR�RR!tentriestnte((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt
getchanges�s"	$!

cCs=|j|�}||f|_g|dD]}|d^q)S(Ni(R�R�(R@Rtitchangestf((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytgetchangedfiles�scCs�||jkr�t|�\}}}||_|j|�|jj|d�}||krh|d}n|j||�||jkr�tjt	d�|��q�n|j|}|j|=|S(Niissvn: revision %s not found(
R�R$RtreparentR�R�t_fetch_revisionsRRcR(R@RR�RR!tstopR((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt	getcommit�s	



c	CsVi}|jdkr|Sg}|j}tjj|j�}|j|jg||j�}z��D]�}|\}}}	}
}g|j�D]*\}}
|
jr�|
j|
j	|f^q�}|j
dt�|}|r|dd|kr|j�d}nx�|D]�\}}}|j
|d�s/qnxc|D]E}|dj
|�r6||dt|�}||g|d*Pq6q6W|j|||g�qWtd�|j�D��}t�}xg|D]_}xV|D]N\}}}|j
|d�s�|j
||d�rq�n|j|�Pq�Wq�WxO|D]G}g|D]4}|d|kr<|dj
|d�r<|^q<}q/Wg}x�|D]�\}}}|jd�d}|j
|�r�|j|||g�q�n||kr��ny5|j||�}|r||kr|||<nWq�tk
r.q�Xq�W|}|}qeWWd|j�X|S(Ntreversei�iiRcss<|]2\}}|jdkr|jr||jfVqdS(tAN(R?R=(t.0RAR�((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pys	<genexpr>�s	(R�RCR)RStget_latest_revnumt_getlogR�RDR=R>R�RotpopR�RR�tdictR�taddRR�RRX(R@R�tpendingsttagspathR[tstreamRtt	origpathsR!RHRIRJRAR�R�tsrctagspathtsourcet	sourcerevtdestttagttagpathtaddedstbadrootstdestroottbadroott	renamingsttagnamettagid((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytgettags�sp
	
:
			

	
(
cCsz|js
dS|jdkrFttjj|jdd�d�|_n|jjd||j|�f�|jj	�dS(Ns.svns	hg-shamaptas%s %d
(
R�R�RCR�R.R/R|twriteR!tflush(R@Rtdestrev((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt	converted%s	#cCsd|j|p|j|fS(Nssvn:%s%s@%s(R�R(R@R!R((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR�.scCst|jd�d�S(NRi�(RR(R@R((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR!1scs�d�fd�}|j�j�s<�jjd|�dS|dkr`tjj�j�}nyD�jd�}tjj	�j|j
d�|�}�j|�Wntk
r�d}nX|s�t
d�||f��n||||j�\}}|dkrF|||�\}}|dkrF�jjd|�dSn|j�j�sp�jjd|�dS�j||�S(s]Find the latest revid affecting path, up to stop revision
        number. If stop is None, default to repository latest
        revision. It may return a revision in a different module,
        since a branch may be moved without a change being
        reported. Return None if computed module does not belong to
        rootmodule subtree.
        c
s
�j|g||pd�}z�x�|D]�}|\}}}}}	|dkrY|rYPn||kriPnxq|D]i}
|j|
�sp||
jr�qpn||
j|t|
�}�jjd|||f�|}PqpWq(W|s�}n||fSWd|j�XdS(Nis#branch renamed from %s to %s at %d
(R�RCR�R=RRitdebugRX(R/R[R�R�RtRZR!RHRIRJRAtnewpath(R@(s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytfindchanges<s*

		signoring foreign branch %r
RRs%s not found up to revision %dsignoring empty branch %r
N(RCR�R�RiRR)RSR�R�tstatR�RRRtcreated_revR�(R@R/R�RR�tdirentR!trealpath((R@s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR�4s2$

cCs{|j|kr|S|jt|�}|j}|dkrDd}n|jjd|�tjj|j|�||_|S(s:Reparent the svn transport and return the previous parent.Rsreparent to %s
N(	R�R�R&RCRiRR)RSR�(R@RtsvnurlR�((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR�~s			c	Csut�t�}}i}t|�d\}}||jkrZ||_|j|j�nx�t|�D]�\}	\}
}|jjtd�|	d|
dt|��|j	|
�}|j
||�}
|
tjj
kr�|j|j|��|jsg|rqgnt|d�d\}}|j|kr3qgn|j	|j|�}|sTqgn|jjd|||jf�|j|�||j|�<qg|
dkr�|jjd|j�t|d�d\}}|d|}|j
|||�}|tjj
kr|j|j|��q8|tjjkr�|jd�}|
jd�}|j||�}xr|D]M}|j||�}|j	d||�}|rg|j|j|��qgqgWq8|jjd	||
f�qg|
tjjkrg|jd
kr�n|jdkr�|r�t|d�d\}}|j
|||�}|tjj
krn|j|j|��q�|tjjkr�xO|j||�D]8}|j	d|�}|r�|j|j|��q�q�Wq�nxL|j|
|�D]8}|j	d|�}|r�j|j|��q��|jsg|r;qgnt|d�d\}}|j|krjqgn|j	|j|�}|s�qgn|jjd|
||jf�|j|j|j�}xr|D]g}|j	d||�}|s�n|
|t|�}|j	|�}|j|�||j|�<q�WqgqgW|jjtd�d�|j|�t|�||fS(
Nisscanning pathstitemttotaliscopied to %s from %s@%s
s
gone from %s
Rs unknown path in revision %d: %s
tMtRsmark %s came from %s:%d
(R�R$RR�t	enumerateRitprogressRRt
getrelpathR�R)R,R�R�trecodeR=R>RR�R�t
_iterfilestreplaceR?RCtupdatetlist(R@RRZR�tchangedR�R�t
new_moduleR!R�R/tentt	entrypathR8tpmoduletprevnumR=t
parentpathtfromkindtoroottnroottchildrent	childpathtpkindtcopyfrompatht
copytopath((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR��s�	

 #
'
cs|�kr�|}�nd�_��fd�}�jjtd��j|�f�yjd}t}�j�jg|��}z�x�|D]�}|\}}	}
}}|	�jkr�t	}Pn|s�jj
d|	�|p�	dk}q�n|||	|
||�\}
}|
r$|
}n|r�Pq�q�WWd|j�X|r�|r�|jr�yW�j
|j�}|dkr��j�j|d�}|r�|jj|�q�nWq�tk
r�q�XnWnJtk
r\}}|tjjkr
tjtd����n�nXdS(Ncs#�jjd|t|�f�t}�j|�}|�jksP|�krZd|fSg}t|j��}g|D]*\}}	�j	j
|�ry||	f^qy}
|
ry|
d\}}|jrft}|j�j	t|�}
�j
|
|j�}|dk	rvt|�d\}}|�jkrc|g}�jjtd��j	||f�qcqvqy�jjd�ng}xB|D]:\}}�j|�dkr�q�n|j||f�q�Wtj|d ddg�}�jjd	d
�r	t|d�}n|r�j|�p!d}|r9�j|�p<d}y2�j	jd
�d}|�jkrpd}nWntk
r�d}nXtd|dtj|d�d|d|d|d|�}|�j|<||jf�j |<�j!r�j!jr|g�j!j(n|�_!||fS(slReturn the parsed commit object or None, and True if
            the revision is a branch root.
            s!parsing revision %d (%d changes)
i�is$found parent of branch %s at %d: %s
s)no copyfrom path, don't know what to do.
is UTCs%Y-%m-%dT%H:%M:%SR�t
localtimezoneiRRRHRIs%Y-%m-%d %H:%M:%S %1%2tdescR�R�RN("RiRRR}R�R�RCR�RDRR�R=RoR�R>R$R�R�RRR�Rt	parsedatet
configboolRRRR�t
IndexErrorRtdatestrR�RZt
child_cset(RGR!RHRIRJtbranchedRR�RAR�t
root_pathsR/RRtprevidR�RRZtlogR�tcset(R@t	to_revnum(s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt
parselogentry�sh
$				


	
	s-fetching revision log for "%s" from %d to %d
srevision %d has no entries
iissvn: branch has no revision %s(RCR.RiR�RRR}R�R�RoRRXR�R!RR�R�RRR)R,tSVN_ERR_FS_NO_SUCH_REVISIONRRc(R@tfrom_revnumR4R5t	firstcsettlastonbranchR�RtRZR!RHRIRJR3tfirstrevnumR�Ratnum((R@R4s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR��sR	L
	

cCsv||jkrt�nd}y�t|�d\}}|j|krb||_|j|j�nt�}tjj|j|||�}|j	�}|j
�t|t�r�|d}nd|kr�dp�d}d|kr�p�}WnFt
k
r4}	tjjtjjf}
|	j|
kr.t�n�nX|dkrld}|j|�rl|t|�}qln||fS(	NRii�ssvn:executableRssvn:specialtlslink (R�RUR$RR�RR)RStget_filetgetvalueRXt
isinstanceRRR,tSVN_ERR_FS_NOT_FOUNDtSVN_ERR_RA_DAV_PATH_NOT_FOUNDtapr_errR�R(R@R�RtmodeRR!tiotinfoR�R�tnotfoundtlink_prefix((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytgetfileps6			

		cs��jd��t�}dj|jt��g�jd�}tjj|t|�t	|j
|�}�ry�d7�n�fd�|j�D�S(s3Enumerate all files in path at revnum, recursively.Rc3s4|]*\}}|jtjjkr�|VqdS(N(R8R)R,R�(R�RAR�(R/(s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pys	<genexpr>�s	(R�RR|R�R&R)R*R�R;RoR�RD(R@R/R!RKR�R�((R/s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR�s	''
cCs�|dkr|j}n|j|�rj|jd�t|�}|jd�rW|dS|dkrj|Sn|jjd||f�dS(NRiRs%r is not under %r, ignoring
(RCRR�R�RRiR(R@R/Rtrelative((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR�scCsv|dk	r,|jd�}|d|}nz&tjj|j|jd�|�SWd|dk	rq|j|�nXdS(NRR(RCR�R)RSt
check_pathR�(R@R/R!RR�((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR��s&icCsg}xG|D]?}|jd�s6|jd|}n|j|jd��q
W|j||||||g}	t|	�}
tj�}dtj|�}tj	tj
|��\}
}|
j|
�y|
j�Wn&t
k
r�tjtd���nXt|�S(NRs%s debugsvnlogs>Mercurial failed to run itself, check hg executable is in PATH(R�RR�R�R�R	Rthgexecutablet
shellquotetpopen2tquotecommandRRXRURcRRm(R@RZR[R\R]R^R_trelpathsRARktargthgexetcmdRfRg((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR��s"


N(RRRCRBR�R{R�R�R�R�R�RR�R!R�R�R�R�RHRRR�RoR}R�(((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR��s*W				H				^			J	
	e	� 	sW#!/bin/sh

REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"

if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi
if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi

echo "Changing prohibited revision property" >&2
exit 1
tsvn_sinkcBs�eZejdej�Zejdej�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
ed	��Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(sCommitted revision (\d+).sRepository UUID:\s*(\S+)cCs |jrtj|j�ndS(N(R�R.tchdir(R@((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytprerun�s	cCs |jrtj|j�ndS(N(R�R.RTtcwd(R@((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytpostrun�s	cCstjj|jd|�S(Ns.svn(R.R/R|R�(R@R3((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR|�scCs
|jd�S(Ns	hg-shamap(R|(R@((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt
revmapfile�scCs
|jd�S(Nshg-authormap(R|(R@((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt
authorfile�scCs�tj|||�tj||d�g|_g|_g|_g|_d|_t	j
�|_t}t	j
jt	j
j|dd��r�t	j
j|�|_|jd�nPtjd|�s�t	j
j|�}t	j
jt	j
j|��r�t	j
jt	j
j|dd��s\|jtd�t	j
j|��t|d	�jd
|�|}ntj|�}|jd�s�d|}nd|}q�nt	j
jt	j
�t	j
j|�d
�}|jtd�t	j
j|��|jd||�||_tj|j�|_tj|j�|_t ||jd��|_!tj"|j�ratj#pdd|_$|r�t	j
j|dd�}t%|d�}|j&t'�|j(�tj)|tt*�n|jd�}|j+j|�j,d�j-�|_.dS(NR)s.svnR�Rs#^(file|http|https|svn|svn\+ssh)\://Rzsfs-typesinitializing svn repository %r
tsvnadmintcreateRsfile://s-wcs!initializing svn working copy %r
tcheckoutshg-childmapRxspre-revprop-changetwREi(/R
RBRtdeletetsetexectdelexecR�RCR�R.tgetcwdRVR}R/tisfileR|Rtrun0tretsearchR0tdirnameR{tstatusRtbasenameRR1R�RR�twopenerRtchildmapt	checkexectisexectis_execR�Rtpre_revprop_changeRXtsetflagsRotuuid_retgroupR�R�(R@RiR/tcreatedtwcpaththookRNtoutput((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyRB�sR					$$	
+	$

cGstjj|j|�S(N(R.R/R|R�(R@tnames((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytwjoin)scCs�t�}|jddtdt�}tjjj|�}x�|jd�D]}}xt|jD]i}|j	|j
ksY|jdkr�qYndjd�|jD��}|j
tj|jd���PqYWqIW|S(	NR�t	recursivetxmlRtR3Rcss*|] }|j|jkr|jVqdS(N(tnodeTypet	TEXT_NODER�(R�tc((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pys	<genexpr>8ssutf-8(R�RcRoRytdomtminidomtparseStringtgetElementsByTagNamet
childNodesRztELEMENT_NODEttagNameR|R�RR4tencode(R@tmRutdocR�R�R3((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytmanifest,s	!	cCsd|kr"|jj||�n�y/tjj|j|��rPtj|�nWntk
rdnX|jj||�|j	r�j	|j|��r�d|kr�|j
j|�q�nd|kr�|jj|�nt
j|j|�td|k�ndS(NR<R(RitsymlinkR.R/tislinkRwtunlinktOSErrorRRmR`R�R_RRoR}(R@tfilenametflagsR�((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytputfileCs
	cCs�|j|�}tjj|�}|r~tjdddtjj|��\}}tj|�tj|�tj	||�nz|j
d||�Wd|jj|�|r�tj|�Wnt
k
r�nXtj	||�nXdS(Ntprefixshg-copy-tdirtcopy(RwR.R/tlexiststtempfiletmkstempRfRXR�trenameRcR�R�R�(R@R�R�twdestR{tfdttempname((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt	_copyfileWs"	!


cCswt�}xg|D]_}tjj|j|��rA|j|�nx+tj|d�D]}|j|| �qTWqW|S(NR(R�R.R/R0RwR�Rtrfindall(R@R�tdirsR�R�((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytdirs_ofns	
cCspgt|j|��D]}||jkr|^q}|rl|jj|�|j|ddtdt�n|S(NR�t
non_recursivetquiet(R�R�R�RtxargsRo(R@R�tdtadd_dirs((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR�wscCs[g|D]}||jkr|^q}|rW|jj|�|j|ddt�n|S(NR�R�(R�RR�Ro(R@R�R�((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt	add_filess
(cCs�g}xwt|j|�dt�D]Z}|j|�}tj|�dkr"|jd|�|jj|�|j	|�q"q"W|S(NR�s.svnR^(
R�R�RoRwR.tlistdirRcR�tremoveR�(R@RvtdeletedR�twd((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt	tidy_dirs�s"cCs||j|<dS(N(Rj(R@tparenttchild((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytaddchild�scCsd|j|fS(Nu	svn:%s@%s(R�(R@R((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyR��sc	Cs�x:|D]2}y|j|j|�SWqtk
r8qXqWx�|D]�\}}	y|j||	�\}
}Wn!tk
r�|jj|�qDX|j|||
�||krD|jj|||g�qDqDWg|D]}|d^q�}t	|j�}t
|�}|j|j|j
|���|jrfx'|jD]\}
}|j|
|�q:Wg|_n|jr�|j|jd�x!|jD]}|jj|�q�Wg|_n|j|j|j
|���|j|j|��|jr|j|jdd�g|_n|jr@|j|jddd�g|_ntjdd�\}}tj|d	�}|j|j�|j�zF|jd
dtj|j �d|d
d�}y|j!j"|�j#d�}WnZt$k
r/|s�dS|j%j&t'd��|j%j&|�tj(t'd���nX|j)r^|j*dd|j)dt+d|�n|j,r�|j,dkr�|j*dd|j,dt+d|�nx|D]}|j-||�q�W|j|�SWdtj.|�XdS(NiR^tpropdelssvn:executabletpropsett*R�shg-convert-R]RtusernameR�Rsutf-8isunexpected svn output:
sunable to cope with svn outputshg:convert-revtrevproptrevisionR�shg:convert-branch(/R�RjtKeyErrorRHRUR^R�R�R�R�t	frozensetRR�t
differenceR�R�R�R�R�R�R`R_R�R�R.tfdopenRR)RXRcRt	shortuserRHt	commit_reReRqR�RiR�RRcRtrunRoR�R�R�(R@R�R�R�RR�R�R�R�RMR�RCR�R'R�R�tmessagefileRNRuR((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt	putcommit�sz


!				
	
	
cCs|jjtd��dS(Ns/writing Subversion tags is not yet implemented
(NN(RiR�RRC(R@R�((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pytputtags�scCs0||jkrtStjtd�|��dS(Ns_splice map revision %s not found in subversion child map (revision lookups are not implemented)(RjRoRRcR(R@R((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt	hascommit�s(RRRdtcompileRR�RpRURWR|RXRYRBRwt
propertycacheR�R�R�R�R�R�R�R�R�R�R�R�(((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyRS�s*						2								
			E	(@R.RdReR�R%R�txml.dom.minidomRytcPickleREt	mercurialRRRRtmercurial.i18nRR�t	cStringIORtcommonRRRR	R
RRR
RRtsvn.coreRRR)t
svn.clienttsvn.rat	svn.deltaRQtwarningstfilterwarningstDeprecationWarningtImportErrorRCRVRR$R&R5R;tobjectR<RoR}RbRlRmR�R�R�R�R�RnRS(((s</sys/lib/python2.7/site-packages/hgext/convert/subversion.pyt<module>sXT"	("

			
			
			

	"��

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.