Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/mercurial/hg.pyc

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


�
�c@s�ddklZddklZddkZddkZddkZddkZddkZddkZddk	Z	ddk
Z
ddkZddkZ
ddkZddkZddkZddkZd�Zgd�Zhed<ed<ed<ed	<ed
<ed<Zd�Zd
�Zded�Zd�Zd�Zded�Zdedeed�Zd�Z d�Z!e!Z"ed�Z#ded�Zd�Z$d�ZdS(i�(t_(treleaseNcCs*tiitid|��otptS(Ntfile(tostpathtisfiletutiltdrop_schemet
bundlerepot	localrepo(R((s/sys/lib/python/mercurial/hg.pyt_localscCs�d|jo*||pd|o|dpdfSn|idd�\}}|o|dp|}||pg|g|fS(s.parse url#branch, returning url, branch + revst#i�iN(tNonetsplit(turltrevstbranchtcheckout((s/sys/lib/python/mercurial/hg.pytparseurls

*tbundleRthttpthttpstsshsstatic-httpcCs�d}|o.|id�}|djo|| }q;nti|�ptd}y||�SWntj
o|SnXdS(NRt:i(tfindtschemestgett	TypeError(Rtschemetctthing((s/sys/lib/python/mercurial/hg.pyt_lookup(s
cCsOt|t�o5yt|�i|�SWqEtj
otSqEXn|i�S(s$return true if repo or path is local(t
isinstancetstrRtislocaltAttributeErrortFalsetlocal(trepo((s/sys/lib/python/mercurial/hg.pyR"4s
tcCsxt|�i|||�}t|d|�}xDti�D]6\}}t|dd�}|o|||�q:q:W|S(s1return a repository object for the specified pathtuit	reposetupN(Rtinstancetgetattrt
extensionsR(R(RtcreateR&tnametmodulethook((s/sys/lib/python/mercurial/hg.pyt
repository=s
cCstiitii|��S(s4return default destination of clone if none is given(RRtbasenametnormpath(tsource((s/sys/lib/python/mercurial/hg.pytdefaultdestGscCsX|id�o|dSn|id�o|dSn|id�o|dSn|S(Nsfile://localhost/isfile://isfile:i(t
startswith(R((s/sys/lib/python/mercurial/hg.pyt	localpathKsc	Cs�t|�ptitd���n|ptii|�}n|i|�}t|t	�o:|i|�}t
|d�\}}}t||�}n|}|i�}}d}|i}tii|�}	tii|	d�}
tii|
�otitd���ntii|	�pti|	�nti|
�d}y|id�i�}Wn/tj
o#}|itijo�q�nX|d7}ttii|
d�d�i|�ttii|
d�d�i|�|iid	d
�}
|
o=ttii|
d�d�}|id|
�|i�nt||	�}|o�|iitd
��|tj	o
|}nxD|d
dfD]3}y|i |�}PWq�t!j
o
q�q�Xq�Wt"||�ndS(screate a shared repositorys!can only share local repositoriesR's.hgsdestination already existstrequiressshared
twt
sharedpathtpathstdefaultthgrcs[paths]
default = %s
supdating working directory
ttipN(#R"RtAbortRRRR2t
expandpathR R!RR1RRR:trealpathtjointexiststisdirtmkdirtopenertreadtIOErrorterrnotENOENTRtwriteR(tconfigtclosetstatustTruetlookuptLookupErrort_update(R(R4tdesttupdatet
origsourcetrevRtsrcrepoR:troottroothgtrequirementstinstR<tftrttesttuprev((s/sys/lib/python/mercurial/hg.pytshareTs^
	

%%

cCs�t|t�o:|i|�}t||�\}}}t||�}	n/|}	|	i�}}|o|dpd%}|d%jo't|�}|it	d�|�n|i|�}t
|�}t
|�}tii
|�oatii|�ptit	d�|��qGti|�otit	d�|��qGndtfd��Y}
d%}}}
z�|�o|
|�}
n|}t}|	i�o>t|�o1tiitid|��}|o|}n|o9y|	idt�}Wq"tij
o
t}q"Xn|o�|	id	d
tdd�tiitii|d
��}tii
|�pti|�n
||
_ y|}ti|�WnRt!j
oF}|i"t"i#jo'|
i$�tit	d�|��n�nXx�|	i%i&�D]�}tii|	i|�}tii||�}tii'|�}|o%tii
|�oti|�ntii
|�oF|i(d�o"titii|d��}nti)||�qqWt||�}|	idddddd�n@yt||dt�}WnRt!j
oF}|i"t"i#jo'|
i$�tit	d�|��n�nXd%}|oad|	i*jotit	d���ng}|D]}||	i+|�q�~}|d}n|i,�o|i-|	d|d|�n:|	i,�o|	i.|d|�ntit	d���|
o|
i$�n|i,�o�|i/dddt�}|i0d�|i0d |�|i$�|i1i2d!d"|�|oy|i1it	d#��|tj	o
|}nx8|d"d$fD]'}y|i+|�}PWqqqXqWt3||�qEn|	|fSWd%t4||�|
d%j	o|
i5�nXd%S(&s,Make a copy of an existing repository.

    Create a copy of an existing repository in a new directory.  The
    source and destination are URLs, as passed to the repository
    function.  Returns a pair of repository objects, the source and
    newly created destination.

    The location of the source is added to the new repository's
    .hg/hgrc file, as the default to be used for future pulls and
    pushes.

    If an exception is raised, the partly cloned/updated destination
    repository will be deleted.

    Arguments:

    source: repository object or URL

    dest: URL of destination repository to create (defaults to base
    name of source repository)

    pull: always pull from source repository, even in local case

    stream: stream raw data uncompressed from repository (fast over
    LAN, slow over WAN)

    rev: revision to clone up to (implies pull=True)

    update: update working directory after clone completes, if
    destination is local repository (True means update to default rev,
    anything else is treated as a revision)
    i�sdestination directory: %s
sdestination '%s' already existssdestination '%s' is not emptyt
DirCleanupcBs#eZd�Zd�Zd�ZRS(cSsti|_||_dS(N(tshutiltrmtreetdir_(tselfRd((s/sys/lib/python/mercurial/hg.pyt__init__�scSs
d|_dS(N(RRd(Re((s/sys/lib/python/mercurial/hg.pyRM�scSs%|io|i|it�ndS(N(RdRcRO(Re((s/sys/lib/python/mercurial/hg.pytcleanup�s
(t__name__t
__module__RfRMRg(((s/sys/lib/python/mercurial/hg.pyRa�s		RtwaittpreoutgoingtthrowR4tclones.hgtdatatlocktoutgoingtnodet0i(R-RPsXsrc repository does not support revision lookup and so doesn't support clone by revisionitheadststreamRs)clone from remote to remote not supportedR=R9ttexts[paths]
s
default = %s
R;R<supdating working directory
R>N(6R R!R@RR1RRR5RNRR7RRRCRDRR?tlistdirtobjectR"R$tcancopytabspathRRoterrort	LockErrorR0RORARBRERdtOSErrorRItEEXISTRMtstoretcopylisttdirnametendswitht	copyfilestcapabilitiesRPR%RmtpushRFRKR(t	setconfigRRRRg(R(R4RStpullRVRTRtRURtsrc_repoRatsrc_lockt	dest_locktdir_cleanupRytcopythgdirt	dest_pathR[R\tsrctdsttdstbaset	dest_repoRt_[1]R]tfpR^R_((s/sys/lib/python/mercurial/hg.pyRm�s�#
!

!	
"!
*








cCs�|dtd�f|dtd�f|dtd�f|dtd�ff}d	ig}|D]}|td
�|qc~�}|iid|�dS(Nitupdateditmergeditremovedit
unresolveds, s%d files %ss%s
(RRBR(RN(R&tstatsR�tstnote((s/sys/lib/python/mercurial/hg.pyt
_showstatsEs4cCs[ti||ttd�}t||�|do|iitd��n|ddjS(s<update the working directory to node, merging linear changesis1use 'hg resolve' to retry unresolved file merges
iN(t_mergeRTR$RR�R(RNR(R&RqR�((s/sys/lib/python/mercurial/hg.pyRTMs

cCsAti||ttd�}|ot||�n|ddjS(sAforcibly switch the working directory to node, clobbering changesiiN(R�RTR$RORR�(R&Rqt
show_statsR�((s/sys/lib/python/mercurial/hg.pytcleanXscCs|ti||t|t�}t||�|do|iitd��n"|o|iitd��n|ddjS(s)branch merge with node, resolving changesisOuse 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon
s'(branch merge, don't forget to commit)
i(R�RTROR$R�R(RNR(R&RqtforcetremindR�((s/sys/lib/python/mercurial/hg.pytmerge^s
cCs#ti||tt|�ddjS(s<revert changes to revision in node without updating dirstateii(R�RTR$RO(R&Rqtchoose((s/sys/lib/python/mercurial/hg.pytrevertiscCs
ti|�S(s&verify the consistency of a repository(t_verifytverify(R&((s/sys/lib/python/mercurial/hg.pyR�ms(%ti18nRRoRR	RthttprepotsshrepotstatichttprepoRR,RzR�R�R�R�RIRRbR
RRRR"R$R1R5R7RROR`RmR�RTRRR�R�(((s/sys/lib/python/mercurial/hg.pys<module>	s<<0$	
								
			?�			

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.