403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/__pycache__/extensions.cpython-39.opt-1.pyc
a

�+�bkz�@s�ddlmZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZm
Z
mZddlmZmZmZmZmZddlmZiZiZiZgZhd�ZdVd	d
�Zdd�Zd
d�Zdd�ZdWdd�Zdd�Z dd�Z!dZ"dd�Z#dd�Z$dXdd�Z%dd�Z&d d!�Z'dYd"d#�Z(d$d%�Z)d&d'�Z*d(d)�Z+d*d+�Z,d,d-�Z-dZd.d/�Z.d0d1�Z/Gd2d3�d3e0�Z1d4d5�Z2d[d6d7�Z3d8d9�Z4d:d;�Z5d<d=�Z6d>d?�Z7d@dA�Z8dBdC�Z9dDdE�Z:dFdG�Z;dHdI�Z<d\dKdL�Z=d]dNdO�Z>dPdQ�Z?dRdS�Z@dTdU�ZAdS)^�)�absolute_importN�)�_�gettext)�getattr�open�setattr)�cmdutil�configitems�error�pycompat�util)�
stringutil>	s
parentrevspecsprogresssinterhgshgciashbisectsinotifys	bookmarksscolorsshelvec#sF�r�fdd�}ndd�}tD]"}t|}|r||�r||fVqdS)Ncs6dD],}��d||�}|dur|�d�sdSqdS)N)s%s�hgext.%s�
extensions�!T)Zconfig�
startswith)�name�formatZconf��ui��:/usr/lib64/python3.9/site-packages/mercurial/extensions.py�enabled9szextensions.<locals>.enabledcSsdS)NTr)rrrr�<lambda>@�zextensions.<locals>.<lambda>)�_order�_extensions)rrr�modulerrr�
extensions6srcCsld}zt|}WnJtyZt�t�D],\}}|�d|�sL|�d|�r(|}qVq(Yn0|sht|��|S)z'return module with given extension nameN�.�/)r�KeyErrorr�	iteritems�endswith)r�mod�k�vrrr�findGsr(c
Cs�|�dd�}t�t�|��}t�|�}t�|�}tj�|�rptj�	|�\}}t
�||g�\}}}t
�||||�Szt
�
||�WSty�}z|js�||_�WYd}~n
d}~00dS)Nr �_)�replacer
�normpathZ
expandpathr�fsdecode�os�path�isdir�split�imp�find_module�load_moduleZload_source�IOError�filename)r.Zmodule_name�d�f�fdZfpath�desc�excrrr�loadpathVs 

�r;cCs8tt�|��}|�d�}|dd�D]}t||�}q$|S)z#import and return the <name> moduler rN)�
__import__r�sysstrr0r)rr%�
components�comprrr�_importhms

r@c
Cs�|rt|d|�}n�ztd|�}Wn�ty�}zv|rL||d|d|�ztd|�}Wn@ty�}z(|r�||d||�t|�}WYd}~n
d}~00WYd}~n
d}~00|S)Nrshgext3rd.%s)r;r@�ImportError)rr.Z
reportfuncr%�errrrr�
_importextvs4rCcCs6|�dd|t�|�|�|jr2|�dd�r2|��dS)N�	extensions*    - could not import %s (%s): trying %s
sdevelsdebug.extensions)�logr�forcebytestrZ	debugflagZ
configbool�	traceback)rrBZfailed�nextrrr�_reportimporterror�s�rIcCs�t|tttf�r&|D]}t||�qndt|t�rf|��D]*\}}t||�td|t�|�f|�q8n$t|t	d��r�t
jd||fdd��dS)Ns%s.%s�sunicode %r found in %ssuse b'' to make it byte string��hint)�
isinstance�list�set�tuple�_rejectunicode�dict�itemsrrF�typer�ProgrammingError)rZxs�xr&r'rrrrQ�s


