Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyc

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


�
��@snddkZddkZddklZlZlZlZlZlZddk	l
Z
ddklZl
Z
d�Zd�Zgdd�Zdd�Zdd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Ze
d�Ze
d�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#de$fd��YZ%deifd��YZ&dS(i�N(tmatchtpatchtscmutilterrortuitutil(t_(thextnullidcCsm|ddjod|}n|ddjo|d }ntii|�}|djodSn|dS(Nit/i�(tostpathtdirname(tptup((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyRs
c	s{d�fd��g}g}d}x��d|�D]�}||jp
||joq4n||joPn|}|||jo1|id|t|||�i��f�n||djo4|idd|t|||�i��f�q4q4W|id�y,|iddt|d�i��f�Wntij
onXd	�}td
||�d||��fS(
Nc3si|o,|V|djo|djo	dVqEnd|Vd|Vx�|d�D]}|VqVWdS(Nii(i2iii
((tfactortlimittf(tseq(sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyRs
		iis+%ds-%dttips(0)t0cs�fd�}|S(Nc;s2x+�D]#\}}h|d<|d<VqWdS(Ntlabeltnode((tmapRR(tl(sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyR:s((RR((RsF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytgen9stbeforetafter(RR(tNonetappendRRtinsertRt	RepoErrortdict(	tpostpagelenRtnodefunct	navbeforetnavaftertlastRR((RsF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt	revnavgens,
18
,	ccsg}|D]$}|i�tjo||qq~}t|�djo|di�|jodSnx�|D]�}h|i�d<|i�d<}|i�|d<|i�|d<|i�|d<|i�|d<t	i
|d	�o|i�|d
<n|VqqWdS(NiiRtrevtusertdatetdescriptiontbranchRtfile(RRtlenR(RR)R*R+R,RtsafehasattrR(tsiblingsthiderevt_[1]tstd((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt	_siblingsAs8*$cCst|i�|�S(N(R5tparents(tctxthide((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyR6OscCst|i�|�S(N(R5tchildren(R7R8((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyR9RscCs?|i�}|o(td|ddt|d��gSngS(NR-iRi(trenamedR R(tfctxtr((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt
renamelinkUs(cCs1g}|i|�D]}|h|d<q~S(Ntname(tnodetags(trepoRR2ti((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytnodetagsdict[scCs1g}|i|�D]}|h|d<q~S(NR>(t
nodebookmarks(R@RR2RA((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytnodebookmarksdict^scCsRg}|i�}|i�i|�|i�jo|ih|d<�n|S(NR>(R,t
branchtagstgetRR(R@R7tbranchesR,((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytnodebranchdictas
"cCs_g}|i�}|djo<|i�i|�|i�jo|ih|d<�n|S(NtdefaultR>(R,RERFRR(R@R7RGR,((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytnodeinbranchks
/cCs=g}|i�}|djo|ih|d<�n|S(NRIR>(R,R(R7RGR,((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytnodebranchnodefaultrs

cks2x+|i|�D]}||d||�VqWdS(Nttag(R?(R@ttmpltt1Rtargstt((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytshowtagyscks2x+|i|�D]}||d||�VqWdS(Ntbookmark(RC(R@RMRNRRORP((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytshowbookmark}scCs%|id�}ti|id|�S(NR	t(tlstripRt	canonpathtroot(R@R((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt	cleanpath�scCs�d}d|ijo|idd}n&d|ijo|idd}ny||}WnDtij
o5|i}||i|i|i|���}nX|S(NRRitmanifest(tformRRRYtlinkrevR(tlookup(R@treqtchangeidR7tman((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt	changectx�s	*cCs�t||idd�}d|ijo|idd}n|idd}y|||}Wn+tij
o|i|d|�}nX|S(NR-iRtfilenodetfileid(RXRZRRtfilectx(R@R]RR^R;((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyRc�sccsXx/|| D]#}|ddt|�d|�VqWt|�|jo|d�VndS(NtfiledifflinkRR-tfileellipses(RR.(RMtfilesRtmaxR((sF/sys/lib/python/lib/python2.5/site-packages/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�oR|oK|i�}�dd|i�d	|d
|di|�|��Vg}n|i
d�o-|djo di|it�d
�}n|i|�q�W|i�}�dd|i�d	|d
|di|�|��VdS(Ncss(d}xto|V|d7}q	WdS(Ni(tTrue(tstart((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytcountgen�s
c
3s�x�t|it��D]�\}}d||df}|id�o
d}n;|id�o
d}n!|id�o
d}nd	}�|d
|dd|d
d|�VqWdS(Ns%d.%dit+tdifflineplust-t
difflineminust@t
difflineattdifflinetlinetlineidsl%st
linenumbers% 8s(t	enumeratet
splitlinesRit
startswith(tdifftblocknotlinenoRtltype(RM(sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytprettyprintlines�s


	
t	untrusteditoptsRyt	diffblocktparityRztlinesRTtrawi(RtexactRWtgetcwdtalwaysRtdiffoptsRRiR6RRRyRxtnexttjoinRwR(R@RMR7RfR�tstyleRkt
blockcountR}tmR�R6tnode1tnode2tblocktchunkRz((RMsF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytdiffs�s0		"
 ccsftiti|i���}ti|�\}}}}}x#to||||||fVq?WdS(s3Generator function that provides the diffstat data.N(RtdiffstatdataRt	iterlinesRytdiffstatsumRi(R7tstatstmaxnametmaxtotaltaddtotaltremovetotaltbinary((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytdiffstatgen�s
cCs;|i�\}}}}}}td�t|�||fS(s#Return a short summary of the diff.s5 %d files changed, %d insertions(+), %d deletions(-)
(R�RR.(tstatgenR�R�R�R�R�R�((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytdiffsummary�s	c#s�|i�\}}�}}}|i�}	�fd�}
d}x�|D]�\}}
}}||	jodpd}|
|}|d7}||d|i�d|d|d	|d
|
|
�d|
|�d|i��VqFWd
S(s5Return a diffstat template for each file in the diff.cs'�djodSnt|��dS(Niid(tfloat(RA(R�(sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytpct�s
itdiffstatlinktdiffstatnolinkiRR-tfilenottotaltaddpctt	removepctR�N(R�RfR(RMR7R�R�R�R�R�R�R�RfR�R�tfilenametaddstremovestisbinaryttemplateR�((R�sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pytdiffstat�s

!tsessionvarscBs8eZdd�Zd�Zd�Zd�Zd�ZRS(t?cCs||_||_dS(N(Rjtvars(tselfR�Rj((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt__init__�s	cCs|i|S(N(R�(R�tkey((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt__getitem__�scCs||i|<dS(N(R�(R�R�tvalue((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt__setitem__scCstti|i�|i�S(N(R�tcopyR�Rj(R�((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt__copy__sccsY|i}xI|ii�D]8\}}h|d<t|�d<|d<Vd}qWdS(NR>R�t	separatort&(RjR�t	iteritemststr(R�R�R�R�((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt__iter__s
	&(t__name__t
__module__R�R�R�R�R�(((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyR��s
			twsgiuicBseZd�ZRS(cCsdS(NiP((R�((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyt	termwidth
s(R�R�R�(((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pyR�s('R
R�t	mercurialRRRRRRtmercurial.i18nRtmercurial.nodeRRRR'RR5R6R9R=RBRDRHRJRKRQRSRXR`RcRhR�R�R�R�tobjectR�R�(((sF/sys/lib/python/lib/python2.5/site-packages/mercurial/hgweb/webutil.pys<module>	s4.	
	)				
					
		1			

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.