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: //usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyc
�
1�3\c@@sddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZm
Z
mZmZmZmZddlmZmZmZmZmZmZmZmZmZmZmZmZdd	lm Z dd
lm!Z!gZ"iZ#de$fd��YZ%e%d
�d��Z&e%d�d��Z'd�Z(e%d�d��Z)d�Z*e%d�e+d��Z,e%d�d��Z-e%d�d��Z.e%d�e.�Z/d�Z0e%d�d��Z1e%d�d ��Z2e%d!�d"��Z3e%d#�d$��Z4e%d%�d&��Z5e%d'�d(��Z6e%d)�e6�Z7e%d*�d+��Z8e%d,�d-��Z9e%d.�d/��Z:e%d0�d1��Z;e%d2�d3��Z<e%d4�d5��Z=d6�Z>e%d7�d8��Z?e#j@�ZAdS(9i(tabsolute_importNi(t_(thextshorti(t
ErrorResponsetHTTP_FORBIDDENtHTTP_NOT_FOUNDtget_contactt	paritygent
staticfile(tarchivaltdagoptencodingterrortgraphmodtpycompattrevsett
revsetlangtscmutiltsmartsett	templaterttemplateutil(t
stringutil(twebutilt
webcommandcB@s eZdZd�Zd�ZRS(s�Decorator used to register a web command handler.

    The decorator takes as its positional arguments the name/path the
    command should be accessible under.

    When called, functions receive as arguments a ``requestcontext``,
    ``wsgirequest``, and a templater instance for generatoring output.
    The functions should populate the ``rctx.res`` object with details
    about the HTTP response.

    The function returns a generator to be consumed by the WSGI application.
    For most commands, this should be the result from
    ``web.res.sendresponse()``. Many commands will call ``web.sendtemplate()``
    to render a template.

    Usage:

    @webcommand('mycommand')
    def mycommand(web):
        pass
    cC@s
||_dS(N(tname(tselfR((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt__init__LscC@s!tj|j�|t|j<|S(N(t__all__tappendRtcommands(Rtfunc((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt__call__Os
(t__name__t
__module__t__doc__RR (((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR5s	tlogcC@s-|jjjd�rt|�St|�SdS(s�
    /log[/{revision}[/{path}]]
    --------------------------

    Show repository or file history.

    For URLs of the form ``/log/{revision}``, a list of changesets starting at
    the specified changeset identifier is shown. If ``{revision}`` is not
    defined, the default is ``tip``. This form is equivalent to the
    ``changelog`` handler.

    For URLs of the form ``/log/{revision}/{file}``, the history for a specific
    file will be shown. This form is equivalent to the ``filelog`` handler.
    tfileN(treqtqsparamstgettfilelogt	changelog(tweb((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR$Ts
trawfilecC@s�|jdd�}tj|j|jjjdd��}|sIt|�Sytj|j|j�}Wn>t	j
k
r�}yt|�SWq�tk
r�|�q�XnX|j�}|j
�}d}|r%tjtj|��d}|dkrtj|�r
d}q"d}q%tj|�}n|jd�rH|d	tj7}n||jjd
<|jd�djd
d�jdd�}d||jjd<|jj|�|jj�S(NR+t	guessmimeR%tsapplication/binaryis
text/plainstext/s; charset="%s"sContent-Typet/i����s\s\\t"s\"sinline; filename="%s"sContent-Disposition(t
configboolRt	cleanpathtrepoR&R'R(tmanifesttfilectxR
tLookupErrorRtpathtdatat	mimetypest
guess_typeRtfsdecodetNoneRtbinarytsysbytest
startswithRtrestheaderst
rpartitiontreplacetsetbodybytestsendresponse(R+R-R7tfctxtinstttexttmttfilename((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR,js:'

		c@s/|j�}|j��t|j��|j�|j�j�k}tj��r�t	j
tjt	j
|��dpyd�}d|�n��fd�}|jdd|dtj|�dtj|�d	tj|j|�d
tj|�d|j�j|�dt|�t	jtj|j|���S(
Nisapplication/octet-streams(binary:%s)c3@saxZt�jt��D]C\}}i|d6d|dd6d|dd6t��d6VqWdS(Ntlinesl%ditlineids% 6dt
linenumbertparity(t	enumeratet
splitlinestTruetnext(tcontexttlinenott(RNRH(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pytlines�s
"
tfilerevisionR%R7RHtsymrevtrenametpermissionstishead(R7R8RtstripecounttfilenodeR)theadsRR=RR>R9R:R;tsendtemplateRtupRtmappinggeneratortsymrevorshortnodeR&t
renamelinkR4tflagstintt	strkwargstcommonentryR3(R+RFtfR[RIRV((RNRHsA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt
_filerevision�s(	
	R%cC@s�|jjjd�dkr%t|�Stj|j|jjjdd��}|s\t|�Sy#t|tj	|j|j��SWn>t
jk
r�}yt|�SWq�tk
r�|�q�XnXdS(s5
    /file/{revision}[/{path}]
    -------------------------

    Show information about a directory or file in the repository.

    Info about the ``path`` given as a URL parameter will be rendered.

    If ``path`` is a directory, information about the entries in that
    directory will be rendered. This form is equivalent to the ``manifest``
    handler.

    If ``path`` is a file, information about that file will be shown via
    the ``filerevision`` template.

    If ``path`` is not defined, information about the root directory will
    be rendered.
    tstyletrawR%R.N(
R&R'R(R,RR2R3R4RiR5R
R6R(R+R7RG((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR%�s
'
#
c@s�d�d�d�d�}�fd�}�fd�}i|df�6|df�6|d	f�6}����fd
�}�����fd�}�jjd}�j�d�jjkr yEt�jjjd����t�d
����jjdd<Wq tk
rq Xnt	j	�jjd�}t�dd
�|d<||d<t	j	�jjd�}	�d|	d<||	d<||�\}
�d�jjkr�d}||
d
}�}
|�n)|
�kr�|�d
}nd}d}||
��j
d}
t�j���j
dd|d|
j�dddtj|dd�d�jd�d|	d|d�d
d|d|�
S( NtrevtkeywordRcs@s	|VdS(N((tctx((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt	revsearch�sc3@s�tj}||�j�}�fd�}x�|�D]�}d}xi|D]a}|||j��kp�|||j��kp�||dj|j���ksGd}PqGqGW|r�q4n|Vq4WdS(Nc3@s��jj}x�tjt�j�ddd�D]p}g}xA|jtd|d�|�D] }�j|}|j|�q[W|j�x|D]}|Vq�Wq/WdS(Niii����ic(	R3R*RtxrangetlentrevstmaxRtreverse(tcltitltjRnte(R+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pytrevgen�s)&


it i(Rtlowertsplittusertdescriptiontjointfiles(tqueryR|tqwRzRntmisstq(R+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt
keywordsearch�s	
!c3@s!x|D]}�j|VqWdS(N(R3(Rrtr(R+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pytrevsetsearch�s
sexact revision searchsliteral keyword searchsrevset expression searchc@slytj�j|�}Wntjtjfk
r8nX�|fSd|}ytj|�}Wntjk
r}�|fSXtj	|�dkr��|fSt
d�tj|�D��r��|fStj|�}|j
tj�s��|fSyGtj�jj|dtj�j��}|�j�}�|fSWn-tjtjtjtfk
rg�|fSXdS(Nsreverse(%s)ics@s4|]*\}}}||pdd fdkVqdS(R.itstringsre:N(R�sre:((t.0ttokentvaluetpos((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pys	<genexpr>stlookup(Rt	revsymbolR3R
t	RepoErrorR6Rtparset
ParseErrortdepthtanyttokenizet	funcsusedtissubsetRtsafesymbolstmatchtuitlookupfntRepoLookupErrortAbort(R�RntrevdefttreeR�tmfuncRr(tMODE_KEYWORDt
MODE_REVISIONtMODE_REVSETR+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt
getsearchmode�s4


	

c3@s�d}x��d��D]�}|d7}tj|�}tj�jd|�}tj|j�|�j�}tj�j|�}|j	it
��d6|d6|d6�|V|�krPqqWdS(NiitchangelogtagRNR�(RtbinnodeRtshowtagR3t
listfilediffsR�tmaxfilesRgtupdateRR(RStcountRntntshowtagsR�tlm(tfuncargRNtrevcountt
searchfuncR+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt
changelist)s
	
R�itsessionvarsitforcekwR.ttiptsearchR�tnodeRXtentriesRtsearchentrytarchivestmorevarstlessvarstmodedesctshowforcekwt
showunforcekw(R&R't
maxchangesReR(Rsttmpltdefaultst
ValueErrortcopyR3RR\R_RRRatarchivelist(R+RoR�R�tsearchfuncsR�R�R�R�R�tmodeR�R�R�((R�R�R�R�RNR�R�R+sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt_search�sh	

*	


	


R*c@s�d}d�jjkrHtj�j�j�}tj�j|�}n/d�jjkrdt��S�jd}d}���fd�}|r��j}n	�j}d�jjkryEt	�jjj
d|��}t|d�}|�jj
dd<Wqtk
rqXntj�jj
d�}t|d	d�|d<tj�jj
d�}|d	|d<t�j�}	|j��t�j��tj�j�j�||	�}
t||d��}|d }t|�|kr|d
}
|d
 }ng}