�rQ)snoreposoptionalrepos	inferrepocsTt�|�D]D\}}|d��fdd�tD�}|s2q
tjdd�|�d|d��q
dS)	z4Check if extension commands have required attributesrcsg|]}t��|�s|�qSr)r
�safehasattr)�.0�a�r7rr�
<listcomp>�rz%_validatecmdtable.<locals>.<listcomp>smissing attributes: %ss, s'use @command decorator to register '%s'rKN)rr#�
_cmdfuncattrsrrU�join)r�cmdtable�c�e�missingrrZr�_validatecmdtable�s�rbcCsXdD]}t|t||i��qdD] }t||d�}|r t||j�q t|t|di��dS)z=Sanity check for loadable tables provided by extension module)�cmdtable�
colortable�configtable)�filesetpredicate�
internalmerge�revsetpredicate�templatefilter�templatefunc�templatekeywordNr^)rQrZ_tablerb)rr%�t�orrr�_validatetables�srncCs�|�d�s|�d�r"|dd�}n|}|tvr2dS|tvrBt|S|�dd|�dt|<t�d|��"}t||tt|��}Wd�n1s�0Y|�dd||�|dur�|||j	7<t
|dd�}|�rNtjd	d
�}t�t�
|�d	�}	d|	v�r|	d�pd|	d�pdf}	d|v�s*|	|k�rNtd
�}
|�|
||t��f�dS|�dd|�t||�|t|<t�|�|�dd|�t�d|��.}t�|g�D]}|dd��q�Wd�n1�s�0Y|�dd|�|S)Nshgext.shgext/�rDs  - loading extension: %s
zload extension %ss  > %s extension loaded in %s
Zminimumhgversion�)�nrrs^(third party extension %s requires version %s or newer of Mercurial (current: %s); disabling)
s&    - validating extension tables: %s
s(    - invoking registered callbacks: %s
zcallbacks extension %sT��loadeds     > callbacks completed in %s
)r�_builtinrrEr
�timedcmrC�bindrI�elapsedrZversiontuplerrFr�warn�versionrnr�append�_aftercallbacks�get)rrr.�loadingtime�	shortname�statsr%ZminverZcurverZextmin�msg�fnrrr�load�sL0
�

�.r�c
Csxtt|dd�}|rtz||�WnRtyr}z:|jdd�t�|�}|�td�||f�WYd}~dSd}~00dS)N�uisetupT��force�&*** failed to set up extension %s: %s
F�rr�	ExceptionrGrrFrxr)rrr��instr�rrr�_runuisetup�s
r�c
Csxtt|dd�}|rtz||�WnRtyr}z:|jdd�t�|�}|�td�||f�WYd}~dSd}~00dS)N�extsetupTr�r�Fr�)rrr�r�r�rrr�_runextsetups
r�cs�t�t�}|�d�}�dur.�fdd�|D�}dd�|D�}tt�}|�dd|rTdnd�|�dd	t|��t�d
����}|�	dd�d}|D�]t\}}|r�|d
d�dkr�|t
vr�|�dd|�|dd�t
|<q�zt||||�Wq�t�y}	�zt
�|	�}
|�r"td�}||||
f;}ntd�}|||
f;}|��}|�	d|�d}
|�|
�t
�|�dd���r�d}t|	tj��r�|	j�r�|	j}|du�r�td�}tj||d��n@|�d|�t|	tj��r�|	j�r�|�td�|	j�|��WYd}	~	q�d}	~	00q�Wd�n1�s0Y|�ddtt�||�dtdfg}|�dd�t|||�t�}|�dd�t�d���}t|d�D]�}|�dd|�t�d|��4}t||��s�|�dd |�|�|�Wd�n1�s�0Y|�dd!||�|||j7<�q�Wd�n1�s,0Y|�dd"|�|�dd#�t�d$���}t|d�D]�}||v�rz�qh|�dd%|�t�d&|��4}t ||��s�|�dd'|�|�|�Wd�n1�s�0Y|�dd(||�|||j7<�qhWd�n1�s0Y|�dd)|�|D]}|�dd*|�dt!|<�q2|�dd+�t�d,��R}t"D]<}|t!v�r~�qlt"|D]}|�dd-|�|d.d/��q��qlWd�n1�s�0Y|�dd0|�t"�#�dd1l$m%}m&}m'}m(}m)}m*}m+}m,}|�dd2�d3|d4fd5|d6fd7|d8fd9|d:fd;|d8fd<|d=fd>|d?fd@|dAfg}t�dB��}t|||�Wd�n1�s�0Y|�ddC|�t-|�D] }|�ddD|t�.||���q�|�ddE�dS)FNrcs g|]\}}|�vr||f�qSrr�rXr&r'��	whitelistrrr[rzloadall.<locals>.<listcomp>cSs g|]\}}d|vr||f�qS)�:rr�rrrr[rrDsloading %sextensions
sadditional rs- processing %d entries
zload all extensions�*rrrs$  - skipping disabled extension: %s
s+failed to import extension "%s" from %s: %ss#failed to import extension "%s": %ssrequiredsnosSloading of this extension was required, see `hg help config.extensions` for detailsrKs*** %s
s	*** (%s)
s&> loaded %d extensions, total time %s
resloadconfigtables!- loading configtable attributes
s- executing uisetup hooks
zall uisetups  - running uisetup for %s
z
uisetup %ss&    - the %s extension uisetup failed
s  > uisetup for %s took %s
s> all uisetup took %s
s- executing extsetup hooks
zall extsetups  - running extsetup for %s
zextsetup %ss'    - the %s extension extsetup failed
s  > extsetup for %s took %s
s> all extsetup took %s
s$    - disabling broken %s extension
s%- executing remaining aftercallbacks
Zaftercallbackss.  - extension %s not loaded, notify callbacks
Frrs+> remaining aftercallbacks completed in %s
)�color�commands�	filemerge�fileset�revset�templatefilters�
templatefuncs�
templatekws)- loading extension registration objects
rcsloadcmdtablerdsloadcolortablerfs
loadpredicatergsloadinternalmergerhris
loadfilterrjsloadfunctionrksloadkeywordzload registration objectss0> extension registration object loading took %s
s*> extension %s take a total of %s to load
sextension loading complete
)/�collections�defaultdict�intr
�lenrrEr
ruZconfigsuboptions�_disabledextensionsr�r�rrFr�copy�updateZ	parseboolr|rMrZHintrLZAbortrxrG�
_loadextrarOr��addrwr�rr{�clearrJr�r�r�r�r�r�r�r��sortedZ	timecount)rr�r}�result�newindexrZdefault_sub_optionsrr.r�r�Z	error_msg�optionsZext_optionsrLZearlyextraloaders�brokenZalluisetupstatsZallextetupstatsr~r�r�r�r�r�r�r�r�r��extraloadersrr�r�loadalls


