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

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


�
�c@s	ddkZddkZddklZlZlZlZddklZl	Z	d�Z
d�Zgdd�Z
dd�Zdd�Zd	�Zd
�Zd�Zd�Zd
�Ze	d�Zd�Zd�Zd�Zd�Zd�Zdefd��YZdS(i�N(tmatchtpatchtutilterror(thextnullidcCsm|ddjod|}n|ddjo|d }ntii|�}|djodSn|dS(Nit/i�(tostpathtdirname(tptup((s*/sys/lib/python/mercurial/hgweb/webutil.pyR
s
cs1d�fd�������fd�}|S(Nc3si|o,|V|djo|djo	dVqEnd|Vd|Vx�|d�D]}|VqVWdS(Nii(i2iii
((tfactortlimittf(tseq(s*/sys/lib/python/mercurial/hgweb/webutil.pyRs
		c;sug}d}x��d��D]�}|�jp
||joqn|�joPn|}�|�jo1|id|t��|�i��f�n�|djo4|idd|t��|�i��f�qqWyrhdd<t�d�i��d<Vx+|D]#\}}h|d<|d<VqWhd	d<d	d<VWntij
onXdS(
Niis+%ds-%ds(0)tlabelt0tnodettip(tappendRRtinsertRt	RepoError(tmaptltlastRRR(tnodefuncRtposR
tpagelen(s*/sys/lib/python/mercurial/hgweb/webutil.pytnav#s*
18)(tNone(RRR
RR((RRRR
Rs*/sys/lib/python/mercurial/hgweb/webutil.pyt	revnavgensccsg}|D]$}|i�tjo||qq~}t|�djo|di�|jodSnx�|D]�}ht|i��d<|i�d<}|i�|d<|i�|d<|i�|d<|i�|d<t	|d	�o|i
�|d
<n|VqqWdS(NiiRtrevtusertdatetdescriptiontbranchRtfile(RRtlenR RR!R"R#R$thasattrR(tsiblingsthiderevt_[1]tstd((s*/sys/lib/python/mercurial/hgweb/webutil.pyt	_siblings=s8**cCst|i�|�S(N(R-tparents(tctxthide((s*/sys/lib/python/mercurial/hgweb/webutil.pyR.KscCst|i�|�S(N(R-tchildren(R/R0((s*/sys/lib/python/mercurial/hgweb/webutil.pyR1NscCs?|i�}|o(td|ddt|d��gSngS(NR%iRi(trenamedtdictR(tfctxtr((s*/sys/lib/python/mercurial/hgweb/webutil.pyt
renamelinkQs(cCs1g}|i|�D]}|h|d<q~S(Ntname(tnodetags(trepoRR*ti((s*/sys/lib/python/mercurial/hgweb/webutil.pytnodetagsdictWscCsRg}|i�}|i�i|�|i�jo|ih|d<�n|S(NR7(R$t
branchtagstgetRR(R9R/tbranchesR$((s*/sys/lib/python/mercurial/hgweb/webutil.pytnodebranchdictZs
"cCs_g}|i�}|djo<|i�i|�|i�jo|ih|d<�n|S(NtdefaultR7(R$R<R=RR(R9R/R>R$((s*/sys/lib/python/mercurial/hgweb/webutil.pytnodeinbranchds
/cCs=g}|i�}|djo|ih|d<�n|S(NR@R7(R$R(R/R>R$((s*/sys/lib/python/mercurial/hgweb/webutil.pytnodebranchnodefaultks

cks2x+|i|�D]}||d||�VqWdS(Nttag(R8(R9ttmpltt1Rtargstt((s*/sys/lib/python/mercurial/hgweb/webutil.pytshowtagrscCs%|id�}ti|id|�S(NRt(tlstripRt	canonpathtroot(R9R((s*/sys/lib/python/mercurial/hgweb/webutil.pyt	cleanpathvscCs�d}d|ijo|idd}n&d|ijo|idd}ny||}WnDtij
o5|i}||i|i|i|���}nX|S(NRRitmanifest(tformRRRNtlinkrevR tlookup(R9treqtchangeidR/tman((s*/sys/lib/python/mercurial/hgweb/webutil.pyt	changectxzs	*cCs�t||idd�}d|ijo|idd}n|idd}y|||}Wn+tij
o|i|d|�}nX|S(NR%iRtfilenodetfileid(RMRORRtfilectx(R9RRRRSR4((s*/sys/lib/python/mercurial/hgweb/webutil.pyRX�sccsXx/|| D]#}|ddt|�d|�VqWt|�|jo|d�VndS(NtfiledifflinkRR%tfileellipses(RR&(RDtfilesRtmaxR((s*/sys/lib/python/mercurial/hgweb/webutil.pyt
listfilediffs�s
!c#s�d�}|����fd�}|o"ti|i|i�|�}nti|i|i��}ti|idt�}|i	�}	|	o|	di
�pt}
|i
�}g}x�ti||
||d|�D]�}
|
i
d�o=|o6�dd|i�d	|d
i|���Vg}n|
i
d�o d
i|
it�d�}
n|i|
�q�W�dd|i�d	|d
i|���VdS(Ncss(d}xto|V|d7}q	WdS(Ni(tTrue(tstart((s*/sys/lib/python/mercurial/hgweb/webutil.pytcountgen�s
c
3s��i�}x�t|it��D]�\}}d||df}|id�o
d}n;|id�o
d}n!|id�o
d}nd	}�|d
|dd|d
d|�Vq"WdS(Ns%d.%dit+tdifflineplust-t
difflineminust@t
difflineattdifflinetlinetlineidsl%st
linenumbers% 8s(tnextt	enumeratet
splitlinesR^t
startswith(tdifftblocknotlinenoRtltype(t
blockcountRD(s*/sys/lib/python/mercurial/hgweb/webutil.pytprettyprintlines�s


	
t	untrusteditoptsRot	diffblocktparitytlinesRIi(RtexactRLtgetcwdtalwaysRtdiffoptstuiR^R.RRRoRnRktjoinRmR(R9RDR/R[RxR`RttmR}R.tnode1tnode2tblocktchunk((RDRss*/sys/lib/python/mercurial/hgweb/webutil.pytdiffs�s,		"
 tsessionvarscBs8eZdd�Zd�Zd�Zd�Zd�ZRS(t?cCs||_||_dS(N(R_tvars(tselfR�R_((s*/sys/lib/python/mercurial/hgweb/webutil.pyt__init__�s	cCs|i|S(N(R�(R�tkey((s*/sys/lib/python/mercurial/hgweb/webutil.pyt__getitem__�scCs||i|<dS(N(R�(R�R�tvalue((s*/sys/lib/python/mercurial/hgweb/webutil.pyt__setitem__�scCstti|i�|i�S(N(R�tcopyR�R_(R�((s*/sys/lib/python/mercurial/hgweb/webutil.pyt__copy__�sccsY|i}xI|ii�D]8\}}h|d<t|�d<|d<Vd}qWdS(NR7R�t	separatort&(R_R�t	iteritemststr(R�R�R�R�((s*/sys/lib/python/mercurial/hgweb/webutil.pyt__iter__�s
	&(t__name__t
__module__R�R�R�R�R�(((s*/sys/lib/python/mercurial/hgweb/webutil.pyR��s
			(RR�t	mercurialRRRRtmercurial.nodeRRRRRR-R.R1R6R;R?RARBRHRMRURXR]R�tobjectR�(((s*/sys/lib/python/mercurial/hgweb/webutil.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.