Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/site-packages/mercurial/templatekw.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��c@s�ddlmZddlZddlZddlZddlZdefd��YZddd�Z	dd�Z
d�Zd�Zdd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d �Z$d!�Z%d"�Z&d#�Z'd$�Z(d%�Z)ied&6ed'6ed(6ed)6ed*6ed+6ed,6ed-6ed.6ed/6ed06ed16ed26ed36ed46ed56ed66ed76e d86e!d96e"d:6e$d;6e#d<6e%d=6e&d>6e'd?6e(d@6e)dA6Z*dB�Z+ie+dC6Z,e,j-e*�e,j.�Z/dS(Di�(thexNt_hybridcBs&eZdd�Zd�Zd�ZRS(cCs4||_||_|r$||_nd�|_dS(NcSs|j�dS(Ni(tvalues(tx((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt<lambda>s(tgenRtjoinfmt(tselfRRR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt__init__s
		cCs|jS(N(R(R((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt__iter__sccsx|jD]}|Vq
WdS(N(R(RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt__call__sN(t__name__t
__module__tNoneRR	R
(((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyRs	cKsK|s|}nt||||�}t|g|D]}i||6^q1�S(N(t	_showlistR(tnameRtpluraltelementtargstfR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowlists	c+s�|d�|r|}n
�d}|sTd|}|�krP�||�VndS��kr�t|dt�r�dj|�Vnx|D]}t||�Vq�WdSd|}|�kr��||�Vn|j������fd�}d	�}	|	�kr|j�}
nd}
x|D]}||�Vq$W|
dk	rY||
d
|	�Vnd|}|�kr��||�VndS(s�expand set of values.
    name is name of key in template map.
    values is list of strings or dicts.
    plural is plural of name, if not simply name + 's'.

    expansion works like this, given name 'foo'.

    if values is empty, expand 'no_foos'.

    if 'foo' not in template map, return values as a string,
    joined by space.

    expand 'start_foos'.

    for each value, expand 'foo'. if 'last_foo' in template
    map, expand it instead of 'foo' for last key.

    expand 'end_foos'.
    ttempltstno_Nit tstart_cs{y�j|�WnZttfk
rmy%x|D]\}}|�|<q1WWqntk
ri|��<qnXnX�|��S(N(tupdatetAttributeErrort
ValueError(tvttagtatb(RRtvargs(s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytoneLs
tlast_Rtend_(t
isinstancetstrtjointdicttcopytpopR
(RRRRtnamestnonameRt	startnameR"tlastnametlasttendname((RRR!s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyR$s>
	







cCsCd|kr;|j|j�j�|j��d |d<n|dS(Ntfilesi(tstatustp1tnode(trepotctxtrevcache((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytgetfilescs/c
sod|kr id
d6|d<n|d�|j�}|g}x%|rf|j�}|�krfqBn||}g|j�D]!}|j|�dkr}|^q}}|r�|j�dddjt|��f�|<qBny/t�fd�|j�D��\}}}	Wn>t	k
rK|j
|�|jd�|j�D��qBnX||d	|	f�|<qBW�|S(s8return date, distance and name for the latest tag of revt
latesttagsitnulli�tglobalt:c3s|]}�|j�VqdS(N(trev(t.0tp(R9(s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pys	<genexpr>�scss|]}|j�VqdS(N(R=(R>R?((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pys	<genexpr>�si(iiR:(R=R*ttagsttagtypetdateR'tsortedtmaxtparentstKeyErrortappendtextend(
R5R6tcacheR=ttodottR@tpdatetpdisttptag((R9s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt
getlatesttagshs.
		
4,,

cs:i��dkr!t���n���fd�}|S(Ncs�|�kr~i�|<�j|�}xV|D]K}|j|�}|j|j|��}|�||<|�kr,Pq,q,Wn|�|kr��||Sy�||j�SWntjk
r�dSXdS(s�looks up all renames for a file (up to endrev) the first
        time the file is given. It indexes on the changerev and only
        parses the manifest if linkrev != changerev.
        Returns rename info for fn at changerev rev.N(tfiletlinkrevtrenamedR4terrortLookupErrorR
(tfnR=tfltitlrRR(tendrevtrcacheR5(s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt
getrenamed�s

(R
tlen(R5RYR[((RYRZR5s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytgetrenamedfn�s
cKs
|j�S(s8:author: String. The unmodified author of the changeset.(tuser(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt
showauthor�scKstj||j��S(s0:bisect: String. The changeset bisection status.(thbisecttlabelR4(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt
showbisect�scKs|dj�S(sV:branch: String. The name of the branch on which the changeset was
    committed.
    R6(tbranch(R((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt
showbranch�scKs9|dj�}|dkr5td|gdd|�SdS(s�:branches: List of strings. The name of the branch on which the
    changeset was committed. Will be empty if the branch name was
    default.
    R6tdefaultRcRtbranchesN(RcR(RRc((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowbranches�scKs |dj�}td||�S(sR:bookmarks: List of strings. Any bookmarks associated with the
    changeset.
    R6tbookmark(t	bookmarksR(RRi((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt
showbookmarks�scKsI|d}g|j�D]}d||f^q}td|dd|�S(s::children: List of strings. The children of the changeset.R6s%d:%stchildrenRtchild(RkR(RR6tcctxt	childrevs((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowchildren�s
)cKs
|j�S(sC:date: Date information. The date when the changeset was committed.(RB(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowdate�scKs|j�j�S(s5:desc: String. The text of the changeset description.(tdescriptiontstrip(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowdescription�sc
KsStjtj|j���}tj|�\}}}}}	dt|�||fS(st:diffstat: String. Statistics of changes with the following format:
    "modified files: +added/-removed lines"
    s%s: +%s/-%s(tpatchtdiffstatdatatutilt	iterlinestdifftdiffstatsumR\(
R5R6RRtstatstmaxnametmaxtotaltaddstremovestbinary((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowdiffstat�scksq|d}x`t|dj�j��D]B\}}|j�}|jtd|d|��|d|�Vq'WdS(NRR6tkeytvaluetextra(RCR�titemsR)RR((RRR�R�((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt
showextras�s

)cKsF|d|d|d}}}tdt|||�ddd|�S(s;:file_adds: List of strings. Files added by this changeset.R5R6R7tfile_addiRRP(RR8(RR5R6R7((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowfileadds�s c
Ks|d|d}}|djd�}|dkr�d|krWt|d�|d<ng}|d}xL|j�D];}|||j��}|rt|j||df�qtqtWng|D]"}i|dd6|d	d
6^q�}td|dd
|�}	t|	|d��S(sZ:file_copies: List of strings. Files copied in this changeset with
    their sources.
    RIR6R7tcopiesR[R5iRitsourcet	file_copyRtfile_copiescSsd|d|dfS(Ns%s (%s)RR�((R((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyR�sN(tgetR
R]R1R=RGRR(
RRIR6R�R[RUtrenameRtcR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowfilecopies�s
!/cKss|djd�pg}g|D]"}i|dd6|dd6^q }td|dd	|�}t||d
��S(ss:file_copies_switch: List of strings. Like "file_copies" but displayed
    only if the --copied switch is set.
    R7R�iRiR�R�RR�cSsd|d|dfS(Ns%s (%s)RR�((R((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyRs(R�RR(RR�RR�R((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowfilecopiesswitchs/cKsF|d|d|d}}}tdt|||�ddd|�S(s=:file_dels: List of strings. Files removed by this changeset.R5R6R7tfile_deliRRP(RR8(RR5R6R7((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowfiledels
s cKsF|d|d|d}}}tdt|||�ddd|�S(s>:file_mods: List of strings. Files modified by this changeset.R5R6R7tfile_modiRRP(RR8(RR5R6R7((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowfilemodss cKstd|dj�|�S(sZ:files: List of strings. All files modified, added, or removed by this
    changeset.
    RPR6(RR1(R((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt	showfilesscKst|||�dS(sW:latesttag: String. Most recent global tag in the ancestors of this
    changeset.
    i(RO(R5R6RRIR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt
showlatesttagscKst|||�dS(s<:latesttagdistance: Integer. Longest path to the latest tag.i(RO(R5R6RRIR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowlatesttagdistance"scKs{|d|d|d}}}|j�}|jtd|jj|j�d�dt|j�d���|d|�S(NR5R6RR=iR4tmanifest(R)RR(R�R=t	changesetR(RR5R6R((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowmanifest&s
 (cKs
|j�S(s\:node: String. The changeset identification hash, as a 40 hexadecimal
    digit string.
    (R(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshownode-scKs|j�j�S(s�:p1rev: Integer. The repository-local revision number of the changeset's
    first parent, or -1 if the changeset has no parents.(R3R=(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt	showp1rev3scKs|j�j�S(s�:p2rev: Integer. The repository-local revision number of the changeset's
    second parent, or -1 if the changeset has no second parent.(tp2R=(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt	showp2rev8scKs|j�j�S(s�:p1node: String. The identification hash of the changeset's first parent,
    as a 40 digit hexadecimal string. If the changeset has no parents, all
    digits are 0.(R3R(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt
showp1node=scKs|j�j�S(s�:p2node: String. The identification hash of the changeset's second
    parent, as a 40 digit hexadecimal string. If the changeset has no second
    parent, all digits are 0.(R�R(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt
showp2nodeCscKs
|j�S(s):phase: String. The changeset phase name.(tphasestr(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt	showphaseIscKs
|j�S(s.:phaseidx: Integer. The changeset phase index.(tphase(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowphaseidxMscKs
|j�S(s>:rev: Integer. The repository-local changeset revision number.(R=(R5R6RR((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowrevQscKstd|dj�|�S(s?:tags: List of strings. Any tags associated with the changeset.RR6(RR@(R((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pytshowtagsUstauthortbisectRcRfRiRkRBtdesctdiffstattextrast	file_addsR�tfile_copies_switcht	file_delst	file_modsR1t	latesttagtlatesttagdistanceR�R4tp1revtp1nodetp2revtp2nodeR�tphaseidxR=R@cKsdS(s�:parents: List of strings. The parents of the changeset in "rev:node"
    format. If the changeset has only one "natural" parent (the predecessor
    revision) nothing is shown.N((R((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt_showparents�sRE(0R4RRtRvRSR`tobjectRR
RRR8ROR]R_RbRdRgRjRoRpRsR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�tkeywordsR�tdockeywordsRRt
i18nfunctions(((s8/sys/lib/python2.7/site-packages/mercurial/templatekw.pyt<module>s�$?		! 																														
	



Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].