��
�

�@
���*6
�*6
�2(�
,��r�c	CsZt|d�D]H}t|}|sq|D]0\}}}t||d�}|dur"t||�|||�q"qdS�N)rrr)	rr�r�rrZobjnameZ	loadermodZ
loadernameZextraobjrrrr��sr�cCs6|tvr t|du}||d�nt�|g��|�dS)a�Run the specified function after a named extension is loaded.

    If the named extension is already loaded, the callback will be called
    immediately.

    If the named extension never loads, the callback will be called after
    all extensions have been loaded.

    The callback receives the named argument ``loaded``, which is a boolean
    indicating whether the dependent extension actually loaded.
    Nrr)rr{�
setdefaultrz)�	extension�callbackrsrrr�afterloaded�s
r�cCs�t|�D]t\}}t|dd�}|s"qz||�Wqtyz}z4|jdd�|�td�|t�|�f�WYd}~qd}~00qdS)aMRun extension hooks on the given ui to populate additional members,
    extend the class dynamically, etc.

    This will be called after the configuration is loaded, and/or extensions
    are loaded. In general, it's once per ui instance, but in command-server
    and hgweb, this may be called more than once with the same ui.
    Z
uipopulateNTr�s.*** failed to populate ui by extension %s: %s
)rrr�rGrxrrrF)rrr%�hookr�rrr�
populateui�s��r�cs��fdd�}|S)z�Partial function application

    Returns a new function that is the partial application of args and kwargs
    to func.  For example,

        f(1, 2, bar=3) === bind(f, 1)(2, bar=3)cs��|i|��Sr�r)rY�kw��args�funcrr�closureszbind.<locals>.closurer)r�r�r�rr�rrvs	rvcCs\z|j|_WntyYn0t|d�|_t|d�|_|j�t|di��||_||_dS)z.Copy and add some useful attributes to wrapper�
__module__�__doc__�__dict__N)	�__name__�AttributeErrorrr�r�r�r��	_origfunc�_unboundwrapper)�wrap�origfnZunboundwrapperrrr�_updatewrappersr�c
Cs�t�||�\}}t�|�D]\}}||ur|}	q4q|d}
t�t�|�t�|
��}t||
|�|durv|j	|7_	t
|�}||d<|dur�|d|7<t|�||	<|S)a.Wrap the command named `command' in table

    Replace command in the command table with wrapper. The wrapped command will
    be inserted into the command table specified by the table argument.

    The wrapper will be called like

      wrapper(orig, *args, **kwargs)

    where orig is the original (wrapped) function, and *args, **kwargs
    are the arguments passed to it.

    Optionally append to the command synopsis and docstring, used for help.
    For example, if your extension wraps the ``bookmarks`` command to add the
    flags ``--remote`` and ``--all`` you might call this function like so:

      synopsis = ' [-a] [--remote]'
      docstring = """

      The ``remotenames`` extension adds the ``--remote`` and ``--all`` (``-a``)
      flags to the bookmarks command. Either flag will show the remote bookmarks
      known to the repository; ``--remote`` will also suppress the output of the
      local bookmarks.
      """

      extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks,
                             synopsis, docstring)
    rNrp)r	�findcmdrr#�	functools�partialr
Zchecksignaturer�r�rNrP)
�table�command�wrapperZsynopsisZ	docstring�aliases�entry�aliasr`�keyr�r�Znewentryrrr�wrapcommand's$�r�csft�|�}|jD]8}||jvr|j|j���fdd�}||j|_qJq|turbtd||f��dS)z[Wraps a filecache property.

    These can't be wrapped using the normal wrapfunction.
    cs��g|�Ri|��Sr�r)r��kwargs�r�r�rrr�gszwrapfilecache.<locals>.wrapztype '%s' has no property '%s'N)rr=�__mro__r�r��objectr�)�clsZpropnamer�Zcurrclsr�rr�r�
