HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //lib64/python2.7/site-packages/mercurial/templatefuncs.pyc
�
1�3\c@@szddlmZddlZddlmZddlmZmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZddlmZmZejZejZejZejZejZejZej Z ej!Z!iZ"ej#e"�Z#e#d�d	��Z$e#d
dd�d
��Z%e#dddh�d��Z&e#ddddddh�d��Z'e#dddh�d��Z(e#d�d��Z)e#d�d��Z*e#dddh�d��Z+e#ddd dh�d!��Z,e#d"dd#�d$��Z-e#d%�d&��Z.e#d'�d(��Z/e#d)�d*��Z0e#d+�d,��Z1e#d-�d.��Z2e#d/�d0��Z3e#d1ddh�d2��Z4e#d3�d4��Z5e#d5�d6��Z6e#d7�d8��Z7e#d9�d:��Z8e#d;�d<��Z9e#d=�d>��Z:e#d?�d@��Z;e#dA�dB��Z<e#dC�dD��Z=e#dEdd h�dF��Z>e#dGdd dh�dH��Ze#dI�dJ��Z?e#dKddL�dM��Z@e#dNdd dh�dO��ZAe#dP�dQ��ZBe#dR�dS��ZCe#dT�dU��ZDe#dV�dW��ZEdX�ZFe"jG�ZHdS(Yi(tabsolute_importNi(t_(tbintwdirid(
tcolortencodingterrortminirsttobsutilt	registrartrevsett
revsetlangtscmutilttemplatefilterst
templatekwttemplateutiltutil(tdateutilt
stringutilsdate(date[, fmt])cC@s�dt|�kodkns:tjtd���nt|||dtd��}d}t|�dkr�t|||d�}n|dkr�tj|�Stj||�SdS(s�Format 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(	tlenRt
ParseErrorRtevaldatetNonet
evalstringRtdatestr(tcontexttmappingtargstdatetfmt((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR2s"
sdict([[key=]value...])targspecs*args **kwargsc@s�tj�}x�|dD]�}tj|�}|sJtjtd���n||ksf||dkr�tjtd�|��nt��|�||<qW|j��fd�|dj	�D��tj
|�S(svConstruct a dict from key-value pairs. A key may be omitted if
    a value expression can provide an unambiguous name.Rsdict key cannot be inferredtkwargss!duplicated dict key '%s' inferredc3@s-|]#\}}|t��|�fVqdS(N(tevalfuncarg(t.0tktv(RR(s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pys	<genexpr>Ts(RtsortdictRtfindsymbolicnameRRRR tupdatet	iteritemst
hybriddict(RRRtdataR#R"((RRs=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytdict_Fss)diff([includepattern [, excludepattern]])trequirestctxc@s�t��dkr*tjtd���n���fd�}�j�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|t��kr>t���|�j�}|r>|gSngS(N(RRtstrip(tits(RRR(s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytgetpatterns`s

R,tmatchiit(RRRRtresourcetdiffR1tjoin(RRRR0R,tchunks((RRRs=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR4Xs-sextdata(source)tsourcetcachecC@sd|kr$tjtd���nt|||d�}|s�tj|d�}|r�tjtd�dtd�|��q�tjtd���n|j|d�jdi�}|j|d�}||kr�||}n tj	|j
�|�}||<|j|j�d	�S(
sBShow a text read from the specified extdata source. (EXPERIMENTAL)R7sextdata expects one argumentsempty data source specifiedthintsdid you mean extdata('%s')?R8textdataR,R2(
RRRRRR%R3t
setdefaultRt
extdatasourcetrepotgettrev(RRRR7tsymR8R,R)((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR:ls
 sfiles(pattern)cC@s�t|�dks*tjtd���nt|||d�}|j|d�}|j|g�}t|j|��}t	j
||d|�S(sUAll files of the current changeset matching the pattern. See
    :hg:`help patterns`.isfiles expects one argumentiR,tfile(RRRRRR3R1tlisttmatchesRtcompatfileslist(RRRtrawR,tmtfiles((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyRG�ss1fill(text[, width[, initialident[, hangindent]]])cC@sdt|�kodkns:tjtd���nt|||d�}d}d}d}dt|�kodknr�t|||dtd��}y0t|||d�}t|||d	�}Wq�tk
