�
�c@s�ddkZddkZddkZddkZddkZddklZlZhZgZ d�Z
d�Zd�Zd�Z
d�Zd�Zd �Zd
�Zd�ZdS(i�N(t_tgettextccs5x.tD]&}t|}|o||fVqqWdS(N(t_ordert_extensions(tnametmodule((s./mercurial/extensions.pyt
extensionss
cCsyt|SWnltj
o`xJti�D]<\}}|id|�p|id|�o|Sq*q*Wt|��nXdS(s'return module with given extension namet.t/N(RtKeyErrort iteritemstendswith(Rtktv((s./mercurial/extensions.pytfinds
(cCs�|idd�}tii|�}tii|�oYtii|id��\}}ti||g�\}}}ti ||||�Snti
||�SdS(NRRR(treplacetostpatht
expandusertisdirtsplittrstriptimptfind_moduletload_moduletload_source(Rtmodule_nametdtftfdtfpathtdesc((s./mercurial/extensions.pytloadpaths!cCs�|id�p|id�o|d}n|}|tjodSndt|<|ot|d|�}n@d�}y|d|�}Wntj
o||�}nX|t|<ti|�t|dd�}|o||�ndS(Nshgext.shgext/ishgext.%scSsCt|�}|id�}x!|dD]}t||�}q&W|S(NRi(t
__import__Rtgetattr(Rtmodt
componentstcomp((s./mercurial/extensions.pytimporth8stuisetup(t
startswithRtNoneR tImportErrorRtappendR"(tuiRRt shortnameR#R&R'((s./mercurial/extensions.pytload*s$
cCs�|id�}x�|D]�\}}|o|ddjoqqEnyt|||�Wqtj
o
�qtj
of}|o$|itd�|||f�n|itd�||f�|i�odSq�qXqWdS(NRit!s.*** failed to import extension %s from %s: %s
s&*** failed to import extension %s: %s
i(tconfigitemsR.tKeyboardInterruptt ExceptiontwarnRt traceback(R,tresultRRtinst((s./mercurial/extensions.pytloadallIs$
c
s�ti||�\}}x2|i�D]$\}}||jo|}Pq%q%W|d���fd�}t�d�|_t�d�|_t|�} || d<t| �||<|S(Nics"ti��ti��||�S(N(tutiltchecksignature(targstkwargs(torigfntwrapper(s./mercurial/extensions.pytwrapest__doc__t
__module__(tcmdutiltfindcmdR
R"R?R@tlistttuple(
ttabletcommandR=taliasestentrytaliastetkeyR>tnewentry((R<R=s./mercurial/extensions.pytwrapcommand]s
cs5��fd�}t||��t|||��S(Ncs��||�S(N((R:R;(R<R=(s./mercurial/extensions.pyR>rs(R"tsetattr(t containertfuncnameR=R>((R<R=s./mercurial/extensions.pytwrapfunctionqsc
Cs�ddk}tiitii|i��}yti|�}Wntj
od
SnXh}d}xM|D]E}|i d�o/|i
dd�d}tii||�}n9|}tii||d�}tii|�pqmn||jp|t
jp
|djoqmnyt|�}Wntj
o
qmnXti|�} |i�| ot| �i�d||<ntd �||<t|�|jot|�}qmqmW||fS(s_find disabled extensions from hgext
returns a dict of {name: desc}, and the max name lengthi�Nis.pyRis__init__.pyt__init__s(no help text available)(Ni(thgextRRtdirnametabspatht__file__tlistdirtOSErrorR)RtrsplittjointexistsRtopentIOErrorthelpt moduledoctcloseRt
splitlinesRtlen(
RStextpathtfilestextst maxlengthRJRRtfiletdoc((s./mercurial/extensions.pytdisabledys>! '
cCs�h}d}g}xut�D]j\}}t|i�p
td�}|id�d}tt|�|�}|i�di�||<qW||fS(sDreturn a dict of {name: desc} of extensions, and the max name lengthis(no help text available)Ri�( RRR?RRtmaxRbRatstrip(ReRftexthelpstenametextRh((s./mercurial/extensions.pytenabled�s
(RRR8RAR^ti18nRRRRRRR R.R7RMRQRiRo(((s./mercurial/extensions.pys<module>s$
.
|