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

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


��c@s�ddlmZddlmZddlmZmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZd�Zd�Zdd�Z ied6e	d	6ed
6e
d6e
d6ed
6ed6Z!d�Z"d�Z#d�Z$e%d�Z&de%d�Z'e%d�Z(d�Z)de*d�Z+d�Z,de%de*e%dd�Z-d�Z.d�Z/d�Z0e0Z1e*d�Z2de*d�Ze%d�Z3d �Z4d!�Z5d"�Z6d#�Z7d$�Zd%�Z8dS(&i�(t_(trelease(thextnullidNcCs4tjtj|��}tjj|�r0tp3tS(N(tutilt
expandpathturllocalpathtostpathtisfilet
bundlerepot	localrepo(R((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt_localsc
s3|j�}|\}}|rF|rF�p/d�r?�dpBdfS�rXt��p[g�|jd�s�|r�tjtd���n�j|���dfS|j�����fd�}x6|D].}||�s�t	j
td�|��q�q�W|r%||�s%�j|�q%n��dfS(Nit	branchmaps"remote branch lookup not supportedcsu|dkr<�s*tjtd���n�jj�}n|�krm�jd�t�|�D��tStSdS(Nt.sdirstate branch not accessiblecss|]}tj|�VqdS(N(tnodeR(t.0tr((s0/sys/lib/python2.7/site-packages/mercurial/hg.pys	<genexpr>*s(	RtAbortRtdirstatetbranchtextendtreversedtTruetFalse(R(R
tlrepotrevs(s0/sys/lib/python2.7/site-packages/mercurial/hg.pytprimary$s!sunknown branch '%s'(tpeertNonetlisttcapableRRRtappendR
terrortRepoLookupError(RtothertbranchesRRt
hashbranchRR((R
RRs0/sys/lib/python2.7/site-packages/mercurial/hg.pyt
addbranchrevss& 

 cCsOtj|�}d}|jr3|j}d|_nt|�||pHgffS(s5parse url#branch, returning (url, (branch, branches))N(RturlRtfragmenttstr(RR$tuR((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytparseurl7s		tbundletuniontfilethttpthttpstsshsstatic-httpcCs^tj|�}|jpd}tj|�p4td}y||�SWntk
rY|SXdS(NR.(RR'tschemetschemestgett	TypeError(RR*R2tthing((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt_peerlookupKs
cCsHt|t�r>yt|�j|�SWq>tk
r:tSXn|j�S(s$return true if repo or path is local(t
isinstanceR)R7tislocaltAttributeErrorRtlocal(trepo((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyR9Ts
cCs9t|�r%tjtj|�d�Stj||�SdS(s0open path with open if local, url.open if remotetrbN(R9Rt	posixfileRR'topen(tuiR((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytopenpath]scCsvt|�j|||�}t|d|�}xBtj�D]4\}}t|dd�}|r:|||�q:q:W|S(s1return a repository object for the specified pathR@t	reposetupN(R7tinstancetgetattrt
extensionsR(R@Rtcreatetobjtnametmodulethook((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt_peerorrepodstcCsYt|||�}|j�}|sLtjtd�|pB|j���n|jd�S(s1return a repository object for the specified pathsrepository '%s' is not localtvisible(RKR;RRRR'tfiltered(R@RRFRR<((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt
repositorynscCs%t||�}t|||�j�S(s/return a repository peer for the specified path(tremoteuiRKR(tuiorrepotoptsRRFtrui((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRwscCs.tjjtjjtj|�jp'd��S(s4return default destination of clone if none is givenRL(RRtbasenametnormpathRR'(tsource((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytdefaultdest|scCs�t|�s$tjtd���n|s9t|�}n|j|�}t|t�r�|j|�}t|�\}}t	||�}t
|||d�\}}n"|j�}|j
�}}d}|j}	tjj|�}
tjj|
d�}tjj|�r!tjtd���ntjj|
�sCtj|
�ntj|dt�d}y|jjd�}Wn+tk
r�}
|
jtjkr��q�nX|d7}tjtjj|d�|�tjtjj|d�|	�t	||
�}|jjd	d
�}|rU|jddd
t�}|j d�|j d|�|j!�n|r�jj"td��|tk	r�|}nxW|d
dfD]F}|dkr�q�ny|j#|�}PWq�t$j%k
r�q�q�Xq�Wt&||�ndS(screate a shared repositorys!can only share local repositoriess.hgsdestination already existst
notindexedRLtrequiressshared
t
sharedpathtpathstdefaultthgrctwttexts[paths]
s
default = %s
supdating working directory
ttipN('R9RRRRWRR8R)R+ROR&RR;R'RZRRtrealpathtjointexiststisdirtmkdirtmakedirRtopenertreadtIOErrorterrnotENOENTt	writefileR@tconfigtwritetclosetstatustlookupR!R"t_update(R@RVtdesttupdatet
origsourceR$tsrcrepotrevtcheckoutRZtroottroothgtrequirementstinstRR\tfpttesttuprev((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytshare�sd	



	cCsd	}y^d	}d}|jjddt�}x|jj�D]�|r^|jd�r^q=ntjj	|j
