³ò ø$•Jc@s ddkZddkZddklZlZlZlZddklZl Z d„Z d„Z gdd„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ƒƒdR$((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|ƒVq Wt|ƒ|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 |d d |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,  "    t sessionvarscBs8eZdd„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| s&" &           0