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/registrar.pyo
�
1�3\c@@sddlmZddlmZmZmZmZejZde	fd��YZ
de
fd��YZdZd	e
fd
��YZ
de
fd��YZd
e
fd��YZdefd��YZdefd��YZdefd��YZde
fd��YZdS(i(tabsolute_importi(tconfigitemsterrortpycompattutilt_funcregistrarbasecB@sVeZdZdd�Zd�Zd�Zd�Zd�ZdZ	d�Z
d�ZRS(	s�Base of decorator to register a function for specific purpose

    This decorator stores decorated functions into own dict 'table'.

    The least derived class can be defined by overriding 'formatdoc',
    for example::

        class keyword(_funcregistrarbase):
            _docformat = ":%s: %s"

    This should be used as below:

        keyword = registrar.keyword()

        @keyword('bar')
        def barfunc(*args, **kwargs):
            '''Explanation of bar keyword ....
            '''
            pass

    In this case:

    - 'barfunc' is stored as 'bar' in '_table' of an instance 'keyword' above
    - 'barfunc.__doc__' becomes ":bar: Explanation of bar keyword"
    cC@s%|dkri|_n	||_dS(N(tNonet_table(tselfttable((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyt__init__2sc@s����fd�S(Nc@s�j|����S(N(t_doregister(tfunc(targstdecltkwargsR(s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyt<lambda>9t((RRR
R((R
RRRs9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyt__call__8scO@s�|j|�}||jkr:d|}tj|��n|jr�tj|d�r�tj|j�j	�}||_
tj|j||��|_n||j|<|j
||||�|S(Ns%duplicate registration for name: "%s"t_origdoc(t_getnameRRtProgrammingErrort__doc__RtsafehasattrRtsysbyteststripRtsysstrt
_formatdoct_extrasetup(RRRR
Rtnametmsgtdoc((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyR;s
	!
cC@s+|jd�}|dkr#|| S|SdS(sIParse function declaration and return the name of function in it
        t(iN(tfind(RRti((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyt_parsefuncdeclLscC@s|S(s�Return the name of the registered function from decl

        Derived class should override this, if it allows more
        descriptive 'decl' string than just a name.
        ((RR((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyRUscC@s|j||fS(s�Return formatted document of the registered function for help

        'doc' is '__doc__.strip()' of the registered function.
        (t
_docformat(RRR((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyR_scC@sdS(s>Execute exra setup for registered function, if needed
        N((RRR((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyRfRN(t__name__t
__module__RRR
RRR#RR$RR(((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyRs						tcommandc	B@s}eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
Zddeeedded�ZRS(s�
Decorator to register a command function to table

    This class receives a command table as its argument. The table should
    be a dict.

    The created object can be used as a decorator for adding commands to
    that command table. This accepts multiple arguments to define a command.

    The first argument is the command name (as bytes).

    The `options` keyword argument is an iterable of tuples defining command
    arguments. See ``mercurial.fancyopts.fancyopts()`` for the format of each
    tuple.

    The `synopsis` argument defines a short, one line summary of how to use the
    command. This shows up in the help output.

    There are three arguments that control what repository (if any) is found
    and passed to the decorated function: `norepo`, `optionalrepo`, and
    `inferrepo`.

    The `norepo` argument defines whether the command does not require a
    local repository. Most commands operate against a repository, thus the
    default is False. When True, no repository will be passed.

    The `optionalrepo` argument defines whether the command optionally requires
    a local repository. If no repository can be found, None will be passed
    to the decorated function.

    The `inferrepo` argument defines whether to try to find a repository from
    the command line arguments. If True, arguments will be examined for
    potential repository locations. See ``findrepo()``. If a repository is
    found, it will be used and passed to the decorated function.

    The `intents` argument defines a set of intended actions or capabilities
    the command is taking. These intents can be used to affect the construction
    of the repository object passed to the command. For example, commands
    declaring that they are read-only could receive a repository that doesn't
    have any methods allowing repository mutation. Other intents could be used
    to prevent the command from running if the requested intent could not be
    fulfilled.

    If `helpcategory` is set (usually to one of the constants in the help
    module), the command will be displayed under that category in the help's
    list of commands.

    The following intents are defined:

    readonly
       The command is read-only

    The signature of the decorated function looks like this:
        def cmd(ui[, repo] [, <args>] [, <options>])

      `repo` is required if `norepo` is False.
      `<args>` are positional args (or `*args`) arguments, of non-option
      arguments from the command line.
      `<options>` are keyword arguments (or `**options`) of option arguments
      from the command line.

    See the WritingExtensions and MercurialApi documentation for more exhaustive
    descriptions and examples.
    trepotremotetcommitt
managementtorganizationtfilest
navigationtwdirtimporttmaintenancethelptmisctnonecC@s�||_||_||_|p't�|_|	|_|
|_|rd|t|�|f|j|<n|t|�f|j|<|S(N(	tnorepotoptionalrepot	inferrepotsettintentsthelpcategoryt	helpbasictlistR(RRRtoptionstsynopsisR5R6R7R9R:R;((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyR�s					(N(R%R&RtCATEGORY_REPO_CREATIONtCATEGORY_REMOTE_REPO_MANAGEMENTtCATEGORY_COMMITTINGtCATEGORY_CHANGE_MANAGEMENTtCATEGORY_CHANGE_ORGANIZATIONtCATEGORY_FILE_CONTENTStCATEGORY_CHANGE_NAVIGATIONtCATEGORY_WORKING_DIRECTORYtCATEGORY_IMPORT_EXPORTtCATEGORY_MAINTENANCEt
CATEGORY_HELPt
CATEGORY_MISCt
CATEGORY_NONERtFalseR(((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyR'js"?	treadonlytrevsetpredicatecB@s/eZdZejZdZeedd�ZRS(s#Decorator to register revset predicate

    Usage::

        revsetpredicate = registrar.revsetpredicate()

        @revsetpredicate('mypredicate(arg1, arg2[, arg3])')
        def mypredicatefunc(repo, subset, x):
            '''Explanation of this revset predicate ....
            '''
            pass

    The first string argument is used also in online help.

    Optional argument 'safe' indicates whether a predicate is safe for
    DoS attack (False by default).

    Optional argument 'takeorder' indicates whether a predicate function
    takes ordering policy as the last argument.

    Optional argument 'weight' indicates the estimated run-time cost, useful
    for static optimization, default is 1. Higher weight means more expensive.
    Usually, revsets that are fast and return only one revision has a weight of
    0.5 (ex. a symbol); revsets with O(changelog) complexity and read only the
    changelog have weight 10 (ex. author); revsets reading manifest deltas have
    weight 30 (ex. adds); revset reading manifest contents have weight 100
    (ex. contains). Note: those values are flexible. If the revset has a
    same big-O time complexity as 'contains', but with a smaller constant, it
    might have a weight of 90.

    'revsetpredicate' instance in example above can be used to
    decorate multiple functions.

    Decorated functions are registered automatically at loading
    extension, if an instance named as 'revsetpredicate' is used for
    decorating in extension.

    Otherwise, explicit 'revset.loadpredicate()' is needed.
    s
``%s``
    %sicC@s||_||_||_dS(N(t_safet
_takeordert_weight(RRRtsafet	takeordertweight((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyR�s		(	R%R&RRR#RR$RLR(((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyRN�s'	tfilesetpredicatecB@s,eZdZejZdZedd�ZRS(s�Decorator to register fileset predicate

    Usage::

        filesetpredicate = registrar.filesetpredicate()

        @filesetpredicate('mypredicate()')
        def mypredicatefunc(mctx, x):
            '''Explanation of this fileset predicate ....
            '''
            pass

    The first string argument is used also in online help.

    Optional argument 'callstatus' indicates whether a predicate
     implies 'matchctx.status()' at runtime or not (False, by
     default).

    Optional argument 'weight' indicates the estimated run-time cost, useful
    for static optimization, default is 1. Higher weight means more expensive.
    There are predefined weights in the 'filesetlang' module.

    ====== =============================================================
    Weight Description and examples
    ====== =============================================================
    0.5    basic match patterns (e.g. a symbol)
    10     computing status (e.g. added()) or accessing a few files
    30     reading file content for each (e.g. grep())
    50     scanning working directory (ignored())
    ====== =============================================================

    'filesetpredicate' instance in example above can be used to
    decorate multiple functions.

    Decorated functions are registered automatically at loading
    extension, if an instance named as 'filesetpredicate' is used for
    decorating in extension.

    Otherwise, explicit 'fileset.loadpredicate()' is needed.
    s
``%s``
    %sicC@s||_||_dS(N(t_callstatusRQ(RRRt
callstatusRT((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyR's	(	R%R&RRR#RR$RLR(((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyRU�s(	t_templateregistrarbasecB@seZdZdZRS(sEBase of decorator to register functions as template specific one
    s:%s: %s(R%R&RR$(((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyRX+sttemplatekeywordcB@seZdZdd�ZRS(s�Decorator to register template keyword

    Usage::

        templatekeyword = registrar.templatekeyword()

        # new API (since Mercurial 4.6)
        @templatekeyword('mykeyword', requires={'repo', 'ctx'})
        def mykeywordfunc(context, mapping):
            '''Explanation of this template keyword ....
            '''
            pass

        # old API (DEPRECATED)
        @templatekeyword('mykeyword')
        def mykeywordfunc(repo, ctx, templ, cache, revcache, **args):
            '''Explanation of this template keyword ....
            '''
            pass

    The first string argument is used also in online help.

    Optional argument 'requires' should be a collection of resource names
    which the template keyword depends on. This also serves as a flag to
    switch to the new API. If 'requires' is unspecified, all template
    keywords and resources are expanded to the function arguments.

    'templatekeyword' instance in example above can be used to
    decorate multiple functions.

    Decorated functions are registered automatically at loading
    extension, if an instance named as 'templatekeyword' is used for
    decorating in extension.

    Otherwise, explicit 'templatekw.loadkeyword()' is needed.
    cC@s
||_dS(N(t	_requires(RRRtrequires((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyRVsN(R%R&RRR(((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyRY0s$ttemplatefiltercB@seZdZdd�ZRS(s'Decorator to register template filer

    Usage::

        templatefilter = registrar.templatefilter()

        @templatefilter('myfilter', intype=bytes)
        def myfilterfunc(text):
            '''Explanation of this template filter ....
            '''
            pass

    The first string argument is used also in online help.

    Optional argument 'intype' defines the type of the input argument,
    which should be (bytes, int, templateutil.date, or None for any.)

    'templatefilter' instance in example above can be used to
    decorate multiple functions.

    Decorated functions are registered automatically at loading
    extension, if an instance named as 'templatefilter' is used for
    decorating in extension.

    Otherwise, explicit 'templatefilters.loadkeyword()' is needed.
    cC@s
||_dS(N(t_intype(RRRtintype((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyRusN(R%R&RRR(((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyR\YsttemplatefunccB@s&eZdZejZddd�ZRS(sDecorator to register template function

    Usage::

        templatefunc = registrar.templatefunc()

        @templatefunc('myfunc(arg1, arg2[, arg3])', argspec='arg1 arg2 arg3',
                      requires={'ctx'})
        def myfuncfunc(context, mapping, args):
            '''Explanation of this template function ....
            '''
            pass

    The first string argument is used also in online help.

    If optional 'argspec' is defined, the function will receive 'args' as
    a dict of named arguments. Otherwise 'args' is a list of positional
    arguments.

    Optional argument 'requires' should be a collection of resource names
    which the template function depends on.

    'templatefunc' instance in example above can be used to
    decorate multiple functions.

    Decorated functions are registered automatically at loading
    extension, if an instance named as 'templatefunc' is used for
    decorating in extension.

    Otherwise, explicit 'templatefuncs.loadfunction()' is needed.
    cC@s||_||_dS(N(t_argspecRZ(RRRtargspecR[((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyR�s	N((R%R&RRR#RRR(((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyR_xs	t
internalmergecB@s;eZdZdZdZdZdZddeed�Z	RS(sWDecorator to register in-process merge tool

    Usage::

        internalmerge = registrar.internalmerge()

        @internalmerge('mymerge', internalmerge.mergeonly,
                       onfailure=None, precheck=None,
                       binary=False, symlink=False):
        def mymergefunc(repo, mynode, orig, fcd, fco, fca,
                        toolconf, files, labels=None):
            '''Explanation of this internal merge tool ....
            '''
            return 1, False # means "conflicted", "no deletion needed"

    The first string argument is used to compose actual merge tool name,
    ":name" and "internal:name" (the latter is historical one).

    The second argument is one of merge types below:

    ========== ======== ======== =========
    merge type precheck premerge fullmerge
    ========== ======== ======== =========
    nomerge     x        x        x
    mergeonly   o        x        o
    fullmerge   o        o        o
    ========== ======== ======== =========

    Optional argument 'onfailure' is the format of warning message
    to be used at failure of merging (target filename is specified
    at formatting). Or, None or so, if warning message should be
    suppressed.

    Optional argument 'precheck' is the function to be used
    before actual invocation of internal merge tool itself.
    It takes as same arguments as internal merge tool does, other than
    'files' and 'labels'. If it returns false value, merging is aborted
    immediately (and file is marked as "unresolved").

    Optional argument 'binary' is a binary files capability of internal
    merge tool. 'nomerge' merge type implies binary=True.

    Optional argument 'symlink' is a symlinks capability of inetrnal
    merge function. 'nomerge' merge type implies symlink=True.

    'internalmerge' instance in example above can be used to
    decorate multiple functions.

    Decorated functions are registered automatically at loading
    extension, if an instance named as 'internalmerge' is used for
    decorating in extension.

    Otherwise, explicit 'filemerge.loadinternalmerge()' is needed.
    s``:%s``
    %st	mergeonlyt	fullmergec
C@s`||_||_||_|p-||jk}|pB||jk}	i|d6|	d6|_dS(Ntbinarytsymlink(t	mergetypet	onfailuretprechecktnomergetcapabilities(
RRRRgRhRiReRft	binarycapt
symlinkcap((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyR�s			N(
R%R&RR$RRjRcRdRLR(((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyRb�s6N(t
__future__RRRRRRtgetitemregistert
configitemtobjectRR'tINTENT_READONLYRNRURXRYR\R_Rb(((s9/usr/lib64/python2.7/site-packages/mercurial/registrar.pyt<module>s"	R_00)&