r�q�Xntj||||�S(
sJFill many
    paragraphs with optional indentation. See the "fill" filter.iis"fill expects one to four argumentsiiLR2isfill expects an integer widthi(	RRRRRtevalintegert
IndexErrorR
tfill(RRRttexttwidtht
initindentt
hangindent((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyRJ�s""
sfilter(iterable[, expr])c@s�dt��kodkns:tjtd���nt���d�}t��dkrw��fd�}n���fd�}|j��|�S(ssRemove empty elements from a list or a dict. If expr specified, it's
    applied to each element to test emptiness.iis#filter expects one or two argumentsic@s|j���S(N(ttobool(tw(RR(s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytselect�sc@sYt|tj�s*tjtd���n�j�|j���}t�|�d�S(Nsnot filterable by expressioni(	t
isinstanceRtmappableRRRt
overlaymapttomaptevalboolean(RPtlm(RRR(s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyRQ�s(RRRRtevalwrappedtfilter(RRRtiterableRQ((RRRs=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytfilter_�s"sformatnode(node)tuicC@slt|�dkr*tjtd���n|j|d�}t|||d�}|jr_|Stj|�S(s;Obtain the preferred form of a changeset hash. (DEPRECATED)isformatnode expects one argumentR\i(	RRRRR3Rt	debugflagR
tshort(RRRR\tnode((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyt
formatnode�s	smailmap(author)R=cC@s�t|�dkr*tjtd���nt|||d�}|j|d�}|j|d�}d|kr�|jjd�}tj	|�|d<ntj
|d|�S(sNReturn the author, updated according to the value
    set in the .mailmap fileismailmap expects one argumentiR8R=tmailmaps.mailmap(RRRRRR3twvfsttryreadRtparsemailmaptmapname(RRRtauthorR8R=R)((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyRa�ss@pad(text, width[, fillchar=' '[, left=False[, truncate=False]]])s!text width fillchar left truncatec	C@s�d|ksd|kr0tjtd���nt|||dtd��}t|||d�}t}t}d}d|kr�t|||d�}ttj|��dkr�tjtd���q�nd	|kr�t	|||d	�}nd
|krt	|||d
�}n|t
jtj|��}|dkrf|rft
jtj|�|d|�S|dkrv|S|r�|||S|||Sd
S(s#Pad text with a
    fill character.RKRLs#pad() expects two to four argumentsspad() expects an integer widtht tfillcharis%pad() expects a single fill charactertleftttruncateitleftsideN(
RRRRHRtFalseRRtstripeffectsRVRtcolwidthttrim(	RRRRLRKRjRiRht	fillwidth((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytpad�s0s&indent(text, indentchars[, firstline])cC@s�dt|�kodkns:tjtd���nt|||d�}t|||d�}t|�dkr�t|||d�}n|}tj|||�S(s�Indents 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(RRRRRR
tindent(RRRRKRrt	firstline((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyRrs"sget(dict, key)cC@s�t|�dkr*tjtd���nt|||d�}t|||d�}y|j|||�SWn=tjk
r�}td�}tjt|�d|��nXdS(s�Get 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 argumentsiis&get() expects a dict as first argumentR9N(RRRRRXt
evalrawexpt	getmembertbytes(RRRtdictargtkeyterrR9((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR>ssif(expr, then[, else])cC@s�dt|�kodkns:tjtd���nt|||d�}|rjt|||d�St|�dkr�t|||d�SdS(s?Conditionally execute based on the result of
    an expression.iis!if expects two or three argumentsiiN(RRRRRVRt(RRRttest((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytif_)s"s*ifcontains(needle, haystack, then[, else])cC@s�dt|�kodkns:tjtd���nt|||d�}y/t|||d�}|j|||�}Wntjk
r�t}nX|r�t|||d�St|�dkr�t|||d�SdS(sNConditionally execute based
    on whether the item "needle" is in "haystack".iis*ifcontains expects three or four argumentsiiiN(RRRRRXRttcontainsRl(RRRthaystacktneedletfound((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyt
ifcontains7s"
s ifeq(expr1, expr2, then[, else])cC@s�dt|�kodkns:tjtd���nt|||d�}t|||d�}||kr�t|||d�St|�dkr�t|||d�SdS(sBConditionally execute based on
    whether 2 items are equivalent.iis$ifeq expects three or four argumentsiiiN(RRRRRRt(RRRRzR1((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytifeqKs"sjoin(list, sep)cC@s�dt|�kodkns:tjtd���nt|||d�}d}t|�dkr�t|||d�}n|j|||�S(s&Join items in a list with a delimiter.iis!join expects one or two argumentsiRg(RRRRRXRR5(RRRtjoinsettjoiner((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR5Zs"slabel(label, expr)cC@sxt|�dkr*tjtd���n|j|d�}t|||d�}t|||d�}|j||�S(s�Apply a label to generated content. Content with
    a label applied can result in additional post-processing, such as
    automatic colorization.islabel expects two argumentsR\ii(RRRRR3Rtevalstringliteraltlabel(RRRR\tthingR�((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR�gsslatesttag([pattern])cC@snt|�dkr*tjtd���nd}t|�dkr[t|||d�}ntj|||�S(sThe global tags matching the given pattern on the
    most recent globally tagged ancestor of this changeset.
    If no such tags exist, the "{tag}" template resolves to
    the string "null". See :hg:`help revisions.patterns` for the pattern
    syntax.
    is&latesttag expects at most one argumentiN(RRRRRRRtshowlatesttags(RRRtpattern((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyt	latesttagxsslocaldate(date[, tz])cC@s5dt|�kodkns:tjtd���nt|||dtd��}t|�dkrd}t|||d�}t|t�r�t	j
|�\}}|r�d}q�n|dkryt|�}Wqtt
fk
rtjtd���qXqnt	j�d}tj|d|f�S(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(RRRRRRR RRRvRt
parsetimezonetintt	TypeErrort
ValueErrortmakedateRR(RRRRttzoffsetttzt	remainder((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyt	localdate�s$"s
max(iterable)cK@s�t|�dkr*tjtd���nt|||d�}y|j||�SWn=tjk
r�}td�}tjt|�d|��nXdS(sReturn the max of an iterableismax expects one argumentis(max first argument should be an iterableR9N(RRRRRXtgetmaxRv(RRRRRZRyR9((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytmax_�ss
min(iterable)cK@s�t|�dkr*tjtd���nt|||d�}y|j||�SWn=tjk
r�}td�}tjt|�d|��nXdS(sReturn the min of an iterableismin expects one argumentis(min first argument should be an iterableR9N(RRRRRXtgetminRv(RRRRRZRyR9((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytmin_�ss	mod(a, b)cC@sWt|�dks*tjtd���nd�}tj||||d|df�S(s0Calculate a mod b such that a / b + a mod b == aismod expects two argumentscS@s||S(N((tatb((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyt<lambda>�R2ii(RRRRRt
runarithmetic(RRRtfunc((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytmod�s
	sobsfateoperations(markers)cC@s�t|�dkr*tjtd���nt|||d�}y&tj|�}tj|dd�SWn2t	t
fk
r�td�}tj|��nXdS(sCCompute obsfate related information based on markers (EXPERIMENTAL)is&obsfateoperations expects one argumentitnamet	operations6obsfateoperations first argument should be an iterableN(RRRRR RtmarkersoperationsRt
hybridlistR�tKeyError(RRRtmarkersR)terrmsg((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytobsfateoperations�ssobsfatedate(markers)cC@s�t|�dkr*tjtd���nt|||d�}y,tj|�}tj|dddd�SWn2t	t
fk
r�td�}tj|��nXd	S(
sCCompute obsfate related information based on markers (EXPERIMENTAL)is obsfatedate expects one argumentiR�RRs%d %ds0obsfatedate first argument should be an iterableN(RRRRR RtmarkersdatesRR�R�R�(RRRR�R)R�((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytobsfatedate�ssobsfateusers(markers)cC@s�t|�dkr*tjtd���nt|||d�}y&tj|�}tj|dd�SWn5t	t
tfk
r�td�}tj|��nXdS(sCCompute obsfate related information based on markers (EXPERIMENTAL)is!obsfateusers expects one argumentiR�tusers>obsfateusers first argument should be an iterable of obsmakersN(RRRRR RtmarkersusersRR�R�R�R�(RRRR�R)tmsg((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytobsfateusers�ss obsfateverb(successors, markers)cC@s�t|�dkr*tjtd���nt|||d�}t|||d�}ytj||�SWn,tk
r�td�}tj|��nXdS(sFCompute obsfate related information based on successors (EXPERIMENTAL)is!obsfateverb expects two argumentsiis.obsfateverb first argument should be countableN(RRRRR RtobsfateverbR�(RRRt
successorsR�R�((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR�s
s
relpath(path)cC@s_t|�dkr*tjtd���n|j|d�}t|||d�}|j|�S(shConvert a repository-absolute path into a filesystem path relative to
    the current working directory.isrelpath expects one argumentR=i(RRRRR3Rtpathto(RRRR=tpath((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytrelpaths
srevset(query[, formatargs...])c
@s8t|�dks*tjtd���nt|||d�}|j|d���fd�}t|�dkr�g|dD]}t|||�^q~}|tj||��}t	|�}n_|j|d�}|j
di�}	||	kr|	|}n"||�}t	|�}||	|<tj||d|�S(	s8Execute a revision set query. See
    :hg:`help revset`.is$revset expects one or more argumentsR=c@s.tj�j|dtj���}|��S(Ntlookup(t	revsetmodR1R\tlookupfn(texprRF(R=(s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytquery+s$iR8trevsetcachetrevision(
RRRRRR3R Rt
formatspecRBR;Rtshowrevslist(
RRRRER�R�t
formatargstrevsR8R�((R=s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR
 s")

srstdoc(text, style)cC@srt|�dkr*tjtd���nt|||d�}t|||d�}tj|d|ddg�S(sFormat reStructuredText.isrstdoc expects two argumentsiitstyletkeeptverbose(RRRRRRtformat(RRRRKR�((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytrstdoc>s
sseparate(sep, args...)s	sep *argscc@s�d|kr$tjtd���nt|||d�}t}xI|dD]=}t|||�}|soqKn|r~t}n|V|VqKWdS(s,Add a separator between non-empty arguments.tseps&separate expects at least one argumentRN(RRRRtTrueRl(RRRR�tfirsttargtargstr((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytseparateJs	sshortest(node, minlength=4)cC@s�dt|�kodkns:tjtd���nt|||d�}d}t|�dkr�t|||dtd��}n|j|d�}t|�dkr�|St|�dkr�yt|�}Wq=tk
r�|SXnQyt	j
||�}Wn.tjk
rt}ntj
k
r2|SX|s=|S|j|d	�}yt	j||||�SWntjk
r�|SXd
S(s1Obtain the shortest representation of
    a node.iis'shortest() expects one or two argumentsiis'shortest() expects an integer minlengthR=i(R8N(RRRRRRHR3RR�RtresolvehexnodeidprefixtWdirUnsupportedRtLookupErrortshortesthexnodeidprefixtRepoLookupError(RRRthexnodet	minlengthR=R_R8((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytshortest]s8"
	sstrip(text[, chars])cC@s�dt|�kodkns:tjtd���nt|||d�}t|�dkr�t|||d�}|j|�S|j�S(s[Strip characters from a string. By default,
    strips all leading and trailing whitespace.iis"strip expects one or two argumentsi(RRRRRR-(RRRRKtchars((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR-�s"
s%sub(pattern, replacement, expression)cc@s�t|�dkr*tjtd���nt|||d�}t|||d�}t|||d�}ytj|�}Wn-tjk
r�tjtd�|��nXy|j||�VWn-tjk
r�tjtd�|��nXdS(	s8Perform text substitution
    using regular expressions.issub expects three argumentsiiissub got an invalid pattern: %ss"sub got an invalid replacement: %sN(RRRRRtretcompiletsub(RRRtpattrpltsrctpatre((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR��ssstartswith(pattern, text)cC@smt|�dkr*tjtd���nt|||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 argumentsiiR2(RRRRRt
startswith(RRRtpatnRK((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyR��ssword(number, text[, separator])cC@s�dt|�kodknsDtjtd�t|���nt|||dtd��}t|||d�}t|�dkr�t|||d�}nd}|j|�}|t|�ks�|t|�kr�dS||SdS(	s"Return the nth word from a string.iis+word expects two or three arguments, got %disword expects an integer indexiR2N(RRRRRHRRtsplit(RRRtnumRKtsplitterttokens((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytword�s"%cC@s.x'|jj�D]\}}|t|<qWdS(s7Load template function from specified registrarobj
    N(t_tableR'tfuncs(R\textnametregistrarobjR�R�((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pytloadfunction�s(It
__future__RR�ti18nRR_RRR2RRRRRR	R
R�RRR
RRRtutilsRRRtRXR RVRRHRR�R�ttemplatefuncRR*R4R:RGRJR[R`RaRqRrR>R{R�R�R5R�R�R�R�R�R�R�R�R�R�R�R�R�R�R-R�R�R�R�tvaluest
i18nfunctions(((s=/usr/lib64/python2.7/site-packages/mercurial/templatefuncs.pyt<module>slX								'
!%
!!'