HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python2.7/dist-packages/mercurial/templater.pyc

Xc@@sddlmZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZmZm
ZmZmZmZidddddfd
6dddddfd
6dddddfd6dddddfd6dd6dddddfd6dddddfd6dddddfd6dddddfd6dd6dd6dd6dd6dd6ZddZd d!Zd"Zd#Zd$Zd%Zd&Zd'Zd(Zd)Zd*Zd+Zd,Z d-Z!d.Z"d/Z#d0Z$d1Z%d2Z&d d3Z'd4Z(d5Z)d6Z*d7Z+d8Z,d9Z-d:Z.d;Z/d<Z0d=Z1d>Z2iZ3ej4e3Z4e4d?d@Z5e4dAdBZ6e4dCdDZ7e4dEdFZ8e4dGdHZ9e4dIdJZ:e4dKdLZ;e4dMdNZ<e4dOdPZ=e4dQdRZ>e4dSdTZ?e4dUdVZ@e4dWdXZAe4dYdZZBe4d[d\ZCe4d]d^ZDe4d_d`Z
e4dadbZEe4dcddZFe4dedfZGe4dgdhZHe4didjZIe4dkdlZJe4dmdnZKi
dod6dpd6dqd6e(d6drd6e*d6e,d6e2d	6dsd6dtd6e.d6dud6dvd6ZLeLjMZNeLdeNd<dwejOfdxYZPdyZQejRZRdzZSd{ZTd|eUfd}YZVieVd~6ZWdZXdZYde	jZfdYZ[deUfdYZ\dZ]dZ^ddZ_dZ`e3jaZbdS(i(tabsolute_importNi(t_(	tconfigterrortminirsttparsert	registrartrevsetttemplatefilterst
templatekwtutilitgroupt)tfunct(itlistt,it|it%it+tnegatei
t-it*t/tintegertsymboltstringttemplatetendcc@s+|}x||kr||}|jr.n|dkrK|d|fVn|dkr|d}t||||\}}d||fV|d8}nS|dkrY|||d!dkrY||d}|d}}x||kr=||}|d	kr|d7}qn||kr0d
|||!|fVPn|d7}qWtjtd|n|jr|}x4||kr||}|jsPn|d7}qnWd|||!|fV|d8}n&|d	kr|||d!dks
|dkr|||d!dkr|dkr)|d7}d
}	nd}	|||d!}
|d}}x||kr|jd||r|d7}qQn|j|
||rtj	|||!}|	dkrt|dt
|d}n|	||fV|d7}Pn|d7}qQWtjtd|n|js5|dkr|}|d7}x@||kr||}|jps|dkszPn|d7}qHW|||!}d||fV|d8}n:||krdd|dfVdStjtd||d7}q	W|rtjtd|ndd|fVdS(s^Parse a template expression into a stream of tokens, which must end
    with term if specifieds	(,)%|+-*/s"'iRtrisr'sr"s\Rsunterminated stringRs\'s\"isr\'sr\"s\\\iiRRRNssyntax errorsunterminated template expansion(sr'sr"(s\'s\"(sr\'sr\"(tisspacetNonet_parsetemplateRt
ParseErrorRtisdigitt
startswithRtunescapestrtlentisalnum(tprogramtstartRttermtpostctstdatatdttokentquotetsym((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyttokenize/s


#



##
	





tc@sg}d|}|tjt}xnkrtfd|Ddd}|dkr|jdtj!fPn|}|t|!jd}	|	dd	kr|jdtj|d	!|f|d	q(n|krC|jdtj|!fn||kr]||d	fS|jt|d	d
\}
|j|
q(W|rt	j
td|n|fS(s
    >>> _parsetemplate('foo{bar}"baz', 0, 12)
    ([('string', 'foo'), ('symbol', 'bar'), ('string', '"baz')], 12)
    >>> _parsetemplate('foo{bar}"baz', 0, 12, quote='"')
    ([('string', 'foo'), ('symbol', 'bar')], 9)
    >>> _parsetemplate('foo"{bar}', 0, 9, quote='"')
    ([('string', 'foo')], 4)
    >>> _parsetemplate(r'foo\"bar"baz', 0, 12, quote='"')
    ([('string', 'foo"'), ('string', 'bar')], 9)
    >>> _parsetemplate(r'foo\\"bar', 0, 10, quote='"')
    ([('string', 'foo\\')], 6)
    t{c3@s$|]}j|VqdS(N(tfind(t.0R+(R*tstopttmpl(s7/usr/lib/python2.7/dist-packages/mercurial/templater.pys	<genexpr>stkeycS@s|dk|fS(Ni((tn((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt<lambda>siRs\iit}sunterminated string(RtelementstmintappendR$R%trstriptparseR2RR!R(R8R(R7R0tparsedtsepcharstpR:R+tbstparseres((R*R7R8s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR s4

#
$+
&(cC@st|ts|S|d}|dkrH|ftd|dDSt|dks`ttd|dD}|sd
St|dkr|dddkr|dS|f|Sd	S(s+Expand list of templates to node tuple

    >>> def f(tree):
    ...     print prettyformat(_unnesttemplatelist(tree))
    >>> f(('template', []))
    ('string', '')
    >>> f(('template', [('string', 'foo')]))
    ('string', 'foo')
    >>> f(('template', [('string', 'foo'), ('symbol', 'rev')]))
    (template
      ('string', 'foo')
      ('symbol', 'rev'))
    >>> f(('template', [('symbol', 'rev')]))  # template(rev) -> str
    (template
      ('symbol', 'rev'))
    >>> f(('template', [('template', [('string', 'foo')])]))
    ('string', 'foo')
    iRcs@s|]}t|VqdS(N(t_unnesttemplatelist(R6tx((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pys	<genexpr>siics@s|]}t|VqdS(N(RG(R6RH((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pys	<genexpr>sRR3N(RR3(t
isinstancettupleR%tAssertionError(ttreetoptxs((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRGs
&cC@sLt|dt|\}}|t|ks<tdtd|fS(sParse template string into treeis$unquoted template should be consumedR(R R%RKRG(R8RBR*((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRAscC@smtjt}|jt|dt|\}}|t|krctjtd|nt|S(sParse a template expression into tree

    >>> _parseexpr('"foo"')
    ('string', 'foo')
    >>> _parseexpr('foo(bar)')
    ('func', ('symbol', 'foo'), ('symbol', 'bar'))
    >>> _parseexpr('foo(')
    Traceback (most recent call last):
      ...
    ParseError: ('not a prefix: end', 4)
    >>> _parseexpr('"foo" "bar"')
    Traceback (most recent call last):
      ...
    ParseError: ('invalid token', 7)
    is
invalid token(	RR=RAR2R%RR!RRG(texprRDRLR*((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt
_parseexprs
'cC@stj|dS(NRRR(RRR(Rtprettyformat(RL((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRQscC@sD|d}||kr'||||Stjtd|dS(s1Compile parsed template tree to (func, data) pairisunknown method '%s'N(RR!R(texptcontextt
curmethodstt((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt
compileexps
cC@s9|ddkr|dStjtd|ddS(NiRisexpected a symbol, got '%s'(RR!R(RR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt	getsymbolscC@s:|s
gS|ddkr3t|d|dgS|gS(NiRii(tgetlist(RH((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRXs
cC@sZ|ddkr t||tS|ddkrA|j|dStjtddS(	s_Compile given template tree or load named template from map file;
    returns (func, data) pairiRRRisexpected template specifierN(RR(RVtmethodst_loadRR!R(RRRS((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytgettemplates
cC@sC|\}}||||}t|tjr?t|}n|S(N(RIttypest
GeneratorTypet	stringify(RStmappingtargR
R-tthing((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytevalfuncargs
cC@s|\}}|tkrQ||||dd}|dkrctj|}qcn||||}t|trv|Stt|S(sCEvaluate given argument as boolean, but also takes boolean literalstdefaultN(t	runsymbolRR
t	parseboolRItboolR^(RSR_R`R
R-Ra((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytevalboolean#scC@sMt|||}yt|SWn&ttfk
rHtj|nXdS(N(Rbtintt	TypeErrort
ValueErrorRR!(RSR_R`terrtv((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytevalinteger3s
cC@s"|\}}t||||S(N(R^(RSR_R`R
R-((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt
evalstring:scC@sO|\}}|tkr3||||d|}n||||}t|S(sXEvaluate given argument as string template, but returns symbol name
    if it is unknownRc(RdR^(RSR_R`R
R-Ra((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytevalstringliteral>s
cC@s
t|S(N(Rh(RSR_R-((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt
runintegerHscC@s|S(N((RSR_R-((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt	runstringKsc@sfd}|S(Nc@stjtddS(Ns$recursive reference '%s' in template(RtAbortR(targs(R9(s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt
showrecursionOs((R9Rt((R9s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt_recursivesymbolblockerNscC@stjtd|dS(Ns$recursive reference '%s' in template(RRrR(RSR_R9((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt_runrecursivesymbolSscC@s|j|}|dkr0|jj|}n|dkr|j}t|||<y|j||}Wqtk
r|}qXnt|r||S|S(N(tgetRt	_defaultstcopyRutprocesstTemplateNotFoundtcallable(RSR_R9RcRltsafemapping((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRdVs


cC@s3g|dD]}t||t^q}t|fS(Ni(RVRYtruntemplate(RRRStetctmpl((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt
buildtemplategs)cc@s,x%|D]\}}||||VqWdS(N((RSR_RR
R-((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR~kscC@st|d|t}t|d}||jkrR|j|}t||ffS|tkrut|}||gfStjtd|dS(Niisunknown function '%s'(	RVRYRWt_filterst	runfiltertfuncsRR!R(RRRSR`R:tfilttf((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytbuildfilteros


cC@s|\}}t|||}y||SWnjtttfk
rt|dtri|dd}n
|d}tjtd|j	|fnXdS(Nis8template filter '%s' is not compatible with keyword '%s'(
RbRjtAttributeErrorRiRIRJRRrRt	func_name(RSR_R-R`RRatdt((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRzs
cC@sKt|d|t\}}t|d|\}}t||||ffS(Nii(RVRYR[trunmap(RRRSR
R-ttfuncttdata((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytbuildmapsc
c@s|\}}}}||||}tj|drE|j}neyt|}WnRtk
r|tkrtjtd|qtjtd|nXxb|D]Z}|j	}	t
|tr|	j||j
d|	d<|||	|Vq|VqWdS(Ntitermapsskeyword '%s' is not iterables%r is not iterabletnodetoriginalnode(R
tsafehasattrRtiterRiRdRR!RRyRItdicttupdateRw(
RSR_R-R
RRR.tditertitlm((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRs"


cC@s t|d|t}t|fS(Ni(RVtexprmethodst	runnegate(RRRSR`((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytbuildnegatescC@s t|||td}|S(Ns"negation needs an integer argument(RmR(RSR_R-((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRscC@s?t|d|t}t|d|t}t|||ffS(Nii(RVRt
runarithmetic(RRRSR
tlefttright((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytbuildarithmeticscC@s|\}}}t|||td}t|||td}y|||SWn&tk
r~tjtdnXdS(Ns#arithmetic only defined on integerssdivision by zero is not defined(RmRtZeroDivisionErrorRRr(RSR_R-R
RR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRs
cC@st|d}gt|dD]}t||t^q!}|tkr_t|}||fS||jkrt|dkrtjt	d|n|j|}t
|d|ffStjt	d|dS(Niisfilter %s expects one argumentisunknown function '%s'(RWRXRVRRRR%RR!RR(RRRSR:RHRsR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt	buildfuncs/


sdate(date[, fmt])cC@sdt|kodkns:tjtdnt|||d}d}t|dkrt|||d}ny-|dkrtj|Stj||SWn,t	t
fk
rtjtdnXdS(sFormat a date. See :hg:`help dates` for formatting
    strings. The default is a Unix date format, including the timezone:
    "Mon Sep 04 15:13:13 2006 0700".iis!date expects one or two argumentsisdate expects a date informationN(R%RR!RRbRRnR
tdatestrRiRj(RSR_Rstdatetfmt((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRs"
s)diff([includepattern [, excludepattern]])c@stdkr*tjtdnfd}d}|jd|jg|d|d}dj|S(	sCShow a diff, optionally
    specifying files to include or exclude.is(diff expects zero, one, or two argumentsc@sB|tkr>t|j}|r>|gSngS(N(R%Rntstrip(RR,(RsRSR_(s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytgetpatternss

tctxtmatchiiR3(R%RR!RtdiffRtjoin(RSR_RsRRtchunks((RsRSR_s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRs
-sfiles(pattern)cC@st|dks*tjtdnt|||d}|d}|j|g}t|j|}tj	d||S(sUAll files of the current changeset matching the pattern. See
    :hg:`help patterns`.isfiles expects one argumentiRtfile(
R%RR!RRnRRtmatchesR	tshowlist(RSR_RstrawRtmtfiles((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRs
s1fill(text[, width[, initialident[, hangindent]]])cC@sdt|kodkns:tjtdnt|||d}d}d}d}dt|kodknrt|||dtd}y0t|||d}t|||d	}Wqtk
rqXntj||||S(
sJFill many
    paragraphs with optional indentation. See the "fill" filter.iis"fill expects one to four argumentsiiLR3isfill expects an integer widthi(	R%RR!RRnRmt
IndexErrorRtfill(RSR_Rsttexttwidtht
initindentt
hangindent((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR	s""
s.pad(text, width[, fillchar=' '[, left=False]])cC@sdt|kodkns:tjtdnt|||dtd}t|||d}t}d}t|dkrt|||d}nt|dkrt|||d}n|r|j||S|j	||Sd	S(
s#Pad text with a
    fill character.iis#pad() expects two to four argumentsispad() expects an integer widthit iN(
R%RR!RRmRntFalseRgtrjusttljust(RSR_RsRRRtfillchar((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytpad!s"s&indent(text, indentchars[, firstline])cC@sdt|kodkns:tjtdnt|||d}t|||d}t|dkrt|||d}n|}tj|||S(sIndents all non-empty lines
    with the characters given in the indentchars string. An optional
    third parameter will override the indent for the first line only
    if present.iis'indent() expects two or three argumentsii(R%RR!RRnRtindent(RSR_RsRRt	firstline((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;s"sget(dict, key)cC@st|dkr*tjtdnt|||d}tj|dsjtjtdnt|||d}|j|S(sGet an attribute/key from an object. Some keywords
    are complex types. This function allows you to obtain the value of an
    attribute on these types.isget() expects two argumentsiRws&get() expects a dict as first argumenti(R%RR!RRbR
RRw(RSR_RstdictargR9((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRwPssif(expr, then[, else])cc@sdt|kodkns:tjtdnt|||d}|rz|dd|||ddVn6t|dkr|dd|||ddVndS(s?Conditionally execute based on the result of
    an expression.iis!if expects two or three argumentsiiN(R%RR!RRg(RSR_Rsttest((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytif_as"$s*ifcontains(needle, haystack, then[, else])cc@sdt|kodkns:tjtdnt|||d}t|||d}||kr|dd|||ddVn6t|dkr|dd|||ddVndS(sNConditionally execute based
    on whether the item "needle" is in "haystack".iis*ifcontains expects three or four argumentsiiiN(R%RR!RRnRb(RSR_Rstneedlethaystack((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt
ifcontainsos"$s ifeq(expr1, expr2, then[, else])cc@sdt|kodkns:tjtdnt|||d}t|||d}||kr|dd|||ddVn6t|dkr|dd|||ddVndS(sBConditionally execute based on
    whether 2 items are equivalent.iis$ifeq expects three or four argumentsiiiN(R%RR!RRn(RSR_RsRR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytifeqs"$sjoin(list, sep)cc@sdt|kodkns:tjtdn|dd|||dd}tj|dr|j}g|jD]}||^q}nd}t|dkrt|||d}nt	}x'|D]}|rt
}n|V|VqWdS(s&Join items in a list with a delimiter.iis!join expects one or two argumentsiRRN(R%RR!RR
RtjoinfmtRRntTrueR(RSR_RstjoinsettjfRHtjoinertfirst((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRs""	(
	slabel(label, expr)cC@spt|dkr*tjtdn|d}t|||d}t|||d}|j||S(sApply a label to generated content. Content with
    a label applied can result in additional post-processing, such as
    automatic colorization.islabel expects two argumentstuiii(R%RR!RRnRotlabel(RSR_RsRRaR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRs
slatesttag([pattern])cC@skt|dkr*tjtdnd}t|dkr[t|||d}ntj||S(smThe global tags matching the given pattern on the
    most recent globally tagged ancestor of this changeset.is&latesttag expects at most one argumentiN(R%RR!RRRnR	tshowlatesttags(RSR_Rstpattern((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt	latesttagsslocaldate(date[, tz])cC@s_dt|kodkns:tjtdnt|||d}ytj|}Wn&tk
rtjtdnXt|dkrAd}t|||d}t	|t
rtj|\}}|rd}qn|dkrQyt|}Wq>t
tfk
r:tjtdq>XqQntjd}|d|fS(sIConverts a date to the specified timezone.
    The default is local date.iis&localdate expects one or two argumentsis$localdate expects a date informationslocaldate expects a timezoneN(R%RR!RRbR
t	parsedateRRRItstrt
parsetimezoneRhRiRjtmakedate(RSR_RsRttzoffsetttzt	remainder((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt	localdates*"
s	mod(a, b)cC@sTt|dks*tjtdnd}t||||d|dfS(s0Calculate a mod b such that a / b + a mod b == aismod expects two argumentscS@s||S(N((tatb((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;sii(R%RR!RR(RSR_RsR
((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytmods	s
relpath(path)cC@s]t|dkr*tjtdn|dj}t|||d}|j|S(shConvert a repository-absolute path into a filesystem path relative to
    the current working directory.isrelpath expects one argumentRi(R%RR!RtrepoRntpathto(RSR_RsRtpath((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytrelpaths
srevset(query[, formatargs...])c
@s+t|dks*tjtdnt|||d}|d}|jfd}t|dkrg|dD]}t|||^q}|tj||}t	|}nQ|dj
di}	||	kr|	|}n"||}t	|}||	|<tjd||S(	s8Execute a revision set query. See
    :hg:`help revset`.is$revset expects one or more argumentsRc@stjj|}|S(N(t	revsetmodRR(ROR(R(s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytquerysitcachetrevsetcachetrevision(
R%RR!RRnRRbRt
formatspecRt
setdefaultR	tshowrevslist(
RSR_RsRRRRt
formatargstrevsR((Rs7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRs"
)

srstdoc(text, style)cC@srt|dkr*tjtdnt|||d}t|||d}tj|d|ddgS(sFormat ReStructuredText.isrstdoc expects two argumentsiitstyletkeeptverbose(R%RR!RRnRtformat(RSR_RsRR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytrstdocs
sseparate(sep, args)cc@s|stjtdnt|||d}t}xI|dD]=}t|||}|siqEn|rxt}n|V|VqEWdS(s,Add a separator between non-empty arguments.s&separate expects at least one argumentiiN(RR!RRnRR(RSR_RstsepRR`targstr((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytseparate%s	sshortest(node, minlength=4)c
@s@dt|kodkns:tjtdnt|||d}d}t|dkrt|||dtd}n|djjjfd}|}t	d	|}|}xot
r;|| }	||	r|	}||ks||kr|S|d8}q|d7}t||kr|SqWd
S(s1Obtain the shortest representation of
    a node.iis'shortest() expects one or two argumentsiis'shortest() expects an integer minlengthRc@sylj|dkrtSy:t|}|ddksM|tkrQtStSWntk
rjtSXWntjk
rtSXdS(Nit0(	t
_partialmatchRRRhR%RRjRtRevlogError(RR(tcl(s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytisvalidLs"
	iN(R%RR!RRnRmt_repot
unfilteredt	changelogtmaxR(
RSR_RsRt	minlengthRtshortesttstartlengthtlengthR((Rs7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR8s,"	


sstrip(text[, chars])cC@sdt|kodkns:tjtdnt|||d}t|dkrt|||d}|j|S|jS(s[Strip characters from a string. By default,
    strips all leading and trailing whitespace.iis"strip expects one or two argumentsi(R%RR!RRnR(RSR_RsRtchars((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRms"
s%sub(pattern, replacement, expression)cc@st|dkr*tjtdnt|||d}t|||d}t|||d}ytj|}Wn-tjk
rtjtd|nXy|j||VWn-tjk
rtjtd|nXdS(	s8Perform text substitution
    using regular expressions.issub expects three argumentsiiissub got an invalid pattern: %ss"sub got an invalid replacement: %sN(R%RR!RRntretcompiletsub(RSR_Rstpattrpltsrctpatre((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR{ssstartswith(pattern, text)cC@smt|dkr*tjtdnt|||d}t|||d}|j|ri|SdS(siReturns the value from the "text" argument
    if it begins with the content from the "pattern" argument.is startswith expects two argumentsiiR3(R%RR!RRnR#(RSR_RstpatnR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR#ssword(number, text[, separator])cC@sdt|kodknsDtjtdt|nt|||dtd}t|||d}t|dkrt|||d}nd}|j|}|t|ks|t|krdS||SdS(	s"Return the nth word from a string.iis+word expects two or three arguments, got %disword expects an integer indexiR3N(R%RR!RRmRnRtsplit(RSR_RstnumRtsplitterttokens((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytwords"%cC@st|dfS(Ni(Rp(RR+((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;scC@st|dfS(Ni(Rq(RR+((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;scC@st|dfS(Ni(Rd(RR+((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;scC@st|d|tS(Ni(RVR(RR+((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;scC@st||dS(NcS@s||S(N((RR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;s(R(RR+((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;scC@st||dS(NcS@s||S(N((RR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;s(R(RR+((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;scC@st||dS(NcS@s||S(N((RR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;s(R(RR+((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;scC@st||dS(NcS@s||S(N((RR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;s(R(RR+((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR;st_aliasrulescB@s5eZdZedZeeZedZRS(s2Parsing and expansion rule set of template aliasesstemplate aliascC@s|ddkr@|dddkr@|ddt|dfS|ddkr}|dddkr}|dd|dgfSdS(sNReturn (name, args) if tree is func(...) or ...|filter; otherwise
        NoneiR
iRiRN(RX(RL((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt_trygetfuncs$$(	t__name__t
__module__t__doc__Rt_sectiontstaticmethodRPt_parseR(((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRscC@stj|}tj||S(s'Return new tree of aliases are expanded(RRtexpand(RLtaliasestaliasmap((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt
expandaliasesscc@st|tr|Vn|dkr&ntj|dsFt|Vnsxp|D]h}t|trj|VqM|dkryqMtj|dst|VqMxt|D]}|VqWqMWdS(s=yield a single stream from a possibly nested set of iteratorst__iter__N(RIRRR
Rt_flatten(RaRtj((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRs
cC@sEt|dks6|ddks6|d|dkr:|S|dd!S(s9unwrap quotes if any; otherwise returns unmodified stringiis'"ii(R%(R,((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt
unquotestrings6tenginecB@s2eZdZddddZdZdZRS(stemplate expansion engine.

    template expansion works like this. a map file contains key=value
    pairs. if value is quoted, it is treated as string. otherwise, it
    is treated as name of template file.

    templater is asked to expand a key in map. it looks up key, and
    looks for strings like this: {foo}. it expands {foo} by looking up
    foo in map, and substituting it. expansion is recursive: it stops
    when there is no more {foo} to replace.

    expansion also allows formatting and filtering.

    format uses key to expand each item in list. syntax is
    {key%format}.

    filter uses function to transform value. syntax is
    {key|filter1|filter2|...}.cC@sd||_|dkri}n||_|dkr<i}n||_tj||_i|_dS(N(t_loaderRRRxRRt	_aliasmapt_cache(tselftloadertfilterstdefaultsR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt__init__s					cC@s||jkrt|f|j|<ySt|j|}|jr[tj|j|}nt||t|j|<Wq|j|=qXn|j|S(s!load, parse, and cache a template(	R!RvRARR RRRVRY(R"RURH((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRZs	

cC@s+|j|\}}t||||S(sPerform expansion. t is name of map element to expand.
        mapping contains added elements for use during expansion. Is a
        generator.(RZR(R"RUR_R
R-((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRz+sN((RRRRR&RZRz(((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRs	RccC@st}|stdStj|d}g}xW|D]O}|jd}|dd
krdq9n|ddkr9|j|dq9q9Wd	jt|S(Ns7no templates found, try `hg debuginstall` for more infoit.itorigtrejsmap-cmdlineis, (R(R)(t
templatepathsRtostlistdirR	R?Rtsorted(tpathstdirlistt	stylelistRR	((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR04s	

cC@stjj|sAtjtd|dtdtntjj|}tjdt	}|j
|i}i}x=|djD]+\}}|stjtd|j
d|n|ddkr)|d|d	krtjtd
|j
d|nt|||<q|dkratjtjj||}tjj|sxt	D]z}tjtjj||}	tjj|	r|	}Pntjtjj|	d}
tjj|
ro|
}PqoqoWnt|\}}x+|D]#}
|
|kr	||
||
<q	q	Wx|D]#}
|
|kr7||
||
<q7q7Wqd
|f}d|dkr|djdd}n|dtjj||df||<qW||fS(s.Load template elements from the given map filesstyle '%s' not foundthintsavailable styles: %stincludepathsR3s
missing valueis'"isunmatched quotest__base__tmapRct:i(R+RtexistsRRrRR0tdirnameRR*treadtitemsR!tsourceRR
tnormpathRtisfilet_readmapfileR	(tmapfiletbasetconfRttmapR9tvalRRDtp2tp3tbcachetbtmaptk((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR=BsP
'

+R{cB@seZRS((RR(((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR{tst	templatercB@s\eZdddddddZeddddddZdZdZdZRS(	iicC@s|dkri}n|dkr*i}n|dkr?i}n|j|_i|_tjj|_|jj|||_||_|||_	|_
i|_dS(sset up template engine.
        filters is dict of functions. each transforms a value into another.
        defaults is dict of default map definitions.
        aliases is list of alias (name, replacement) pairs.
        N(RRyRR4RR$RR%t_aliasestminchunktmaxchunktecache(R"R$R%RRRJRK((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR&ys						c	C@sJ||||g||}t|\}}|jj|||_|S(s,Create templater from the specified map file(R=RRR4(	tclsR>R$R%RRJRKRURA((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytfrommapfiles
	cC@s||jkp||jkS(N(RR4(R"R9((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt__contains__scC@s||jkry%tj|j|d|j|<Wqtk
rf}ttd|jdqtk
r}t|jdtd|j|d|jdfqXn|j|S(s@Get the template for the given template name. Use a local cache.is"%s" not in template mapistemplate file %s: %s(	RR
treadfileR4tKeyErrorR{RRstIOError(R"RUtinst((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytloads%)cK@s||jkr |j|dp#d}||jkryt|}Wn*tk
rotjtd|nX||j|j|j	|j
|j|<n|j|}|j||}|jrt
j|d|jd|j}n|S(NiRcsinvalid template engine: %sR>R(R4RLtenginesRQRRrRRTR$R%RIRzRJR
tincreasingchunksRK(R"RUR_tttypeteclstproctstream((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt__call__s&

	N((	RRRR&tclassmethodRNRORTR[(((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyRHws			
cC@sidg}g|D]*}tjjtjjtj|^q}g|D]}tjj|rG|^qGS(s)return locations used for template files.t	templates(R+RR;RR
tdatapathtisdir(tpathsrelRR.RD((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyR*s	4cC@sCx<tD]1}tjj||}tjj|r
|Sq
WdS(s<return location of template file. returns None if not found.N(R*R+RRR6R(tnameRDR((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyttemplatepaths
cC@s>|dkrt}nt|tr3|g}nt|trN|g}nx|D]}|sU|tjtjfksUtj|ksUtjrtj|krqUntj	j
|dd|g}|jdxP|D]H}x?|D]7}tj	j
||}tj	j|r||fSqWqWqUWt
d|dS(sReturn path to mapfile for a given style.

    Searches mapfile in the following locations:
    1. templatepath/style/map
    2. templatepath/map-style
    3. templatepath/map
    R4smap-sNo hgweb templates found in %rN(RR*RIRR+tcurdirtpardirRtaltsepRRR?R<tRuntimeError(tstylesR.Rt	locationsRtlocationR>((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytstylemaps(	



cC@s.x'|jjD]\}}|t|<qWdS(s7Load template function from specified registrarobj
    N(t_tablet	iteritemsR(RtextnametregistrarobjRaR
((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pytloadfunctions(RiR(R
iR(Ri(Ri(Ri(iNNNN(Ri(Ri
(Ri(Ri(Ri(iRNNN(iRNNN(iRNNN(iRNNN(iNNNN(ct
__future__RR+RR\ti18nRR3RRRRRRRRR	R
RR=R2R RGRARPRQRVRWRXR[RbRgRmRnRoRpRqRuRvRdRR~RRRRRRRRRRttemplatefuncRRRRRRRwRRRRRRRRRRRRRRR#R
RRyRYtbasealiasrulesRRR^RRtobjectRRUR0R=RrR{RHR*RbRjRotvaluest
i18nfunctions(((s7/usr/lib/python2.7/dist-packages/mercurial/templater.pyt<module>s@
^+	"														
								
							
5







				5
		2C		#