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 : |
a �+�bU/ � @ sH d dl mZ ddlmZmZmZmZmZ d dlm Z G dd� de �ZdS )� )�absolute_import� )�commands�error� extensions�pycompat� registrar)�tracingc @ sr e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z ddd�Zdd� ZdS )� exthelperaM Helper for modular extension setup A single helper should be instantiated for each module of an extension, where a command or function needs to be wrapped, or a command, extension hook, fileset, revset or template needs to be registered. Helper methods are then used as decorators for these various purposes. If an extension spans multiple modules, all helper instances should be merged in the main module. All decorators return the original function and may be chained. Aside from the helper functions with examples below, several registrar method aliases are available for adding commands, configitems, filesets, revsets, and templates. Simply decorate the appropriate methods, and assign the corresponding exthelper variable to a module level variable of the extension. The extension loading mechanism will handle the rest. example:: # ext.py eh = exthelper.exthelper() # As needed (failure to do this will mean your registration will not # happen): cmdtable = eh.cmdtable configtable = eh.configtable filesetpredicate = eh.filesetpredicate revsetpredicate = eh.revsetpredicate templatekeyword = eh.templatekeyword # As needed (failure to do this will mean your eh.wrap*-decorated # functions will not wrap, and/or your eh.*setup-decorated functions # will not execute): uisetup = eh.finaluisetup extsetup = eh.finalextsetup reposetup = eh.finalreposetup uipopulate = eh.finaluipopulate @eh.command(b'mynewcommand', [(b'r', b'rev', [], _(b'operate on these revisions'))], _(b'-r REV...'), helpcategory=command.CATEGORY_XXX) def newcommand(ui, repo, *revs, **opts): # implementation goes here eh.configitem(b'experimental', b'foo', default=False, ) @eh.filesetpredicate(b'lfs()') def filesetbabar(mctx, x): return mctx.predicate(...) @eh.revsetpredicate(b'hidden') def revsetbabar(repo, subset, x): args = revset.getargs(x, 0, 0, b'babar accept no argument') return [r for r in subset if b'babar' in repo[r].description()] @eh.templatekeyword(b'babar') def kwbabar(ctx): return b'babar' c C st g | _ g | _g | _g | _g | _g | _g | _i | _t� | j�| _ i | _ t�| j �| _t�� | _t� � | _ t�� | _d S �N)�_uipopulatecallables�_uicallables� _extcallables�_repocallables�_commandwrappers�_extcommandwrappers�_functionwrappers�cmdtabler �command�configtableZ configitem�filesetpredicate�revsetpredicate�templatekeyword)�self� r �9/usr/lib64/python3.9/site-packages/mercurial/exthelper.py�__init__Z s zexthelper.__init__c C s� | j �|j � | j�|j� | j�|j� | j�|j� | j�|j� | j�|j� | j�|j� | j �|j � | j �|j � | j�|j� | j� |j� t�|j�D ].\}}|| jv r�| j| � |� q�|| j|<