�j|rdndd
|
d|j�d�d|d|	dtj|�dtj|�dtj|
�d�jd�d|d|d|d|�
S(s0
    /changelog[/{revision}]
    -----------------------

    Show information about multiple changesets.

    If the optional ``revision`` URL argument is absent, information about
    all changesets starting at ``tip`` will be rendered. If the ``revision``
    argument is present, changesets will be shown starting from the specified
    revision.

    If ``revision`` is absent, the ``rev`` query string argument may be
    defined. This will perform a search for changesets.

    The argument for ``rev`` can be a single revision, a revision set,
    or a literal keyword to search for in changeset data (equivalent to
    :hg:`log -k`).

    The ``revcount`` query string argument defines the maximum numbers of
    changesets to render.

    For non-searches, the ``changelog`` template will be rendered.
    R.R�RlR�c3@sYg}�dkr-�jjj�d�}nx%tj�||��D]}|VqFWdS(Ni����i(R3R*RrRtchangelistentries(tmaxcountRrtentry(RNR�R+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR��s
R�iR�ii����tshortlogR*t	changenavRXt
changesetsR�tlatestentryt	nextentryR�R�R�R�(R&R'Rt	changectxR3RbR�tmaxshortchangesR�ReR(RsR�R�R�R�RqRlRR\trevnavtgentlistR_RRtmappinglistR�(R+R�R�RnRXR�R�R�R�R�R�R�R�R�((RNR�R+sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR*ns`

	
!


R�cC@st|dt�S(s

    /shortlog
    ---------

    Show basic information about a set of changesets.

    This accepts the same parameters as the ``changelog`` handler. The only
    difference is the ``shortlog`` template will be rendered instead of the
    ``changelog`` template.
    R�(R*RQ(R+((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR��st	changesetcC@s4tj|j|j�}|jdtj||��S(s�
    /changeset[/{revision}]
    -----------------------

    Show information about a single changeset.

    A URL path argument is the changeset identifier to show. See ``hg help
    revisions`` for possible values. If not defined, the ``tip`` changeset
    will be shown.

    The ``changeset`` template is rendered. Contents of the ``changesettag``,
    ``changesetbookmark``, ``filenodelink``, ``filenolink``, and the many
    templates related to diffs may all be used to produce the output.
    R�(RR�R3R&R_tchangesetentry(R+Rn((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR��sRlcC@s|S(s�Hook for mapping a path in the repository to a path in the
    working copy.

    Extensions (e.g., largefiles) can override this to remap files in
    the virtual file system presented by the manifest command below.((R7((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt
decodepath�sR4c@s�d|jjkrBtj|j|j��tj|j��}n|jd�d}tj|j|jjjdd��}�j��t	j
��}i�i�t|j��|r�|ddkr�|d7}nt
|�}d|�x��j�D]�\}}t|�}|| |kr&q�n||}|jd�}	t
|	�dkr^|�|<q��}
xN|	dd!D]?}||
kr�i|
|<n|
|}
t
|
�dkrrPqrqrWd|
d<q�W�r��r��r�ttd	|��n����fd
�}���fd�}
|jdd
|d�dtj��dt��dtj|�dtj|
�d|jt|��tjtj|j����S(s�
    /manifest[/{revision}[/{path}]]
    -------------------------------

    Show information about a directory.

    If the URL path arguments are omitted, information about the root
    directory for the ``tip`` changeset will be shown.

    Because this handler can only show information for directories, it
    is recommended to use the ``file`` handler instead, as it can handle both
    directories and files.

    The ``manifest`` template will be rendered for this handler.
    R�R�R%R.i����R/iispath not found: c3@s~xwt��D]i}�|}�j|�}i|d6t��d6|d6|j�d6|j�d6�j|�d6Vq
