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: //proc/self/root/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyo
�
1�3\c@@sddlmZddlZddlZddlmZddlmZmZdddhZ	d	�Z
eed
�Zde
fd��YZd
efd��YZdefd��YZdefd��YZdefd��YZd�Zeedd�ZdS(i(tabsolute_importNi(t_(terrortpycompattnoninteractivethelptversioncC@s|jd�rz|jd�\}}}|d|krM|t|�|tfS|dd|kr|t|�|tfSn�|jd�r|dkr|jd�r|d |d}}|j|d�}|dkr|t|�||jd|d�fSnd	td	tfS(
s�Check if the given arg is a valid unabbreviated option

    Returns (flag_str, has_embedded_value?, embedded_value, takes_value?)

    >>> def opt(arg):
    ...     return _earlyoptarg(arg, b'R:q', [b'cwd=', b'debugger'])

    long form:

    >>> opt(b'--cwd')
    ('--cwd', False, '', True)
    >>> opt(b'--cwd=')
    ('--cwd', True, '', True)
    >>> opt(b'--cwd=foo')
    ('--cwd', True, 'foo', True)
    >>> opt(b'--debugger')
    ('--debugger', False, '', False)
    >>> opt(b'--debugger=')  # invalid but parsable
    ('--debugger', True, '', False)

    short form:

    >>> opt(b'-R')
    ('-R', False, '', True)
    >>> opt(b'-Rfoo')
    ('-R', True, 'foo', True)
    >>> opt(b'-q')
    ('-q', False, '', False)
    >>> opt(b'-qfoo')  # invalid but parsable
    ('-q', True, 'foo', False)

    unknown or invalid:

    >>> opt(b'--unknown')
    ('', False, '', False)
    >>> opt(b'-u')
    ('', False, '', False)
    >>> opt(b'-ufoo')
    ('', False, '', False)
    >>> opt(b'--')
    ('', False, '', False)
    >>> opt(b'-')
    ('', False, '', False)
    >>> opt(b'-:')
    ('', False, '', False)
    >>> opt(b'-:foo')
    ('', False, '', False)
    s--t=it-s-:iit:t(t
startswitht	partitiontbooltFalsetTruetfind(targt	shortlisttnamelisttflagteqtvalti((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyt_earlyoptargs1+)c
C@s9g}g}d}x	|t|�kr||}|dkrL||7}Pnt|||�\}	}
}}|
r�|r�|dt|�kr�Pn|	s�|
r�|r�|r�|j|�|d7}qPq|
|kr�|j|	|f�|d7}q|j|	||df�|d7}qW|j||�||fS(ss
Parse options like getopt, but ignores unknown options and abbreviated
    forms

    If gnu=False, this stops processing options as soon as a non/unknown-option
    argument is encountered. Otherwise, option and non-option arguments may be
    intermixed, and unknown-option arguments are taken as non-option.

    If keepsep=True, '--' won't be removed from the list of arguments left.
    This is useful for stripping early options from a full command arguments.

    >>> def get(args, gnu=False, keepsep=False):
    ...     return earlygetopt(args, b'R:q', [b'cwd=', b'debugger'],
    ...                        gnu=gnu, keepsep=keepsep)

    default parsing rules for early options:

    >>> get([b'x', b'--cwd', b'foo', b'-Rbar', b'-q', b'y'], gnu=True)
    ([('--cwd', 'foo'), ('-R', 'bar'), ('-q', '')], ['x', 'y'])
    >>> get([b'x', b'--cwd=foo', b'y', b'-R', b'bar', b'--debugger'], gnu=True)
    ([('--cwd', 'foo'), ('-R', 'bar'), ('--debugger', '')], ['x', 'y'])
    >>> get([b'--unknown', b'--cwd=foo', b'--', '--debugger'], gnu=True)
    ([('--cwd', 'foo')], ['--unknown', '--debugger'])

    restricted parsing rules (early options must come first):

    >>> get([b'--cwd', b'foo', b'-Rbar', b'x', b'-q', b'y'], gnu=False)
    ([('--cwd', 'foo'), ('-R', 'bar')], ['x', '-q', 'y'])
    >>> get([b'--cwd=foo', b'x', b'y', b'-R', b'bar', b'--debugger'], gnu=False)
    ([('--cwd', 'foo')], ['x', 'y', '-R', 'bar', '--debugger'])
    >>> get([b'--unknown', b'--cwd=foo', b'--', '--debugger'], gnu=False)
    ([], ['--unknown', '--cwd=foo', '--', '--debugger'])

    stripping early options (without loosing '--'):

    >>> get([b'x', b'-Rbar', b'--', '--debugger'], gnu=True, keepsep=True)[1]
    ['x', '--', '--debugger']

    last argument:

    >>> get([b'--cwd'])
    ([], ['--cwd'])
    >>> get([b'--cwd=foo'])
    ([('--cwd', 'foo')], [])
    >>> get([b'-R'])
    ([], ['-R'])
    >>> get([b'-Rbar'])
    ([('-R', 'bar')], [])
    >>> get([b'-q'])
    ([('-q', '')], [])
    >>> get([b'-q', b'--'])
    ([('-q', '')], [])

    '--' may be a value:

    >>> get([b'-R', b'--', b'x'])
    ([('-R', '--')], ['x'])
    >>> get([b'--cwd', b'--', b'x'])
    ([('--cwd', '--')], ['x'])

    value passed to bool options:

    >>> get([b'--debugger=foo', b'x'])
    ([], ['--debugger=foo', 'x'])
    >>> get([b'-qfoo', b'x'])
    ([], ['-qfoo', 'x'])

    short option isn't separated with '=':

    >>> get([b'-R=bar'])
    ([('-R', '=bar')], [])

    ':' may be in shortlist, but shouldn't be taken as an option letter:

    >>> get([b'-:', b'y'])
    ([], ['-:', 'y'])

    '-' is a valid non-option argument:

    >>> get([b'-', b'y'])
    ([], ['-', 'y'])
    is--ii(tlenRtappendtextend(
targsRRtgnutkeepsept
parsedoptst
parsedargstposRRthasvalRttakeval((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pytearlygetopt\s.R
#


t	customoptcB@sDeZdZejZd�Zd�Zd�Zej	d��Z
RS(s2Manage defaults and mutations for any type of opt.cC@s
||_dS(N(t
_defaultvalue(tselftdefaultvalue((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyt__init__�scC@stS(N(R(R'((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyt
_isboolopt�scC@s|jS(s�Returns the default value for this opt.

        Subclasses should override this to return a new value if the value type
        is mutable.(R&(R'((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pytgetdefaultvalue�scC@sdS(szAdds newparam to oldstate and returns the new state.

        On failure, abort can be called with a string error message.N((R'toldstatetnewparamtabort((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pytnewstate�R
(t__name__t
__module__t__doc__tabctABCMetat
__metaclass__R)R*R+tabstractmethodR/(((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR%�s				t
_simpleoptcB@seZd�Zd�ZRS(cC@st|jttd�f�S(N(t
isinstanceR&R
ttypetNone(R'((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR*�scC@s|S(N((R'R,R-R.((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR/�s(R0R1R*R/(((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR7�s	t_callableoptcB@seZd�Zd�ZRS(cC@s#||_tt|�jd�dS(N(t
callablefntsuperR;R)R:(R'R<((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR)�s	cC@s
|j|�S(N(R<(R'R,R-R.((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR/�s(R0R1R)R/(((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR;�s	t_listoptcB@seZd�Zd�ZRS(cC@s|jS(N(R&(R'((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR+�scC@s|j|�|S(N(R(R'R,R-R.((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR/�s
(R0R1R+R/(((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR>�s	t_intoptcB@seZd�ZRS(cC@s6yt|�SWn!tk
r1|td��nXdS(Nsexpected int(tintt
ValueErrorR(R'R,R-R.((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR/�s
(R0R1R/(((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR?�scC@sst|t�r|St|�r)t|�St|t�rCt|�St|�td�kret|�St|�SdS(s<Returns a default opt implementation, given a default value.iN(	R8R%tcallableR;tlistR>R9R?R7(tdefault((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyt_defaultopts

c@s�|d
kri}ng}d}i}i}	i}
td�|D��}x�|D]�}t|�dkr�|\}
}}}}n|\}
}}}|g}|j|j|g��|jdd�}||d|
<x|D]}||d|<q�Wt|�|	|<|	|j�||<|	|j�sZ|
r:|
d7}
ng|D]}|d^qA}nt|t	kr�xe|D]Z}|j
d	�r�|d
}n
d	|}||krmd||
d|<|j|�qmqmWn|
r�||
7}n|rP|j|�qPqPW|rtj
td|�}n|r+tj}n	tj}||||�\}}x�|D]�\��t}|
j�t�}|r�|�t}n|�}|	|}|j�r�|||<qS��fd�}|	|j||�|�||<qSW|S(sr
    read args, parse options, and store options in state

    each option is a tuple of:

      short option or ''
      long option
      default value
      description
      option value label(optional)

    option types include:

      boolean or none - option sets variable in state to true
      string - parameter string is stored in state
      list - parameter string is added to a list
      integer - parameter strings is stored as int
      function - call function with parameter
      customopt - subclass of 'customopt'

    optaliases is a mapping from a canonical option name to a list of
    additional long options. This exists for preserving backward compatibility
    of early options. If we want to use it extensively, please consider moving
    the functionality to the options table (e.g separate long options by '|'.)

    non-option args are returned
    R
cs@s|]}|dVqdS(iN((t.0to((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pys	<genexpr>4siRRs--R	Rsno-iRc@s/tjtd�tj���|f��dS(Ns"invalid value %r for option %s, %s(RtAbortRRtmaybebytestr(ts(toptR(s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyR.tsN(R:tsetRRtgettreplaceRER+R*tnevernegateRRt	functoolstpartialR$Rt
gnugetoptbtgetoptbRRR/(RtoptionststateRtearlyt
optaliasesRRtargmaptdefmapt	negationstalllongtoptiontshorttnameRDtcommenttdummytonamestntinserttparsetoptstboolvaltnegationtobjR.((RKRs9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyt	fancyoptssn	
	

 



		


%(t
__future__RR3RPti18nRR
RRRORRR$tobjectR%R7R;R>R?RER:Ri(((s9/usr/lib64/python2.7/site-packages/mercurial/fancyopts.pyt<module>s 		>q