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: //proc/self/root/lib64/python2.7/site-packages/mercurial/formatter.pyo
�
1�3\c@@sqdZddlmZmZddlZddlZddlZddlmZddl	m
Z
mZddlm
Z
ddlmZmZmZmZmZmZmZdd	lmZmZejZd
efd��YZdefd
��YZd�Zdefd��YZd�Zdefd��YZ defd��YZ!defd��YZ"defd��YZ#defd��YZ$defd��YZ%defd��YZ&e
j'd e(�d!efd"��Y�Z)d#�Z*d$�Z+dddd%�Z-dddd&�Z.e�Z/d'ej0fd(��YZ1d)�Z2ej3d*��Z4ej3d+��Z5d,�Z6dS(-s~Generic output formatting for Mercurial

The formatter provides API to show data in various ways. The following
functions should be used in place of ui.write():

- fm.write() for unconditional output
- fm.condwrite() to show some extra data conditionally in plain output
- fm.context() to provide changectx to template output
- fm.data() to provide extra data to JSON or template output
- fm.plain() to show raw text that isn't provided to JSON or template output

To show structured data (e.g. date tuples, dicts, lists), apply fm.format*()
beforehand so the data is converted to the appropriate data type. Use
fm.isplain() if you need to convert or format data conditionally which isn't
supported by the formatter API.

To build nested structure (i.e. a list of dicts), use fm.nested().

See also https://www.mercurial-scm.org/wiki/GenericTemplatingPlan

fm.condwrite() vs 'if cond:':

In most cases, use fm.condwrite() so users can selectively show the data
in template output. If it's costly to build data, use plain 'if cond:' with
fm.write().

fm.nested() vs fm.formatdict() (or fm.formatlist()):

fm.nested() should be used to form a tree structure (a list of dicts of
lists of dicts...) which can be accessed through template keywords, e.g.
"{foo % "{bar % {...}} {baz % {...}}"}". On the other hand, fm.formatdict()
exports a dict-type object to template, which can be accessed by e.g.
"{get(foo, key)}" function.

Doctest helper:

>>> def show(fn, verbose=False, **opts):
...     import sys
...     from . import ui as uimod
...     ui = uimod.ui()
...     ui.verbose = verbose
...     ui.pushbuffer()
...     try:
...         return fn(ui, ui.formatter(pycompat.sysbytes(fn.__name__),
...                   pycompat.byteskwargs(opts)))
...     finally:
...         print(pycompat.sysstr(ui.popbuffer()), end='')

Basic example:

>>> def files(ui, fm):
...     files = [(b'foo', 123, (0, 0)), (b'bar', 456, (1, 0))]
...     for f in files:
...         fm.startitem()
...         fm.write(b'path', b'%s', f[0])
...         fm.condwrite(ui.verbose, b'date', b'  %s',
...                      fm.formatdate(f[2], b'%Y-%m-%d %H:%M:%S'))
...         fm.data(size=f[1])
...         fm.plain(b'\n')
...     fm.end()
>>> show(files)
foo
bar
>>> show(files, verbose=True)
foo  1970-01-01 00:00:00
bar  1970-01-01 00:00:01
>>> show(files, template=b'json')
[
 {
  "date": [0, 0],
  "path": "foo",
  "size": 123
 },
 {
  "date": [1, 0],
  "path": "bar",
  "size": 456
 }
]
>>> show(files, template=b'path: {path}\ndate: {date|rfc3339date}\n')
path: foo
date: 1970-01-01T00:00:00+00:00
path: bar
date: 1970-01-01T00:00:01+00:00

Nested example:

>>> def subrepos(ui, fm):
...     fm.startitem()
...     fm.write(b'reponame', b'[%s]\n', b'baz')
...     files(ui, fm.nested(b'files', tmpl=b'{reponame}'))
...     fm.end()
>>> show(subrepos)
[baz]
foo
bar
>>> show(subrepos, template=b'{reponame}: {join(files % "{path}", ", ")}\n')
baz: foo, bar
i(tabsolute_importtprint_functionNi(t_(thextshort(tattr(terrortpycompatttemplatefilterst
templatekwt	templaterttemplateutiltutil(tdateutilt
stringutilt_nullconvertercB@sPeZdZeZed��Zed��Zed��Zed��Z	RS(s=convert non-primitive data types to be processed by formattercC@s|S(s$wrap nested data by appropriate type((tdatattmpltsep((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt
wrapnested�scC@s|\}}t|�|fS(s(convert date tuple to appropriate format(tint(tdatetfmtttsttz((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt
formatdate�scC@s
t|�S(s:convert dict or key-value pairs to appropriate dict format(tdict(RtkeytvalueRR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt
formatdict�scC@s
t|�S(s+convert iterable to appropriate list format(tlist(RtnameRR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt
formatlist�s(
t__name__t
__module__t__doc__tFalsetstorecontexttstaticmethodRRRR (((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�st
baseformattercB@s�eZd�Zd�Zd�Zd�Zd�Zdd�Zdddd	d
�Z	dd	d�Z
d�Zd
�Zd�Z
d�Zd�Zd�Zd�Zddd�Zd�ZRS(cC@s:||_||_||_||_d|_t|_dS(N(t_uit_topict_optst
_convertertNonet_itemRthexfunc(tselftuittopictoptst	converter((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt__init__�s					cC@s|S(N((R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt	__enter__�scC@s|dkr|j�ndS(N(R,tend(R/texctypetexcvaluet	traceback((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt__exit__�scC@sdS(s0show a formatted item once all data is collectedN((R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt	_showitem�tcC@s)|jdk	r|j�ni|_dS(s begin an item in the format listN(R-R,R;(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt	startitem�s
s%a %b %d %H:%M:%S %Y %1%2cC@s|jj||�S(s(convert date tuple to appropriate format(R+R(R/RR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�sRRt cC@s|jj|||||�S(s:convert dict or key-value pairs to appropriate dict format(R+R(R/RRRRR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�scC@s|jj||||�S(s+convert iterable to appropriate list format(R+R (R/RRRR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR �scK@s�tj|�}|jjr�d|krJd|krJ|dj�|d<nd|kryd|kry|dj�|d<n|jj|�ndS(s=insert context objects to be used to render template keywordstfctxtctxtrepoN(RtbyteskwargsR+R%t	changectxRAR-tupdate(R/tctxs((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pytcontext�scC@st�S(s#set of field names to be referenced(tset(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pytdatahint�scK@s#tj|�}|jj|�dS(s8insert data into item that's not shown in default outputN(RRBR-RD(R/R((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�scO@s)|j�}|jjt||��dS(s3do default text output while assigning data to itemN(tsplitR-RDtzip(R/tfieldstdeftextt	fielddataR2t	fieldkeys((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pytwrite�scO@s)|j�}|jjt||��dS(s4do conditional write (primarily for plain formatter)N(RIR-RDRJ(R/tcondRKRLRMR2RN((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt	condwrite�scK@sdS(s$show raw text for non-templated modeN((R/ttextR2((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pytplain�R<cC@stS(scheck for plain formatter usage(R$(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pytisplain�sR<cC@s;g}|jj|||�|j|<t|j|j|�S(s9sub formatter to store nested data in the specified field(R+RR-t_nestedformatterR((R/tfieldRRR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pytnested�scC@s |jdk	r|j�ndS(send output for the formatterN(R-R,R;(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR6�sN(R!R"R4R5R:R;R=RR,RR RFRHRRORQRSRTRWR6(((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR'�s"												cC@st|||dt�S(sformatter that prints nothingR3(R'R(R0R1R2((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt
nullformatter�sRUcB@s eZdZd�Zd�ZRS(s6build sub items and store them in the parent formatterc	C@s/tj||dddid|�||_dS(NR1R<R2R3(R'R4t_data(R/R0R3R((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR4�s"cC@s|jj|j�dS(N(RYtappendR-(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR;�s(R!R"R#R4R;(((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRU�s	cC@s#t|t�rt|j��S|S(s'iterate key-value pairs in stable order(t
isinstanceRtsortedt	iteritems(R((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt
_iteritems�st_plainconvertercB@sPeZdZeZed��Zed��Zed��Zed��Z	RS(s(convert non-primitive data types to textcC@stjd��dS(Ns%plainformatter should never be nested(RtProgrammingError(RRR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRscC@stj||�S(s(stringify date tuple in the given format(R
tdatestr(RR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRsc@sMtj��dkr'd�tj�n|j��fd�t|�D��S(s*stringify key-value pairs separated by seps%s=%sc3@s1|]'\}}��|��|�fVqdS(N((t.0tktv(Rtprefmt(s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pys	<genexpr>sN(RtidentityR,tbytestrtjoinR^(RRRRR((RRes9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRs	c@sGtj��dkr'd�tj�n|j��fd�|D��S(s#stringify iterable separated by seps%sc3@s|]}��|�VqdS(N((Rbte(RRe(s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pys	<genexpr>sN(RRfR,RgRh(RRRR((RRes9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR s
	(
R!R"R#R$R%R&RRRR (((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR_s	tplainformattercB@seeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	ddd	�Zd
�ZRS(sthe default text output schemec@shtj||||t�|jr.t|_n	t|_|�krR|j|_n�fd�|_dS(Nc@s
�j|�S(N(RO(tsR2(tout(s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt<lambda>,R<(	R'R4R_t	debugflagRR.RROt_write(R/R0RlR1R2((Rls9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR4#s		cC@sdS(N((R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR=-scK@sdS(N((R/R((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR/scO@s|j|||�dS(N(Ro(R/RKRLRMR2((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRO1scO@s!|r|j|||�ndS(sdo conditional writeN(Ro(R/RPRKRLRMR2((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRQ3scK@s|j||�dS(N(Ro(R/RRR2((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRS7scC@stS(N(tTrue(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRT9sR<cC@s|S(N((R/RVRR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRW;scC@sdS(N((R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR6>sN(
R!R"R#R4R=RRORQRSRTR,RWR6(((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRj!s	
						tdebugformattercB@s#eZd�Zd�Zd�ZRS(cC@s=tj||||t�||_|jjd|j�dS(Ns%s = [
(R'R4Rt_outROR)(R/R0RlR1R2((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR4Bs	cC@s0|jjdtj|jdddd��dS(Ns    %s,
tindentitleveli(RrRORtpprintR-(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR;FscC@s!tj|�|jjd�dS(Ns]
(R'R6RrRO(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR6Is
(R!R"R4R;R6(((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRqAs		tpickleformattercB@s#eZd�Zd�Zd�ZRS(cC@s/tj||||t�||_g|_dS(N(R'R4RRrRY(R/R0RlR1R2((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR4Ns	cC@s|jj|j�dS(N(RYRZR-(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR;RscC@s-tj|�|jjtj|j��dS(N(R'R6RrROtpickletdumpsRY(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR6Ts
(R!R"R4R;R6(((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRvMs		t
jsonformattercB@s#eZd�Zd�Zd�ZRS(cC@s?tj||||t�||_|jjd�t|_dS(Nt[(R'R4RRrRORpt_first(R/R0RlR1R2((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR4Ys	cC@s�|jrt|_n|jjd�|jjd�t}xqt|jj��D]Z\}}|rlt}n|jjd�tj	|dt�}|jjd||f�qQW|jjd�dS(Nt,s
 {
s,
tparanoids
  "%s": %ss
 }(
R{R$RrRORpR\R-titemsRtjson(R/tfirstRcRdtu((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR;^s	"	cC@s!tj|�|jjd�dS(Ns
]
(R'R6RrRO(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR6ns
(R!R"R4R;R6(((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRyXs		t_templateconvertercB@sPeZdZeZed��Zed��Zed��Zed��Z	RS(s=convert non-primitive data types to be processed by templatercC@stj|d|d|�S(s$wrap nested data by templatable typeRR(Rtmappinglist(RRR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRwscC@s
tj|�S(sreturn date tuple(RR(RR((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR{sc
@sUtjt���������fd�}tj�d�d�d�d|�S(sAbuild object that can be evaluated as either plain string or dictc3@stj������VdS(N(R_R((RRRRR(s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pytf�sRRRtgen(RtsortdictR^Rt
hybriddict(RRRRRR�((RRRRRs9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRsc@sCt�������fd�}tj�d�d�d|�S(sAbuild object that can be evaluated as either plain string or listc3@stj�����VdS(N(R_R ((RRRR(s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR��sRRR�(RRt
hybridlist(RRRRR�((RRRRs9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR �s(
R!R"R#RpR%R&RRRR (((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�rsttemplateformattercB@sGeZd�Zd�Zd�Zejd��Zd�Zd�Z	RS(c	C@s�tj||||t�||_t|||jdd��}|j|_t||dt	j
dt|�dt	j�|_
t||j
dddg�|_tj�|_|jdi�dS(	NttemplateR<tdefaultst	resourcestcachet	docheadert	docfootert	separator(R'R4R�Rrtlookuptemplatetgettreft_treft
loadtemplaterR	tkeywordsttemplateresourcestdefaulttemplt_tttemplatepartsmapt_partst	itertoolstcountt_countert_renderitem(R/R0RlR1R2tspec((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR4�s	cC@s\|jj�}t|j�|d<}|dkrE|jdi�n|j|j|�dS(NtindexiR�(R-tcopytnextR�R�R�(R/titemR�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR;�s
cC@sC||jkrdS|j|}|jj|jj||��dS(N(R�RrROR�trender(R/tpartR�R�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR��s
cC@s|jj|j�S(N(R�tsymbolsusedR�(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt_symbolsused�scC@s|jdS(s5set of field names to be referenced from the templatei(R�(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyRH�scC@s!tj|�|jdi�dS(NR�(R'R6R�(R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR6�s
(
R!R"R4R;R�Rt
propertycacheR�RHR6(((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR��s	
			tfrozenttemplatespeccB@s,eZej�Zej�Zej�ZRS((R!R"RtibR�Rtmapfile(((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR��scC@s�d|krtd|d
�Stjj|�dstjd|�pQtj|�}|rtjj|�rt|d
|�Sn|jd|�r�t|d
d
�S|dkr�|j	t
d�tj��tj
t
d���nd	|ks�d
|krztjj|�rztjj|�jd�rCt|d
tjj|��Stj|d��}|j�}Wd
QXtd|d
�Std|d
�S(s�Find the template matching the given -T/--template spec 'tmpl'

    'tmpl' can be any of the following:

     - a literal template (e.g. '{rev}')
     - a map-file name or path (e.g. 'changelog')
     - a reference to [templates] in config file
     - a path to raw template file

    A map file defines a stand-alone template environment. If a map file
    selected, all templates defined in the file will be loaded, and the
    template matching the given topic will be rendered. Aliases won't be
    loaded from user config, but from the map file.

    If no map file selected, all templates in [templates] section will be
    available as well as aliases in [templatealias].
    t{R<ismap-cmdline.t	templatesRsavailable styles: %s
sspecify a templatet/s\smap-trbN(R�R,tostpathRIR
ttemplatepathtisfiletconfigRORt	stylelistRtAborttbasenamet
startswithtrealpathRt	posixfiletread(R0R1RtmapnameR�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR��s&*c@s�i|j|j6}|jr<|j�fd�|D��nI|jr�x=|D]2}d|j|f}|�krL|||<qLqLWn|S(sCreate a mapping of {part: ref}c3@s'|]}|�kr||fVqdS(N((Rbtp(tt(s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pys	<genexpr>�ss%s:%s(R�R�RD(R�R�t	partnamestpartsmapR�R�((R�s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR��s	 	
c	C@sV|jr4tjj}||jd|d|d|�St||jd|d|d|�S(sPCreate a templater from either a literal template or loading from
    a map fileR�R�R�(R�R
tfrommapfilet
maketemplaterR(R0R�R�R�R�R�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR��s	c	C@sp|jd�}tjd|d|d|d|�}|jjd�|jd�D��|rl||jd<n|S(	s0Create a templater from a string template 'tmpl't
templatealiasR�R�R�taliasescs@s*|] \}}|tj|�fVqdS(N(R
t
unquotestring(RbRcRd((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pys	<genexpr>
sR�R<(tconfigitemsR
R�RD(R0RR�R�R�R�R�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�sR�cB@s�eZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zie
d6ed
6ZRS(s@Resource mapper designed for the default templatekw and functioncC@s"iid6|d6|d6|_dS(NR�RAR0(t_resmap(R/R0RA((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR4sc@s��fd��j�D�S(Nc@s.h|]$}�j�|�dk	r|�qS(N(t_getsomeR,(RbRc(tmappingR/(s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pys	<setcomp>s	(t	knownkeys(R/R�((R�R/s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt
availablekeysscC@sddddddhS(NR�R@R?RAtrevcacheR0((R/((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�"scC@sY||j�krdS|j||�}|tkrU|j|||�}||<n|S(N(R�R,R�t_placeholdert
_loadermap(R/R�RRd((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pytlookup%s!cC@s�i}|j|�r"i|d<n|j|�rb|j|�rbtj||d�}||d<nd|kr�|j|d�r�t|d<nd|kr�|j|d�r�t|d<n|S(NR�tnodetoriginalnodeR@R?R�(t_hasnodespecRt	runsymbolt_hasliteralR�(R/RFtorigmappingt
newmappingR�torignode((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pytpopulatemap-s



cC@s/|j|�}|dk	r|S|jj|�S(N(R�R,R�(R/R�RRd((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�<scC@s||kot||�S(s<Test if a literal value is set or unset in the given mapping(tcallable(R/R�R((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�BscC@s#|j|�}t|�rdS|S(s1Return value of the given name if it is a literalN(R�R�R,(R/R�RRd((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt_getliteralFscC@sd|kpd|kS(s=Test if context revision is set or unset in the given mappingR�R@((R/R�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�MscC@sh|j|d�}|j|d�}|dks<|dkr@dSy||SWntjk
rcdSXdS(NRAR�(R�R�R,RtRepoLookupError(R/R�RAR�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt_loadctxQscC@sh|j|d�}|j|d�}|dks<|dkr@dSy||SWntjk
rcdSXdS(NR@R�(R�R�R,RtLookupError(R/R�R@R�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt	_loadfctx[sR@R?N(R!R"R#R,R4R�R�R�R�R�R�R�R�R�R�R�(((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyR�s									
	
cC@s�|jdd�}|dkr1t||||�S|dkrPt||||�S|dkrot||||�S|dkr�t||||�S|jdd�r�t||||�S|jdd�r�t||||�St||||�S(	NR�R<RRwtdebugR0tformatdebugt
formatjson(R�RyRvRqR�t
configboolRj(R0RlR1R2R�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt	formatterjsc	c@sBtj|d��*}t||||��}|VWdQXWdQXdS(srCreate a formatter that writes outputs to the specified file

    Must be invoked using the 'with' statement.
    twbN(RR�R�(R0tfilenameR1R2Rltfm((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt
openformatter|scc@s	|VdS(N((R�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt_neverending�scC@s0|r"t|j||j|j�St|�SdS(s�Create a formatter backed by file if filename specified, else return
    the given formatter

    Must be invoked using the 'with' statement. This will never call fm.end()
    of the given formatter.
    N(R�R(R)R*R�(R�R�((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pytmaybereopen�s(7R#t
__future__RRt
contextlibR�R�ti18nRR�RRt
thirdpartyRR<RRRR	R
RRtutilsR
RRwtobjectRR'RXRUR^R_RjRqRvRyR�R�RkRpR�R�R�R,R�R�R�tresourcemapperR�R�tcontextmanagerR�R�R�(((s9/usr/lib64/python2.7/site-packages/mercurial/formatter.pyt<module>jsD4		K		 '	2	
	V