WdS(NR%RNtbasenametdatetsizeRZ(tsortedR5RRR�R�Rd(RSRhtfullRF(RnR�tmfRN(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pytfilelist4s




c3@s�x�t��D]�}g}�|}x_t|t�r�t|�dkr�tt|j���\}}|r{|j|�n|}q&Wd�|f}it��d6|d6dj|�d6|d6Vq
WdS(Nis%s%sRNR7R/t	emptydirsR�(	R�t
isinstancetdictRqRRtitertitemsRR�(RStdR�thtktvR7(tabspathtdirsRN(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pytdirlist@s
$
R4RXR7R`tupparitytfentriestdentriesR�N(R&R'RR�R3RbR2R(R4RR�RR\Rqt	iteritemsR�R}R<RRR_R`RRRRaR�RRRfRg(R+RXR7R�RwR�R�RhtremaintelementsR�telemR�R�((R�RnR�R�R�RNsA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR4�sZ
'





ttagsc@s�tt�jj����t�j�����fd�}�jddt�jjj	��dt
j|dttf�dt
j|dt
tf�dt
j|dt
t
f��S(s�
    /tags
    -----

    Show information about tags.

    No arguments are accepted.

    The ``tags`` template is rendered.
    c3@s��}|r@g�D]$\}}|dkr||f^q}n|rS|d }nxN|D]F\}}it��d6|d6�j|j�d6t|�d6VqZWdS(NR�iRNttagR�R�(RRR3R�R(RStnotipt
latestonlyRUR�R�(RvRNR+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR�ks4
R�R�R�targstentriesnotipR�(R�treversedR3ttagslistRR\R_RR*R�RRatFalseRQ(R+R�((RvRNR+sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR�\st	bookmarksc
@s!g�jjj�D]}|d�jkr|^q��fd�}t�d|dt��t�j�����fd�}�r��dd}nd}�j|j�}�jdd	t	�jj
j��d
tj
i|d6g�dtj|d
tf�dtj|d
tf��S(s�
    /bookmarks
    ----------

    Show information about bookmarks.

    No arguments are accepted.

    The ``bookmarks`` template is rendered.
    ic@s�j|dj�|dfS(Nii(R3Rl(tb(R+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt<lambda>�R.tkeyRtc3@sn�}|r�d }nxN|D]F\}}it��d6|d6�j|j�d6t|�d6Vq WdS(NiRNtbookmarkR�R�(RRR3R�R(RSR�RUR�R�(RvRNR+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR��s
ii����R�R�t
lastchangeR�R�R�R�(R3t
_bookmarksR�R�RQRR\R�R_RR*R�RR�RaR�(R+R�tsortkeyR�t	latestrevtlastdate((RvRNR+sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR�s8
tbranchescC@sdtj|j|j�}tj|j|jd�}|jddt|jjj��d|d|�S(s�
    /branches
    ---------

    Show information about branches.

    All known branches are contained in the output, even closed branches.

    No arguments are accepted.

    The ``branches`` template is rendered.
    iRR�R�R�(Rt
branchentriesR3R\R_RR*R�(R+R�R�((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR�stsummaryc@s�t�jj�����fd�}�fd�}���fd�}�jd}t�j�}td|�j��t|��j���jdd�}|s�d}n�jdd	�}�j	d
d|dt
�j�p�dd
|j�dtj
|dd�dtj
|�dtj�j�jd�dtj
|dd�d|j�ddd�jd�d	tj|dd��S(s�
    /summary
    --------

    Show a summary of repository state.

    Information about the latest changesets, bookmarks, tags, and branches
    is captured by this handler.

    The ``summary`` template is rendered.
    c3@s�t�j�}d}xz�D]r\}}|dkr:qn|d7}|dkrTPnit|�d6|d6t|�d6�j|j�d6VqWdS(	NiR�ii
RNR�R�R�(RR\RRRR3R�(RSRNR�R�R�(RvR+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt
tagentries�s


c3@s�t�j�}g�jjj�D]}|d�jkr"|^q"}�fd�}t|d|dt�}xR|d D]F\}}it|�d6|d6�j|j�d6t	|�d	6VqyWdS(
Nic@s�j|dj�|dfS(Nii(R3Rl(R�(R+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR��R.RRti
RNRR�R�(
RR\R3RR�R�RQRRR�R(RSRNR�tmarksRR�R�(R+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR��s8c3@s�t�jd���}g}g}��krP�jjj��d�}nxM|D]E}�j|}tj�j|�}t|�|d<|j|�qWWxt	|�D]}|Vq�WdS(NtoffsetiRN(
RR\R3R*RrRRgRRRR�(RSRNRwRrRvRnR�R�(tendtstartR+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR��s

R�iR+RtunknowntlabelsR	tdesctownerRR�RttagentryR�Ri
R�t
shortlogentryR�RXR�tlabel(R�R3R�RqRsR�tmintconfigt
configlistR_RR�RRaRRR\RR�t
hybridlist(R+R
R�R�R�R�RR((R
RvRR+sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR	�s4

		tfilediffcC@s�d	\}}ytj|j|j�}Wn`tk
r�tj|j|j�}tj|j|jjd�}||j	�kr��q�nX|dk	r�|j
�}|j�}n|j�}|jdd�}d|jjkr�|jjd}ntj
||||g|�}|dk	r7tj|�}|}ntjg�}|}|jdd|dtj|j|�d|d|tjtj|j|���S(
s
    /diff/{revision}/{path}
    -----------------------

    Show how a file changed in a particular commit.

    The ``filediff`` template is rendered.

    This handler is registered under both the ``/diff`` and ``/filediff``
    paths. ``/diff`` is used in modern code.
    R%R+RjRRXRYtdiffN(NN(R<RR5R3R&R6R�R2R'R�R7tp1RtdiffsRcRR�R_RbRRfRg(R+RFRnR7tbasectxRjRRY((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyRs8


	Rt
comparisoncC@s,tj|j|j�}d|jjkr<ttd��ntj|j|jjd�}d�}d|jjkr�||jjd�}n||jdd��}d�}d}|j
�}|j�}|j�}	|j�}
t
j|�}||krE||}||�}||kr,d}
qk||}||�}
n&d}|j�d|}||�}
tj||
|�}|dk	r�tj|�}|}ntjg�}|}|jd	d|d
tj|j|�d|d|d
t|	�d|
dt|�d|tjtj|j|���S(s�
    /comparison/{revision}/{path}
    -----------------------------

    Show a comparison between the old and new versions of a file from changes
    made on a particular revision.

    This is similar to the ``diff`` handler. However, this form features
    a split or side-by-side diff rather than a unified diff.

    The ``context`` query string argument can be used to control the lines of
    context in the diff.

    The ``filecomparison`` template is rendered.
    R%sfile not givencS@s|dkrdpt|�S(NR�i����(Re(R�((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR�YR.RSR+tcomparisoncontextcS@sp|j�r`tjtjtj|j���dp7d�}td�|t|j	��fgS|j
�j�S(Nisapplication/octet-streams(binary file %s, hash: %s)(tisbinaryRR>R9R:R;R7RRR]R8RP(RhRI((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt	filelines_s"	#itfilecomparisonRXRYtleftrevtleftnodetrightrevt	rightnodeRN(((RR�R3R&R'RRR2RR<RRlR�RR�tparentstcompareRcRR�R_RbRRRfRg(R+RnR7tparsecontextRSR"RFtparentR$R%R&R't
rightlinest	leftlinestpfctxRRY((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyRCsT		
	
	tannotatec@sUtj�j�j���j�}t�j���j��j�j	�k}i��fd������fd�}tj
�j�jjd���fd��jD���j
dd|dtj|�dtj|�dtj�j��d	tj��d
�j�j|�dt|�dtj��tjtj�j����S(
s)
    /annotate/{revision}/{path}
    ---------------------------

    Show changeset information for each line in a file.

    The ``ignorews``, ``ignorewsamount``, ``ignorewseol``, and
    ``ignoreblanklines`` query string arguments have the same meaning as
    their ``[annotate]`` config equivalents. It uses the hgrc boolean
    parsing logic to interpret the value. e.g. ``0`` and ``false`` are
    false and ``1`` and ``true`` are true. If not defined, the server
    default settings are used.

    The ``fileannotate`` template is rendered.
    c3@s�|j�}|�krmg�|<xH|j�D]7}i|j�d6|j�d6}�|j|�q/Wnx�|D]}|VqxWdS(NR�Rl(RlR(RR(RSRhRltpR�(tparentscache(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR(�s

c3@s��j�rttjtjtj�j���dp7d�}tjd�j	�j
��dddd|�g}ntj�j
��jj�}d}td�}x't|�D]\}}|j}|j�}||kr�t}	t|�}
nd}	|}it��d6|j�d	6|d
6|j�d6tj�d|f�d
6|j�d6|j�d6|j�d6|	d6|
d6|jd6|jd6|dd6d|dd6d|dd6|j�d6Vq�WdS(Nisapplication/octet-streamRFRTiRHs(binary:%s)RNR�RltauthorR�R(RtextraR%t	blockheadtblockparityt
targetlineRKsl%dRLs% 6dRMtrevdate( R!RR>R9R:R;R7RtannotatelineR5tfilerevRR/R&R3R�R<RRORFRlRQRRRR~RRaRR3RTRHR�(RSRIRVtpreviousrevtblockparitygenRTtalineRhRlR4R5(RFR(RNR+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR/�sB"		






R/c@s"i|]}t�|�|�qS((tgetattr(R�R�(tdiffopts(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pys
<dictcomp>�s	tfileannotateR%R7RXRYRZR[R>(RR5R3R&R7RR\R]R)R^tdifffeatureoptsR�R�R_RRaR`RbRcR4RdRet
hybriddictRRfRg(R+RhR[R/((R>RFR(R1RNR+sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR/�s(&R)c$@s'y4tj�j�j�}|j�}|j�}Wn�tjk
r tj�j�jj	d�}�jj
|�}t|�}|s��ntj�j�j�j
�}|jd�}||kr��n|d}x#|j|�|kr�|d8}q�W�jj||j|��}nX�j}d�jj	kr�yEt�jj	jd|��}t|d�}|�jjdd<Wq�tk
r�q�Xntj�j�}	tj�jjd�}
t|dd�|
d<tj�jjd�}|d|d<d�jj	k}|r8�jj	d|
d<|d<nd�jj	k}
|
ro�jj	d|
d<|d<n|j�d}td||�}t|||�}t�jd	||�}�j}|j�}g|j||d�D]!}|j|�|kr�|^q�}g}�jd
d��d�jj	krN�jj	d�nd��fd�}d}|	dk	r�tj|	�}t j!g�}|
r�t"j#||	�}nt"j$||	�}x�t%|d�D]�\}\}}d}|r||d
|�}n|j�}tj&||�} | j'it(|�d6|j
�d6|d6|d6tj|�d
6t j!g�d6�|j)| �||kr�Pq�q�Wtj|	�|
d
<|
d
|d
<n�x�|D]�}|j|�}!d}|r�||!�}ntj&||!�} | j'it(|�d6|d6|d6|d6tj*|!�d6�|j)| �q�W|j+�tj,�j|j��}"|"j-|d||�}|d }#�j.dd|d|dtj/�j|�dt j!|�d|
d|dt j!|#�d
|d|d|d|
t0j1tj&�j|���S(s)
    /filelog/{revision}/{path}
    --------------------------

    Show information about the history of a file in the repository.

    The ``revcount`` query string argument can be defined to control the
    maximum number of entries to show.

    The ``filelog`` template will be rendered.
    R%iiR�R�itpatchtdescendRR+Rjc@sZ|j�}|j�}|j�}tj�|||g�d|dd|j�d �S(Nt	linerangetlineidprefixs%s-i(R�RR7RRR(RFRDRnRR7(t	diffstyleR+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR3sRDRNR9RRYR)tnavRXR�R�R�R�N(2RR5R3R&R7R)R
R6R2R'R%RqR�RltlinkrevR�ReR(RsR�R�R�RDR�R9RRR\RrRR<tformatlinerangeRR�RtblockdescendantstblockancestorsRORgR�RRRRcRtt
filerevnavR�R_RbRRf($R+RFRhtfltnumrevsRltfirsttfrevR�tlrangeR�R�RBRCR�RR
RNR3R)R9RrR�RRDRGtitRvtctlrRR7R�titerfctxR�R�((RFR+sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR)�s�
"	
	!"	



	


tarchivec
C@s�|jjjd�}|jdd�}|jjd}|tjkrkdtj|�}tt	|��n||kp�|j
dd|�s�d|}tt|��ntj
dd	tjj|j��}|jj|�}|}||ks�|d
krt|�}nd||f}tj|j|j�}	g}
tj|	g�}|jjjd�}|r�d
|g}
tj|	|
dd�}|
r�g|	j�j�D]}
||
�r�|
^q�}|s�tt	d|��q�q�ntj|\}}}}||jjd<d||f|jjd<|rA||jjd<n|jj�t|jj��rutj d��n|jj!�}t"j#|j|||d|d|d|j
dd��gS(s�
    /archive/{revision}.{format}[/{path}]
    -------------------------------------

    Obtain an archive of repository content.

    The content and type of the archive is defined by a URL path parameter.
    ``format`` is the file extension of the archive type to be generated. e.g.
    ``zip`` or ``tar.bz2``. Not all archive types may be allowed by your
    server configuration.

    The optional ``path`` URL parameter controls content to include in the
    archive. If omitted, every file in the specified revision is present in the
    archive. If included, only the specified file or contents of the specified
    directory will be included in the archive.

    No template is used for this handler. Raw, binary content is generated.
    ttypeR+s
allow-archiveR�sUnsupported archive type: %stallowsArchive type not allowed: %ss\W+t-R�s%s-%sR%spath:tdefaultR7sfile(s) not found: %ssContent-Typesattachment; filename=%s%ssContent-DispositionsContent-Encodings4sendresponse() should not emit data if writing latertprefixtmatchfntsubrepostarchivesubrepos($R&R'R(RRtarchivespecsRtpprintRRR1RtretsubtosR7R�treponameR3R�RR�RR�R4tkeysR@RAtsetbodywillwriteR�RER
tProgrammingErrortgetbodyfileR
RV(R+ttype_tallowedRtmsgRdtcnodetarch_versionRRntpatsR�R%RhR�tmimetypetartypet	extensionRtbodyfh((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyRV}sT
$
1
tstaticcC@s�|jjd}|jdddt�}|s�|jp@tj�}t|t�r^|g}ng|D]}t	j
j|d�^qe}nt|||j
�|j
j�S(NR%R+Rst	untrusted(R&R'RR�ttemplatepathRt
templatepathsR�tstrRcR7R�R	R@RE(R+tfnameRsttpR0((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyRs�s+tgraphc$@s�d�jjkrBtj�j�j�}tj�j|�}n�jd}d}|j�}d}�j}d�jjkr�yEt�jjj	d|��}t
|d�}|�jjdd<Wq�t
k
r�q�Xntj�jjd�}t
|dd�|d<tj�jjd�}|d|d<�jjj	d|j���tj�jjd�}�|d<t�j�}	|}
tt
d	|	d�||�}t
d	||�}tj�j�j|
||	�}
g�g}d	�|
d
kr��jjj|
d	�}g}x5|D]-}|j|�t|�|dkr"Pq"q"Wt|�|kr�tj�j�j|d
�g}|d
 }n|d
�tj�jtj|��}td�tj|�j�D���n���fd����fd
�}��fd�}t��}�jdd|d|d|d|d|d|d|d|d|d|d|	dtj |�dtj!|�dtj!|�d|j�d�j"d�d|
�S(s�
    /graph[/{revision}]
    -------------------

    Show information about the graphical topology of the repository.

    Information rendered by this handler can be used to create visual
    representations of repository topology.

    The ``revision`` URL parameter controls the starting changeset. If it's
    absent, the default is ``tip``.

    The ``revcount`` query string argument can define the number of changesets
    to show information for.

    The ``graphtop`` query string argument can specify the starting changeset
    for producing ``jsdata`` variable that is used for rendering graph in
    JavaScript. By default it has the same value as ``revision``.

    This handler will render the ``graph`` template.
    R�R�i'R�iR�itgraphtopii����cs@s(|]}|dtjkr|VqdS(iN(Rt	CHANGESET(R�titem((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pys	<genexpr>(sc@s��j�j�}g}|dkr��jjj|��}tj�jtj|��}td�tj	|�j�D��}n|S(Ni����cs@s(|]}|dtjkr|VqdS(iN(RR|(R�R}((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pys	<genexpr>1s(
R3RlR*RrRt	dagwalkerRtbasesetR�tcolored(R�R�Rrtdag(R{tlastrevR+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pytfulltree+s(c3@s`xY��D]N\}}}}}itj|�d6tj�j|�d6|d6|d6Vq
WdS(NR�t	graphnodetvertextedges(RtbytestrRtgetgraphnodeR3(RStidRWRntvtxR�(R�R+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pytjsdata5s
c3@st�j�}x�t��D]�\}\}}}}}tj�j|�}g|D]O}	i|	dd6|	dd6|	ddddd6|	dd	6|	d
d6^qS}
|ji|dd6|ddddd6t|�d6tj	|
�d
6|d6|dd6�|VqWdS(NitcolitnextcoliitcoloritwidthitbcolorRNR�trowtnextrow(
RR\RORRgR3R�RRRR�(RSRNR�R�RWRnR�R�R�tedgetedgedata(R�R+(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pytnodes<s(Y
RzRlRXtuprevR�R�tdownrevt	graphvarstrowst	bg_heightR�R�R�R�R�R�(#R&R'RR�R3RbRlR�ReR(RsR�R�R�R�RRqRR�R�R*RrRRgRR~RRR�R�R_RR�RaR�(R+RnRXRlR�R�R�R�R�R�R�R�R�R�R�tallrevsRrRvR�R�R�R�((R�R{R�R�R+sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyRz�s�
	

 !

#

(
cC@s?|dj}|r/t|�jd�d}ntd�}|S(Nis
s(no help text available)(R#Rt	partition(Rytdoc((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt_getdocfs

thelpc
@s�ddlm}m�|jjjd�}|s`�fd�}gg��d�}x�|jj�D]�\}}t|�}d|ksf|j	d�r�qfn||�}t
|dd	t�r��j||f�qf�j||f�qfW�j
��j
��fd
�}	�fd�}
|jdd
tj|�dtj|	�dtj|
�dd�S|�jkr�g}xR�j|D]C\}}}
|jid||dfd6|dd6|d6�q�W|jdd
tj|�d|dt�Stjj�}t|_d|krO|jdd�\}}|�jkr[tt��q[n|}d}y�j|||d|�}Wn tjk
r�tt��nX|jdd|d|�S(s�
    /help[/{topic}]
    ---------------

    Render help documentation.

    This web command is roughly equivalent to :hg:`help`. If a ``topic``
    is defined, that help topic will be rendered. If not, an index of
    available help topics will be rendered.

    The ``help`` template will be rendered when requesting help for a topic.
    ``helptopics`` will be rendered for the index of help topics.
    i(RR�R�c3@sEx>�jD]3}|dd!\}}}i|dd6|d6Vq
WdS(NiittopicR	(t	helptable(RSR�R�R	t_doc(thelpmod(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyttopics�scS@s|jd�dS(Nt|i(R�(ts((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR��R.t
DEPRECATEDtdebugit	helpbasicc3@s.x'�D]\}}i|d6|d6VqWdS(NR�R	((RSRSR�(tearly(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt
earlycommands�sc3@s.x'�D]\}}i|d6|d6VqWdS(NR�R	((RSRSR�(tother(sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt
othercommands�st
helptopicsR�R�R�ttitletIndexs%s.%sR�R�R	tsubindext.itsubtopicR�R�N(R.RR�R&R'R(ttableR�R�R?R=R�RtsortR_RRat	subtopicsR�RQRtwsgiuitloadtverboseR}RRR<thelp_R
R�(R+Rt	topicnameR�tprimaryRSRyR�tcmdR�R�R�R	R�tuR�R�((R�R�R�sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyR�nsh
	

		(Bt
__future__RR�R9RcRati18nRR�RRtcommonRRRRRR	R.R
RRR
RRRRRRRRtutilsRRRRtobjectRR$R,RiR%R�R�R*R�R�RlR�R4R�R�RR	RRRR/R)RVRsRzR�R�tvaluest
i18nfunctions(((sA/usr/lib64/python2.7/site-packages/mercurial/hgweb/webcommands.pyt<module>sP.	R'	"	�	[	d#(T/K^�L�	_