|�}tjj	||�}	tjj|	�}
|
r�tjj|
�r�tj
|
�ntjj|�r=|	jd�rtjtjj	|
d��}ntj||	|�\}}||7}q=q=W|rN|jd|�n|jd|�|SWnt|��nXd	S(
sGcopy files from store of srcrepo in destpath

    returns destlock
    itphasestpublisht
phaserootstdatatlockslinked %d files
scopied %d files
N(RR@t
configboolRtstoretcopylisttendswithRRRbRZtdirnameRcReR�Rt	copyfilestdebugR(R@Rvtdestpathtdestlockthardlinktnumt
srcpublishingtftsrctdsttdstbasetn((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt	copystore�s2!
c	'Cs�t|t�rH|j|�}	t|	|�\}}t|||�}
n.|j�}
d(|p`gf}|
j�}	}t|
|
||�\}}|d(kr�t|�}|j	t
d�|�n|j|�}tj|�}tj|�}|stj
t
d���ntjj|�r|tjj|�sNtj
t
d�|��q|tj|�r|tj
t
d�|��q|nd(}}
}|
j�}z�|	}t|	�r�tjjtj|	��}nt|�r�|}nt}|r#|j�r#t|�r#tj|�r#|o|}n|r_y|jdt�}Wq_tjk
r[t}q_Xn|r�jddtdd	�tjjtjj |d
��}tjj|�s�tj!|�n|}y|}tj"|dt�WnJt#k
r0}|j$t$j%kr*d(}tj
t
d�|��n�nXt&|||�}
tjj |d�}|j'd
�}tjj |d�}tjj|�r�tjj|�s�tj!|�ntj(||�nt|||�}|jddd	dt)j*t)j+��n0y"t|p|||dt�}WnJt#k
rk}|j$t$j%kred(}tj
t
d�|��n�nXd(}|r�|
j,d�s�tj
t
d���ng|D]}|
j-|�^q�}|d}n|j�r�j�j.|
d|d|�n1|r|j/|d|�ntj
t
d���d(}|j�}|r�|
j,d�r�|
j0d�}|j1}xN|j2�D]@\}}y|j-|�} | ||<Wqytj3k
r�qyXqyW|r'|j4�q'nT|r'|j,d�r'x<|j1j2�D](\}}|j5d|dt*|��q�|r,|j6dddt�}!|!j4d�tj|�}"d(|"_7t|"�}#|!j4d |#�|!j8�|j9j:d!d"|#�|r,|tk	r�|
j-|�}nd(}$d(}%|d(k	ry|j-|�}$Wqtj3k
rqXn|$d(kr�yR|j1d#}$d#}||$j;�}&|&d"kr]t
d$�}%nt
d%|&�}%Wq�t<k
r�y|j=d"�}$Wq�tj3k
r�|j-d&�}$q�Xq�Xn|%s�|$j;�}&t
d'�|&}%n|j9j	|%�t>||$�||j1kr)t?j@||�q)q,n|
|fSWd(tA||
�|d(k	rftBjC|t�n|
d(k	r|
j8�nXd(S()sIMake 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 peers, 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)

    branch: branches to clone
    sdestination directory: %s
s#empty destination path is not validsdestination '%s' already existssdestination '%s' is not emptytwaittpreoutgoingtthrowRVtclones.hgRXtcachescache/branchheadstbranchheadstoutgoingRRFRqsXsrc repository does not support revision lookup and so doesn't support clone by revisionitheadststreamRs)clone from remote to remote not supportedtpushkeyt	bookmarksRLR]R^R_s[paths]
s
default = %s
R[R\t@supdating to bookmark @
s$updating to bookmark @ on branch %s
R`supdating to branch %s
N(DR8R)RR+RRR'R&RWRpRRRRRRRcRdtlistdirR;R9tabspathRtcancopyR�t	hassecretR�R!t	LockErrorRJRRaRbReRftOSErrorRjtEEXISTR�tsjointcopyfileRRRRRqR�tpushtlistkeyst
_bookmarkst	iteritemsR"RnR�RgtpasswdRoR@t	setconfigRtKeyErrort	branchtipRrR�t
setcurrentRtshutiltrmtree('R@tpeeroptsRVRstpullRwRtR�RRutsrcpeerRxtsrclockR�tcleandirRvR�tcopythgdirR�R|tdstcachedirtsrcbranchcachetdstbranchcachetdestpeerRRtdestrepoR=tmarkstkR�tmR}R*t
defaulturlRRptbn((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyR��s"%	
!
"
"
"	#
	




cCs|jjtd�|�dS(NsI%d files updated, %d files merged, %d files removed, %d files unresolved
(R@RpR(R<tstats((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt
_showstats�scCstj||t|d�S(s�Update the working directory to node.

    When overwrite is set, changes are clobbered, merged else

    returns stats (see pydoc mercurial.merge.applyupdates)N(tmergemodRtRR(R<Rt	overwrite((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt
updaterepo�scCsPt||t�}t||�|drB|jjtd��n|ddkS(s<update the working directory to node, merging linear changesis1use 'hg resolve' to retry unresolved file merges
i(R�RR�R@RpR(R<RR�((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRt�s


cCs6t||t�}|r(t||�n|ddkS(sAforcibly switch the working directory to node, clobbering changesii(R�RR�(R<Rt
show_statsR�((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytclean�scCsxtj||t|t�}t||�|drK|jjtd��n|rj|jjtd��n|ddkS(sWBranch merge with node, resolving changes. Return true if any
    unresolved conflicts.isPuse 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
s'(branch merge, don't forget to commit)
i(R�RtRRR�R@RpR(R<RtforcetremindR�((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytmerge�s

cCsCt|j|�|jd��\}}t|||�}|jtd�tj|��t||||jd��\}	}
|	r�g|	D]}|j	|�^q�}	nt
j||||	|d|d�\}}}
zV|s�jtd��|�Stj
||||�}||||�|j�Wd|
�X|�dS(	s�
    Helper for incoming / gincoming.
    displaychlist gets called with
        (remoterepo, incomingchangesetlist, displayer) parameters,
    and is supposed to contain only code that can't be unified.
    Rscomparing with %s
RwR,R�sno changes found
Ni(R+RR4RRpRRthidepasswordR&RqR
tgetremotechangestcmdutiltshow_changesetRo(t
displaychlisttsubreporecurseR@R<RVRRtbufferedR$R#RRxRwtchlistt	cleanupfnt	displayer((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt	_incoming�s$' $% cs@����fd�}�fd�}t||�����S(Ncsmd}�jd�ri�d}xGt|j�D]3}|j|�}t||j�����}q/Wn|S(Nitsubrepos(R4Rtsortedtsubstatetsubtmintincoming(trettctxtsubpathR�(RRR<RVR@(s0/sys/lib/python2.7/site-packages/mercurial/hg.pyR�s
%cs�tj��}�jd�r+|j�nd}x�|D]�}|dk	rZ||krZPng|jj|�D]}|tkrm|^qm}�jd�r�t|�dkr�q8n|d7}|j	||�q8WdS(Ntnewest_firstit	no_mergesii(
R�tloglimitR4treverseRt	changelogtparentsRtlentshow(R#R�R�tlimittcountR�tpR�(RR(s0/sys/lib/python2.7/site-packages/mercurial/hg.pytdisplays

1!
(R�(R@R<RVRRR�R�((RRR<RVR@s0/sys/lib/python2.7/site-packages/mercurial/hg.pyR�
s	
c	Cs#|j|pd|pd�}t||jd��\}}|jtd�tj|��t||||jd��\}}|r�gtj	||�D]}|j
|�^q�}nt|||�}tj
|j�||d|jd��}	|	j}
|
stj|j||	j�dS|
S(Nsdefault-pushR\Rscomparing with %s
RwR�(RR+R4RpRRR�R&tscmutiltrevrangeRqRt	discoverytfindcommonoutgoingt
unfilteredtmissingtnochangesfoundR@texcludedR(R@R<RsRRR$RRxRwR#R�to((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt	_outgoing&s $1	cs;����fd�}tj��}t�����}|dkrO|�S�jd�rk|j�ntj����}d}x�|D]�}	|dk	r�||kr�Png�jj|	�D]}
|
t	kr�|
^q�}�jd�rt
|�dkrq�n|d7}|j�|	�q�W|j�|�dS(Ncsmd}�jd�ri�d}xGt|j�D]3}|j|�}t||j�����}q/Wn|S(NiR�(R4RR�R�R�R�R�(R�R�R�R�(RsRRR<R@(s0/sys/lib/python2.7/site-packages/mercurial/hg.pytrecurse8s
%R�iR�ii(
R�R�R�RR4R�R�R�R�RR�R�Ro(R@R<RsRRR�R�R�R�R�R�R�R�((RsRRR<R@s0/sys/lib/python2.7/site-packages/mercurial/hg.pyR�7s(	

1!

cCs#tj||tt|�ddkS(s<revert changes to revision in node without updating dirstateii(R�RtRR(R<Rtchoose((s0/sys/lib/python2.7/site-packages/mercurial/hg.pytrevertVscCs
tj|�S(s&verify the consistency of a repository(t	verifymodtverify(R<((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRZsc	Cs4tj|d�r-|jj�}|j}n|j�}xKdD]C}|j|�pd|jd|�}|r@|jd||�q@q@W|jdd�}|r�|jdd|�nxAd
D]9}x0|j|�D]\}}|j|||�q�Wq�W|jd
d�}|r0|jd
dtj	|��n|S(s*build a remote ui from ui or repo and optstbaseuiR1t	remotecmdR@R,tmainreporoottauththostfingerprintst
http_proxytwebtcacerts(R1R(RRR(
RtsafehasattrRR�R@R4RmR�tconfigitemsR(	R�RRR�R�tvRtsecttkeytval((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyRP^s$
!
(9ti18nRR�RRRRRR
t	unionrepothttppeertsshpeertstatichttprepoR�RRER!R�R�R'R�R�R�R�RRRjRR�RR&RR+R3R7R9RARRKRORRWRR�R�R�R�R�RtRrR�R�R�R�R�R�RP(((s0/sys/lib/python2.7/site-packages/mercurial/hg.pyt<module>	sVHl$		 

					
		C	!	�			
!					

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.