m RDc @sdklZdklZdkTeedhdd<dd<dd<d d <d d d?<d@e<dAdB<dCdD<dEe<dFe<dGdH<dIdJ<dKdLs4 #     )#cCs ||ijS(N(R.RR(RR.((Rt __contains___scKs|ii}|i|y|i|}Wnt j o{y(t |i|i }|i|sY[#{]([a-zA-Z_][a-zA-Z0-9_]*)((%[a-zA-Z_][a-zA-Z0-9_]*)*)((\|[a-zA-Z_][a-zA-Z0-9_]*)*)[#}]cks|i}x|o|ii|} | o| id\} }|| ||d} }| i d}| djo |djp| djo0|djo#ttd| ||fn| o || Vn|i|d} t| o | |p| } | i d}| i d }|oE| i} x/| D]$}|i|||d|Vq@Wd} n:|o2x/|id dD]}||| } qWn| V||}q|VPqWdS( Niit#t{t}s!'%s'/'%s' mismatch expanding '%s'Riit|(RRtlmR6Rt template_retsearchR,tspantstarttendR tetgroupR.R R RRtcallabletformattflt__iter__tqR&R5tsplittfR$(RR6R$RRMRDR.R&R?R,RCR RKRRHRERI((RRvs> 4#      ( t__name__t __module__t__doc__R3R4R:R*tcompileR@R(((RR*s !  tseconditminutei<thouritdayitweekitmonthityearimc sdd}ti}|d}tdt||}xIt D]A\}}||}|djp |djo|||SqKqKWdS(s3turn a (timestamp, tzoff) tuple into an age string.cCs|djo|Sn|dS(NiR (RR(RR((Rtplurals csd|||fS(Ns%d %s(RRYR(RR(RY(RtfmtsiiiN( RYRZttimetnowtdatetthentmaxtinttdeltat agescalesRR R( R]R^RZRaRR RR\RY((RYRtages      cs/tid|iS(s*turn nested template iterator into string.cs@x9|D]1}t|do|qi|qWdS(NRJ(tthingsRthasattrtwalktcsR(RdR(RgRf(RRfs N(RRRgRftthingR(RhRgRf((RgRfRt stringifys   cstdjo(tidtiatidand}ti}xI|D]>\}}|i ti dti|||i |qWW|iS(sfill many paragraphs.s( | \s*[-*]\s*)s +c#sd}xtoti|}|pZt}x1||jo#|dio|d8}q8W||!|fVPn||id!|i dfV|i d}q WdS(Nii( RCRtpara_reRAttextR,R twtisspaceRFRD(R,RCRl(Rk(Rt findparass "#t N(RjtNoneR*RQtMtspace_reRnRRRtparatrestRtsubttextwraptfilltwidthR(RkRxRRsRtRn((RkRRws   %cCs<y|iddidSWntj o dSnXdS(sreturn the first line of textiis RN(Rkt splitlinestrstript IndexError(Rk((Rt firstlines cCsti|ddS(s?turn a (timestamp, tzoff) tuple into an iso 8631 date and time.RHs%Y-%m-%d %H:%MN(tutiltdatestrR](R]((RtisodatescCsd|S(s:turn a (timestamp, tzoff) tuple into an hg cset timestamp.s%d %dN(R](R]((RthgdatescCs|iddS(s,replace raw newlines with xhtml line breaks.s s
N(Rktreplace(Rk((Rtnl2brscCsDt|dd}dig}|D]}|dt|q#~S(Nsutf-8RRs&#%d;(tunicodeRkR2t_[1]Rtord(RkRR((Rt obfuscatescCs`|id}|djodSn||d}|id}|djo|| }n|S(s.get domain of author, or empty string if none.t@iRit>iN(tauthortfindRM(RRM((Rtdomains  cCs>|id}|djo d}n||idd|!S(sget email of author.Rit!sRRRcCsti|tS(N(tcgiRRR(R((RR$stfill68cCst|ddS(NRxiD(RwR(R((RR%stfill76cCst|ddS(NRxiL(RwR(R((RR&sR|t tabindentcCs t|dS(Ns (RR(R((RR(sRRRt permissionscCs|odpdS(Ns -rwxr-xr-xs -rw-r--r--(R(R((RR,sRt rfc822datecCsti|dS(Ns%a, %d %b %Y %H:%M:%S(R}R~R(R((RR.stshortcCs|d S(Ni (R(R((RR/sRRiR)cCs |iS(N(RR)(R((RR2st urlescapecCs ti|S(N(turllibtquoteR(R((RR3stusercCs ti|S(N(R}RR(R((RR4scCsttdo ti}nt}xdD]}|id}|o|i |nt i i t i i ||}|ot i i|pt i i|ot i i|Sq*q*WdS(sZreturn location of template file or directory (if no name). returns None if not found.tfrozent templatess ../templatest/N(Rs ../templates(Retsyst executabletmodulet__file__RMRLRItnametappendR R!R2R"tptexiststisdirtnormpath(RRMRRRI((Rt templatepath7s !-tchangeset_templatercBsMtZdZedZdZedZdZdeeedZ RS(sformat changeset information.cCsIt|tdhdd<dd<|_||_||_||_dS(NRtparents{rev}:{node|short} tmanifests{rev}:{node|short}(RRtcommon_filtersRRtuitdesttrepo(RRRRR((RR3Js  !  cCs||iidc+s1x*dii|D] }|VqWdS(NR(RRRtnodetagsRR1R(R1R(RRR(Rtshowtagssic+s)x"dd|D] }|VqWdS(NR'i(RtfilesR1R(R1R(RR(Rt showfilessc+s)x"dd|D] }|VqWdS(Ntfile_addi(RRR1R(R1R(RR(Rtshowaddssc+s)x"dd|D] }|VqWdS(Ntfile_deli(RRR1R(R1R(RR(Rtshowdelssc+s)x"dd|D] }|VqWdS(NR'i(RRR1R(R1R(RR(RRsRiRR]itdescit file_addst file_delsRRRRRttagst header_debugt header_quiettheader_verboseRtchangeset_debugtchangeset_quiettchangeset_verboseRs%s: no key named '%s's%s: %sN(*RRt changelogRRRpRRRR8RRRRRRRRRRRRRRtdefpropstpropsRR5RR.tquiettverboseRRR7R0R}tAbortR RR1R (RRRRRRRRRRRRRR.RRRR0R((RRRRRRRRRtshowesh   =   "         0( RNRORPRpR3RRRRR(((RRGs    tstringiocBs/tZdZdZdZeZdZRS(s.wrap cStringIO for use by changeset_templater.cCsti|_dS(N(RRRR(R((RR3 scGs%x|D]}|ii|qWdS(N(R1RRRR(RR1R((RR scCst|i|S(N(tgetattrRRR.(RR.((Rt __getattr__s(RNRORPR3RRR(((RRs   N(RRi(RSi<(RTi($t demandloadti18ntgettextR RtglobalsRRRtobjectRRbtreverseRcRiRpRjRrRwR|RRRRRRRRRR R!RRRRR(RRRRRR|RiRbRRwRRRRRRRR RRcRRR((Rt?s6  3 qO