wrapfilecache[s


r�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�wrappedfunctionz3context manager for temporarily wrapping a functioncCs||_||_||_dSr�)�
_container�	_funcname�_wrapper)�self�	container�funcnamer�rrr�__init__tszwrappedfunction.__init__cCst|j|j|j�dSr�)�wrapfunctionr�r�r�)r�rrr�	__enter__zszwrappedfunction.__enter__cCst|j|j|j�dSr�)�unwrapfunctionr�r�r�)r��exctypeZexcvaluerGrrr�__exit__}szwrappedfunction.__exit__N)r�r��__qualname__r�r�r�r�rrrrr�qsr�cCsHt||�}t�|�r"t�||�}n
t||�}t|||�t|||�|S)a�Wrap the function named funcname in container

    Replace the funcname member in the given container with the specified
    wrapper. The container is typically a module, class, or instance.

    The wrapper will be called like

      wrapper(orig, *args, **kwargs)

    where orig is the original (wrapped) function, and *args, **kwargs
    are the arguments passed to it.

    Wrapping methods of the repository object is not recommended since
    it conflicts with extensions that extend the repository by
    subclassing. All extensions that need to extend methods of
    localrepository should use this subclassing trick: namely,
    reposetup() should look like

      def reposetup(ui, repo):
          class myrepo(repo.__class__):
              def whatever(self, *args, **kwargs):
                  [...extension stuff...]
                  super(myrepo, self).whatever(*args, **kwargs)
                  [...extension stuff...]

          repo.__class__ = myrepo

    In general, combining wrapfunction() with subclassing does not
    work. Since you cannot control what other extensions are loaded by
    your end users, you should play nicely with others by using the
    subclass trick.
    )r�inspectZismoduler�r�rvr�r)r�r�r�r�r�rrrr��s#


r�cCsVt||�}|��}|dur"|d}|�|�t|||�t|�D]}t|||�q@|S)a/undo wrapfunction

    If wrappers is None, undo the last wrap. Otherwise removes the wrapper
    from the chain of wrappers.

    Return the removed wrapper.
    Raise IndexError if wrapper is None and nothing to unwrap; ValueError if
    wrapper is not None but is not found in the wrapper chain.
    Nr)�getwrapperchain�pop�remover�reversedr�)r�r�r��chainr��wrrrr��s


r�cCs6g}t||�}|r2|�t|d|��t|dd�}q|S)z�get a chain of wrappers of a function

    Return a list of functions: [newest wrapper, ..., oldest wrapper, origfunc]

    The wrapper functions are the ones passed to wrapfunction, whose first
    argument is origfunc.
    r�r�N)rrz)r�r�r�r�rrrr��s
r�cCs�ddl}t�|d�rVtj�t�t�|j	���}zt�
|�}WqZtyRiYS0niSi}|D]r}|�d�r�|�
dd�d}tj�||�}n"|}tj�||d�}tj�|�s�qb||vsb|tvsb|dkr�qb|||<qbt�t�D]\}}|r�|||<q�|S)	zAfind paths of disabled extensions. returns a dict of {name: path}rN�__file__s.pyr rs__init__.pys__init__)�hgextr
rWr-r.�dirname�abspathr�fsencoder��listdir�OSErrorr$�rsplitr]�existsrr#r�)r�Zextpath�files�extsr`rr.rrr�_disabledpaths�s4�


r�cCs�g}|��}|dd�dks$|��s4|��}|sq4q|dd�}|dksP|dkr�|dd�}|r�|���|�r�|�|�d}|r�|�|�q�n|s�dS|�|�|��}q\ndSd�|�S)	z�return the top-level python documentation for the given file

    Loosely inspired by pydoc.source_synopsis(), but rewritten to
    handle triple quotes and to return the whole text instead of just
    the synopsisNr�#�s"""s'''rr)�readline�strip�rstripr$r0rzr])�filer��line�startrrr�
_moduledoc�s*

r�cCsdz6t|d��}t|�}Wd�n1s*0YWntyJYdS0|rXt|�Std�SdS)zBretrieve help synopsis of a disabled extension (without importing)�rbN�(no help text available))rr�r4rr)r.�src�docrrr�
_disabledhelp s*rc	Cs�z$ddlm}dd�t�|j�D�WSttfy:Yn0t�}|sJiSi}t�|�D],\}}t|�}|rX|dkrX|�	�d||<qX|S)zCfind disabled extensions from hgext. returns a dict of {name: desc}r)�	__index__cSs"i|]\}}|tvr|t|��qSr)rr)rXrr9rrr�
<dictcomp>3s�zdisabled.<locals>.<dictcomp>s	__index__)
r�rrr#ZdocsrAr�r�r�
splitlines)r�pathsr�rr.r�rrr�disabled.s 
�rcCst�}||vrt||�SdS)z<Obtain the full help text for a disabled extension, or None.N)r�r)rrrrr�
disabled_helpHsrccszt�|g�}|rv|��}t|tj�s6|�t�|��q|jD]6}t|tj	�sNq<t|j
tj�s^q<|j
jdkrlq<|Vq<qdS)z7Scan @command() decorators in the tree starting at noder�N)
r��deque�popleftrM�astZFunctionDef�extendZiter_child_nodes�decorator_listZCallr��Name�id)�nodeZtodor6rrr�_walkcommandOs
rcCs�t|d�� }t�|��|�}Wd�n1s00Yi}t|�D]Z}|jsRqF|jd}t|tj�rvt�	|j
�}ntjrFt|tj�rF|j
}nqFdgdf||<qF|S)zuConstruct a dummy command table without loading the extension module

    This may raise IOError or SyntaxError.
    r�Nrr)
rr	�parse�readrr�rMZStrrZsysbytes�sZispy3ZBytes)r.r��rootr^rrYrrrr�_disabledcmdtableas.
rc
	Cs�zt|�}Wnttfy$YdS0zt�|||�\}}WntjtjfyXYdS0|D]}|�|�r^|}q~q^|d}t	|�}	|||	fS)Nr)
rr4�SyntaxErrorr	r�rZAmbiguousCommand�UnknownCommandrr)
r�cmdrr.�strictr^r�r�r_r�rrr�_finddisabledcmdws
rFcCs�t�}|st�|��d}|�|d�}|r:t|||||d�}|slt�|�D]"\}}t|||||d�}|rHqlqH|rt|St�|��dS)zXfind cmd from disabled extensions without importing.
    returns (cmdname, extname, doc)N)r)r�rrr�rrr#)rrrr�extr.rrrr�disabledcmd�s
rTcCsPi}t�D]@\}}t|j�p"td�}|r6|�d�d}|��d��||<q
|S)z+return a dict of {name: desc} of extensionsr�r ���r)rrr�rr0rr�)r~r�Zenamerr�rrrr�srcCsdd�t�t�D�S)z4return short names of extensions that failed to loadcSsg|]\}}|dur|�qSr�r)rXrr%rrrr[�sznotloaded.<locals>.<listcomp>)rr#rrrrr�	notloaded�s�rcCs�t�|d�r<t|j�r<z|��}WqTty8d}YqT0nt�|d�rP|j}nd}t|ttf�rxd�	dd�|D��}n
t
�|�}|S)z8return version information from given module as a strings
getversionsunknowns__version__rr css|]}t�|�VqdSr�)rZbytestr)rXrmrrr�	<genexpr>�rz moduleversion.<locals>.<genexpr>)r
rW�callableZ
getversionr��__version__rMrNrPr]rrF)rryrrr�
moduleversion�s
r!cCst|dd�}|dkS)NZ
testedwithsships-with-hg-core)r)rZ
exttestedwithrrr�ismoduleinternal�sr")N)NN)N)N)NN)N)F)T)BZ
__future__rr	r�r�r1r�r-Zi18nrrrrrrrJr	r
rr
Zutilsrrr�r{rrtrr(r;r@rCrIrQr\rbrnr�r�r�r�r�r�r�rvr�r�r�r�r�r�r�r�r�r�rrrrrrrrrr!r"rrrr�<module>sl
	


3

=
42
&!




Youez - 2016 - github.com/yon3zu
LinuXploit