403Webshell
Server IP : 217.160.0.244  /  Your IP : 216.73.217.138
Web Server : Apache
System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64
User : u100174116 ( 6746176)
PHP Version : 8.5.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/breezy/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/breezy/__pycache__/commands.cpython-313.pyc
�

p��g���	��SrSSKrSSKrSSKrSSKJrJr SSKJrJ	r	J
r
 SSKJr \"\"5S5 SSKJ
r
Jr SS	KJr SS
KJr SSKJrJrJr "SS
\5r"SS5r"SS\R25r\"5q\"5r\[6lSCSjrSrSr Sr!Sr"Sr#Sr$Sr%Sr&SSS00r'Sr(SDS\)S\*S S!4S"jjr+SES\)S\*S#\*S S!4S$jjr,"S%S&\
RZ5r.S'r/S(r0S)r1S*r2S+r3"S,S!5r4"S-S.\5r5\5"5\4lSFS/jr6S0r7S1r8S2r9S3r:S4r;SFS5jr<\\4S6jr=S7r>S8r?S9r@SFS:jrAS;rBS<rC"S=S>5rD"S?S@5rE"SASB\R25rF\F"5rGg)G�google�N)�Optional�Union�)�i18n�option�trace)�lazy_importzK

import breezy
from breezy import (
    cmdline,
    debug,
    ui,
    )
)�errors�registry)�Hooks)�gettext)�disable_plugins�load_plugins�plugin_namec�$�\rSrSrSrSrSrSrg)�CommandAvailableInPlugin�5Fc�(�X lXlX0lg�N)�plugin_metadata�cmd_name�provider)�selfrrrs    �1/usr/lib/python3/dist-packages/breezy/commands.py�__init__�!CommandAvailableInPlugin.__init__8s��.�� �
� �
�c�t�SRURURSURS5nU$)Nz�"{}" is not a standard brz command. 
However, the following official plugin provides this command: {}
You can install it by going to: {}�name�url)�formatrr)r�_fmts  r�__str__� CommandAvailableInPlugin.__str__=s?��
1�17���
�
�t�3�3�F�;�T�=Q�=Q�RW�=X�2�	
��r�rrrN)�__name__�
__module__�__qualname__�__firstlineno__�internal_errorrr$�__static_attributes__�rrrr5s���N�!�
	rrc�.�\rSrSrSrSr\S5rSrg)�CommandInfo�IzInformation about a command.c��Xlg)z$The list of aliases for the command.N��aliases)rr3s  rr�CommandInfo.__init__Ls���rc�&�U"UR5$)z2Factory to construct a CommandInfo from a command.r2)�klass�commands  r�from_command�CommandInfo.from_commandPs���W�_�_�%�%rr2N)	r'r(r)r*�__doc__r�classmethodr8r,r-rrr/r/Is��&���&��&rr/c�D�\rSrSrSrSrSr\S5rS
Sjr	Sr
Srg	)�CommandRegistry�Vz�Special registry mapping command names to command classes.

Attributes:
  overridden_registry: Look in this registry for commands being
    overridden by this registry.  This can be used to tell plugin commands
    about the builtin they're decorating.
c�^�[RRU5 SUl0Ulgr)r�Registryr�overridden_registry�_alias_dict�rs rr�CommandRegistry.__init___s&�����"�"�4�(�#'�� ���rc�v�URRX5n[RRX5$r)rB�getrr@)r�command_name�	real_names   rrF�CommandRegistry.getes/���$�$�(�(��D�	�� � �$�$�T�5�5rc�H�URS5(a[U5$U$�N�cmd_)�
startswith�_unsquish_command_name)rGs r�	_get_name�CommandRegistry._get_nameis$���"�"�6�*�*�)�,�7�7��rc� �URnURU5nURU5n[
R
U5n[RRXXUS9 UR HnX@R"U'M U$![aE SnUR(a/URRU5nN�![a N�f=fN�f=f![a� [R"SRU55 [R"SR[RUR55 [R"SR[RUR55 GN'f=f)aUtility function to help register a command.

Args:
  cmd: Command subclass to register
  decorate: If true, allow overriding an existing command
    of the same name; the old command is returned by this function.
    Otherwise it is an error to try to override an existing command.
N)�override_existing�infoz*Two plugins defined the same command: {!r}zNot loading the one in {!r}z0Previously this command was registered from {!r})r'rOrF�KeyErrorrAr/r8rr@�registerr	�warningr"�sys�modulesr(r3rB)r�cmd�decorate�k�k_unsquished�previousrS�as        rrU�CommandRegistry.registerpsV��
�L�L���~�~�a�(��	��x�x��-�H��'�'��,��
	����&�&��C�$�
'�
����A�".���Q������1�	��H��'�'��#�7�7�;�;�L�I�H�������(�	���		��M�M�F�M�M�a�P�Q��M�M�-�4�4�S�[�[����5P�Q�
�
�M�M�B�I�I��K�K�� 3� 3�4��
�		�sB�B�C�C�&C�
C�
C�C�C�C�B/F
�F
c	��URU5n[RRXX1[	U5S9 UHnX@R
U'M g)z�Register a command without loading its module.

Args:
  command_name: The primary name of the command.
  aliases: A list of aliases for the command.
  module_name: The module that the command lives in.
)rSN)rOrr@�
register_lazyr/rB)rrGr3�module_name�keyr^s      rra�CommandRegistry.register_lazy�sQ���n�n�\�*�����'�'��{�{�7�7K�	(�	
��A�"%���Q��r)rBrAN�F)r'r(r)r*r:rrF�staticmethodrOrUrar,r-rrr=r=Vs0����6�� �� �%�N
&rr=c�,�[RX5$)zWRegister a plugin command.

Should generally be avoided in favor of lazy registration.
)�plugin_cmdsrU)rYrZs  r�register_commandri�s������.�.rc�,�SURSS5-$)NrL�-�_��replace�rYs r�_squish_command_namerp�s���C�K�K��S�)�)�)rc�,�USSRSS5$)N�rlrkrmros rrNrN�s���q�r�7�?�?�3��$�$rc���[R5(agSSKn[UR5Hn[RU5 M URR
5 g)Nr)�builtin_command_registry�keys�breezy.builtins�_scan_module_for_commands�builtinsrU�_register_lazy_builtins)�breezy�	cmd_classs  r�_register_builtin_commandsr|�sI���$�$�&�&���.�v���?�	� �)�)�)�4�@�
�O�O�+�+�-rc#�r# �URnUH!nURS5(dMXv� M# g7frK)�__dict__rM)�module�module_dictr s   rrwrw�s0����/�/�K����?�?�6�"�"��#�#��s�&7�7c�j�UR[55 UR[55 U$)z�Find commands from bzr's core and plugins.

This is not the public interface, just the default hook called by
all_command_names.
)�update�builtin_command_names�plugin_command_names)�namess r�_list_bzr_commandsr��s)��
�L�L�&�(�)�	�L�L�%�'�(��Lrc���[5n[RSHEnU"U5nUbM[SR	[RRU555e U$)z"Return a set of all command names.�
list_commandszhook {} returned None)�set�Command�hooks�AssertionErrorr"�
get_hook_name)r��hooks  r�all_command_namesr��s[���E�E��
�
�o�.���U����=� �'�.�.�w�}�}�/J�/J�4�/P�Q��
�/��Lrc�>�[5 [R5$)z�Return list of builtin command names.

Use of all_command_names() is encouraged rather than builtin_command_names
and/or plugin_command_names.
)r|rtrur-rrr�r��s��� �#�(�(�*�*rc�*�[R5$)z:Returns command names from commands registered by plugins.)rhrur-rrr�r��s������r�ic�cic�^�[5n[5H:nURU5 [U5nUR	UR
5 M< 0mSSKn[U5H�nURSX5nSnUR5nUHRup�p�nUS:Xa	XjU	-
-
nMUS:XaU[X�-
X�-
5-
nM1US:Xa	XlU-
-
nM@US:XdMHUSX�-
--nMT UTU'M� TR	[RU055 [U4S	jT55mT(dgTSSS
:�agTSSn
U
$)z�Guess what command a user typoed.

Args:
  cmd_name: Command to search for
Returns:
  None if no command was found, name of a command otherwise
rNg�deletern�insert�equalg�������?c3�2># �UHnTUU4v� M g7frr-)�.0rc�costss  �r�	<genexpr>� guess_command.<locals>.<genexpr>s����6���E�#�J��$��s�rrr)
r�r��add�get_cmd_objectr�r3�patiencediff�sorted�PatienceSequenceMatcher�get_opcodes�max�_GUESS_OVERRIDESrF)rr�r rYr��matcher�distance�opcodes�opcode�l1�l2�r1�r2�	candidater�s              @r�
guess_commandr��sM���
�E�E�!�#��
�	�	�$���T�"��
���S�[�[�!�$�

�E���u�
���6�6�t�X�L�����%�%�'��&-�"�F�����!���G�#���9�$��C�����1�1���8�#���G�#���7�"��C�2�7�O�+��'.���d��� 
�L�L�!�%�%�h��3�4��6��6�6�E����Q�x��{�Q����a����I��rr�plugins_override�returnr�c���[X5$![aT [U5nUb#[R"[S5X4-5e[R"[S5U-5ef=f)zoReturn the command object for a command.

plugins_override
    If true, plugin commands can override builtins.
z,unknown command "%s". Perhaps you meant "%s"zunknown command "%s")�_get_cmd_objectrTr�r�CommandErrorr)rr�r�s   rr�r�'sy��
N��x�:�:���N�!�(�+�	�� ��%�%��F�G��'�(��
��!�!�'�*@�"A�H�"L�M�M�N�s
�

�AA+�
check_missingc�x�Sn[RSH0nU"X05nUcMU(aMUR5(aM0 O Uc.U(a'[RSHnU"U5nUcM O Uc[e[RSHnU"U5 M
 [	USS5cXlU$)a4Get a command object.

Args:
  cmd_name: The name of the command.
  plugins_override: Allow plugins to override builtins.
  check_missing: Look up commands not found in the regular index via
    the get_missing_command hook.

Returns:
  A Command object instance

Raises:
  KeyError: If no command is found.
N�get_command�get_missing_command�extend_command�
invoked_as)r�r�rrT�getattrr�)rr�r�rYr�s     rr�r�:s���*"�C��
�
�m�,���3�!���?�#3�#3�C�O�O�<M�<M�
�-��{�}��M�M�"7�8�D��x�.�C����9��{����
�
�.�/���S�	�0��s�L�$�'�/�!���Jrc��\rSrSrSrg)�NoPluginAvailableigr-N)r'r(r)r*r,r-rrr�r�gs��rr�c�V�[U5up[XU5e![a gf=f)z,Probe for a plugin provider having cmd_name.N)�probe_for_providerrr�r&s   r�_try_plugin_providerr�ks3��
�$6�x�$@�!��&�x�(�K�K���
��
�s��
(�(c�|�[HnURU5U4s $ [U5e![a M3f=f)z�Look for a provider for cmd_name.

Args:
  cmd_name: The command name.

Returns:
  plugin_metadata, provider for getting cmd_name.

Raises:
  NoPluginAvailable: When no provider can supply the plugin.
)�command_providers_registry�plugin_for_commandr�)rrs  rr�r�tsJ��/��	��.�.�x�8�(�B�B�/�
�H�
%�%��!�	��	�s�-�
;�;c�^�[RU5nU"5$![a U$f=f)zGet a command from bzr's core.)rtrFrT)�cmd_or_nonerr{s   r�_get_bzr_commandr��s=���,�0�0��:�	��{����
����	
�s��
,�,c�N�UbU$SSKJn URU5nU(aU$g)z(Lookup a command that is a shell script.Nr)�ExternalCommand)�breezy.externalcommandr��find_command)r�rr��cmd_objs    r�_get_external_commandr��s0������6��*�*�8�4�G����rc��[RU5"5$![a Of=f[R5HCn[R	U5nXR
;dM)[RU5"5s $ U$)z!Get a command from brz's plugins.)rhrFrTru�get_infor3)r�rrcrSs    r�_get_plugin_commandr��sr��
����x�(�*�*���
��
�����!���#�#�C�(���|�|�#��?�?�3�'�)�)�"��s��
)�)c�V�\rSrSr%Sr/r\\\S'/r	\\\S'/r
\\\\R4\S'Sr\\S'Sr\\\S	'S
r\\S'\\\S'S
r\\S'\\S'SrSrSrSrSrS#Sjr\S5rSrS$SjrSrSr S$Sjr!Sr"Sr#Sr$Sr%S r&S!r'S"r(g)%r�i�a/	Base class for commands.

Commands are the heart of the command-line brz interface.

The command object mostly handles the mapping of command-line
parameters into one or more breezy operations, and of the results
into textual output.

Commands normally don't have any state.  All their arguments are
passed in to the run method.  (Subclasses may take a different
policy if the behaviour of the instance needs to depend on e.g. a
shell plugin and not just its Python class.)

The docstring for an actual command should give a single-line
summary, then a complete description of the command.  A grammar
description will be inserted.

Attributes:
  aliases: Other accepted names for this command.

  takes_args: List of argument forms, marked with whether they are
    optional, repeated, etc.  Examples::

        ['to_location', 'from_branch?', 'file*']

    * 'to_location' is required
    * 'from_branch' is optional
    * 'file' can be specified 0 or more times

  takes_options: List of options that may be given for this command.
    These can be either strings, referring to globally-defined options, or
    option objects.  Retrieve through options().

  hidden: If true, this command isn't advertised.  This is typically
    for commands intended for expert users.

  encoding_type: Command objects will get a 'outf' attribute, which has
    been setup to properly handle encoding of unicode strings.
    encoding_type determines what will happen when characters cannot be
    encoded:

    * strict - abort if we cannot decode
    * replace - put in a bogus character (typically '?')
    * exact - do not encode sys.stdout

    NOTE: by default on Windows, sys.stdout is opened as a text stream,
    therefore LF line-endings are converted to CRLF.  When a command uses
    encoding_type = 'exact', then sys.stdout is forced to be a binary
    stream, and line-endings will not mangled.

  invoked_as:
    A string indicating the real name under which this command was
    invoked, before expansion of aliases.
    (This may be None if the command was constructed and run in-process.)

  hooks: An instance of CommandHooks.

  __doc__: The help shown by 'brz help command' for this command.
    This is set by assigning explicitly to __doc__ so that -OO can
    be used::

        class Foo(Command):
            __doc__ = "My help goes here"
r3�
takes_args�
takes_options�strict�
encoding_typeNr�T�l10n�	_see_alsoF�hiddenr�c�2�/UlUR5 g)z&Construct an instance of this command.N)�supported_std_options�
_setup_runrCs rr�Command.__init__�s��&(��"����rc�D�URR"U/UQ70UD6 g)zgRegister a function to call after self.run returns or raises.

Functions will be called in LIFO order.
N)�_exit_stack�callback)r�cleanup_func�args�kwargss    r�add_cleanup�Command.add_cleanups"��
	
���!�!�,�@��@��@rc�8�URR5 g)aSExecute and empty pending cleanup functions immediately.

After cleanup_now all registered cleanups are forgotten.  add_cleanup
may be called again after cleanup_now; these cleanups will be called
after self.run returns or raises (or when cleanup_now is next called).

This is useful for releasing expensive or contentious resources (such
as write locks) before doing further work that does not require those
resources (such as writing results to self.outf). Note though, that
as it releases all resources, this may release locks that the command
wants to hold, so use should be done with care.
N)r��closerCs r�cleanup_now�Command.cleanup_nows��	
����� rc�8�URRU5$r)r��
enter_context)r�cms  rr��Command.enter_contexts�����-�-�b�1�1rc��SUR5-S-nURHUnUR5nUSS;a	USSS-nO)USS:XaSUSS-S	-nOUSS
:XaSUSS-S-nXS--
nMW USSnU$)zUReturn single-line grammar for this command.

Only describes arguments, not options.
zbrz � ���)�$�+Nz...�?�[�]�*z...])r r��upper)r�s�anames   r�_usage�Command._usages���

�T�Y�Y�[� �3�&���_�_�E��K�K�M�E��R�y�J�&��c�r�
�U�*���r��c�!��e�C�R�j�(�3�.���r��c�!��e�C�R�j�(�6�1��
����A�%�
�c�r�F���rc��UR(a[R"5 UR5nU(aUR	U5nO[	S5nURU5upgnSU;aUR
S5n	OUR5n	Sn
U
[	S5U4--
n
U	RS5S:�aU
[	S5U	4--
n
OU
[	S5U	4--
n
U
S-
n
[R"[UR5R55VVs/sHup�UPM	 snn5n
U
R5nU(d(URS	5S
:waURSSS
5nUR!S5(aU
[	S5U[#S5S4--
n
OX�-
n
U
S-
n
U(a~SU;aBUR
S5nSR%UR'55nU
[	S5U4--
n
U(a.UH#nUU;dMU
SR)UUU5-
n
M% U
S-
n
OU
[	S5UR+5--
n
UR,(a/U
[	S5-
n
U
SR%UR,5S--
n
UR/5nUbU
[	S5U--
n
UR1U5nU(a�U(dYU(aR/nUHHnUS:XaUR3U5 M[	S5R)UU5nUR3U5 MJ UnU
[	S5SR%U5-S--
n
U(aSSKnUR6R9U
5n
U
$s snnf)a Return a text string with help for this command.

Args:
  additional_see_also: Additional help topics to be
    cross-referenced.
  plain: if False, raw help (reStructuredText) is
    returned instead of plain text.
  see_also_as_links: if True, convert items in 'See also'
    list to internal links (used by bzr_man rstx generator)
  verbose: if True, display the full help, otherwise
    leave out the descriptive sections and just display
    usage help (e.g. Purpose, Usage, Options) with a
    message explaining how to obtain full help.
zNo help for this command.�Usage�z
:Purpose: %s
�
rz:Usage:
%s
z
:Usage:   %s
z
  --1.14  r�z	 format:
z format::

rzOptions:z:Options:%szoptions:Nz
  z:Description:
  %s

z:{}:
{}
z0See brz help %s for more details and examples.

z:Aliases:  z, z:From:     plugin "%s"
�topicsz:doc:`{0} <{1}-help>`z
:See also: %s)r�r�install�helpr�_get_help_parts�popr��findr�
get_optparserr��options�items�format_option_helprnrM�len�join�
splitlinesr"r r3r�get_see_also�append�breezy.help_topics�help_topics�help_as_plain_text)r�additional_see_also�plain�see_also_as_links�verbose�doc�purpose�sections�order�usage�resultr[�v�parserr�text�labelr�see_also�see_also_links�item�	link_textrzs                       r�
get_help_text�Command.get_help_text,sO��*�9�9��L�L�N��i�i�k����,�,�s�#�C��5�6�C�$(�#7�#7��#<� ��5��h���L�L��)�E��K�K�M�E����'�*�+�w�j�8�8���:�:�d��q� ��g�o�.�%��9�9�F��g�.�/�5�(�:�:�F��$����%�%�V�D�L�L�N�<P�<P�<R�5S�&T�5S�T�Q�q�5S�&T�U���+�+�-������l�3�r�9��o�o�l�O�Q�G�G����j�)�)��g�m�,���J��8I�0J�/L�L�L�F���F��$�����x���|�|�D�)���{�{�4�?�?�#4�5���'�";�<��w�F�F���"�E���(��,�"5�"5�e�X�e�_�"M�M��#��$������L�M��)�)�+��
�F��<�<��g�m�,�,�F��d�i�i����-��4�4�F��&�&�(���"��g�8�9�K�G�G�F��$�$�%8�9����.�!#��$�D��x�'�'�-�-�d�3�%,�,C�$D�$K�$K�D�RV�$W�	�&�-�-�i�8�%�*���g�o�.����8�1D�D�t�K�K�F��%��'�'�:�:�6�B�F��
��C'Us�$N
c���SnUR5R5nURS5n0n/nSupgUH�nURS5(a6UR	S5(a [U5S:�aU"XEXg5 USSSpvMOUb5[U5S:�a&USR
5(dU"XEXg5 S	UpvM�[U5S:�a
US
U--
nM�UnM� U"XEXg5 X4U4$)a�Split help text into a summary and named sections.

:return: (summary,sections,order) where summary is the top line and
    sections is a dictionary of the rest indexed by section name.
    order is the order the section appear in the text.
    A section starts with a heading line of the form ":xxx:".
    Indented text on following lines is the section value.
    All text found outside a named section is assigned to the
    default section which is given the key of None.
c�x�[U5S:�a+X ;aX==SU--
ss'gURU5 X0U'gg)Nrr�)rr)rrr�sections    r�save_section�-Command._get_help_parts.<locals>.save_section�s<���7�|�a���$��O�t�g�~�5�O��L�L��'�&-�U�O� rr)Nr��:�rr�r�Nr�)�rstripr	rrM�endswithr�isspace)	rr&�lines�summaryrrrr%�lines	         rr�Command._get_help_parts�s���	.����
�(�(�*���)�)�A�,������!����D����s�#�#��
�
�c�(:�(:�s�4�y�1�}��X�e�=�!%�a���R�w��"�s�4�y�1�}�T�!�W�_�_�=N�=N��X�e�=�!%�t�w��w�<�!�#��t�d�{�*�G�"�G��	�X�e�5��%�'�'rc�"�UR5$)z*Return the commands help topic - its name.)r rCs r�get_help_topic�Command.get_help_topic�s���y�y�{�rc�t�[[US/55nU(aURU5 [U5$)a)Return a list of help topics that are related to this command.

The list is derived from the content of the _see_also attribute. Any
duplicates are removed and the result is in lexical order.

Args:
  additional_terms: Additional help topics to cross-reference.

Returns:
  A list of help topics.
r�)r�r�r�r�)r�additional_termsrs   rr
�Command.get_see_also�s2���w�t�[�"�5�6����O�O�,�-��h��rc��[RRR5n[	U5nUR
Hzn[
U[5(a[RRUnX1UR'URU;dMUURRUR5 M| U$)z]Return dict of valid options for this command.

Maps from long option name to option object.
)r�Option�STD_OPTIONS�copyr�r��
isinstance�str�OPTIONSr r�r)r�r�	std_names�os    rr�Command.options�s���

�M�M�%�%�*�*�,����F�	��#�#�A��!�S�!�!��M�M�)�)�!�,���a�f�f�I��v�v��"��*�*�1�1�!�&�&�9�$��rc�\�[RRURS9Ulg)z:Return a file linked to stdout, which has proper encoding.)r�N)�ui�
ui_factory�make_output_streamr��outfrCs r�_setup_outf�Command._setup_outf�s!���M�M�4�4�4�CU�CU�4�V��	rc�6�[XU5up4UR5 SU;a*URRUR	55 gSU;a)URRUR	SS95 g[
R"[R5 SUR;a[
R"5US'O	SU;aUS	SUR;a[
R"5US'O	SU;aUS	[UR5URU5n0nUR5HupxX�UR!SS	5'M UR#5n	U	R%U5 UR&"S0U	D6[(R*R-S
[.R0;S9 [
R"S5 $![(R*R-S
[.R0;S9 [
R"S5 f=f)
z@Parse the command line and run with extra aliases in alias_argv.r�rrF)rr�quietrkrl�bytes)�displayr-)�
parse_argsrGrF�writer!r	�set_verbosity_levelr�_verbosity_levelr��
is_verbose�is_quiet�_match_argformr r�rrnr:r��runrCrD�log_transport_activity�debug�debug_flags)
r�argv�
alias_argvr��opts�cmdargs�cmdoptsr[r�all_cmd_argss
          r�run_argv_aliases�Command.run_argv_aliases�s�����J�7�
�������T�>��I�I�O�O�D�.�.�0�1���d�?��I�I�O�O�D�.�.�u�.�=�>��
�!�!�&�"9�"9�:���2�2�2�#�.�.�0�D��O�
�$�
��Y���d�0�0�0�!�N�N�,�D��M�
��_��W�
� �����d�o�o�t�D�����J�J�L�D�A�+,�A�I�I�c�3�'�(�!��|�|�~�����G�$�	)��8�8�+�l�+�

�M�M�0�0�'�U�EV�EV�:V�0�X��%�%�a�(��
�M�M�0�0�'�U�EV�EV�:V�0�X��%�%�a�(�s
�<G�AHc�<^^�TRmUU4SjnUTlg)aWrap the defined run method on self with a cleanup.

This is called by __init__ to make the Command be able to be run
by just calling run(), as it could be before cleanups were added.

If a different form of cleanups are in use by your Command subclass,
you can override this method.
c�>�[RSHnU"T5 M
 [R"5TlT"U0UD6sSSS5 [RSHnU"T5 M
 $!,(df   O=f[RSHnU"T5 M
 g![RSHnU"T5 M
 f=f)N�pre_command�post_command)r�r��
contextlib�	ExitStackr�)r�r�r��	class_runrs   ��rrT�Command._setup_run.<locals>.run+s�����
�
�m�4���T�
�5�
��)�)�+�t�/?�$�d�5�f�5�,�+�$�M�M�.�9�D���J�:�,�+��+�$�M�M�.�9�D���J�:��G�M�M�.�9�D���J�:�s"�B(�
A3�	B(�3
B�=B(�($CN)rT)rrTrfs` @rr��Command._setup_run s����H�H�	�	���rc�R�[SRUR555e)amActually run the command.

This is invoked with the options and arguments bound to
keyword parameters.

Return 0 or None if the command was successful, or a non-zero
shell error code if not.  It's OK for this method to allow
an exception to raise up.

This method is automatically wrapped by Command.__init__ with a
ExitStack, stored as self._exit_stack. This can be used
via self.add_cleanup to perform automatic cleanups at the end of
run().

The argument for run are assembled by introspection. So for instance,
if your command takes an argument files, you would declare::

    def run(self, files=None):
        pass
z!no implementation of command {!r})�NotImplementedErrorr"r rCs rrT�Command.run7s%��*"�/�6�6�t�y�y�{�C�
�	
rc�Z�SSKJn UR[RLagU"U5$)z#Return help message for this class.r)�getdocN)�inspectrmr:r�)rrms  rr��Command.helpPs"��"��<�<�7�?�?�*���d�|�rc�.�[R"U5$)z�Returns the gettext function used to translate this command's help.

Commands provided by plugins should override this to use their
own i18n system.
)r�gettext_per_paragraph)r�messages  rr�Command.gettextXs���)�)�'�2�2rc�@�[URR5$)zuReturn the canonical name for this command.

The name under which it was actually invoked is available in invoked_as
)rN�	__class__r'rCs rr �Command.name`s��
&�d�n�n�&=�&=�>�>rc�,�[UR5$)z{Get the name of the plugin that provides this command.

:return: The name of the plugin or None if the command is builtin.
)rr(rCs rr�Command.plugin_namegs��
�4�?�?�+�+r)r�rFrTr�)NTFTr))r'r(r)r*r:r3�listr<�__annotations__r�r�rrr8r�r�rr��boolr�r
rr�r�r�r�r!rfrr2r
rrGr^r�rTr�rr rr,r-rrr�r��s���?�B�G�T�#�Y���J��S�	��57�M�4��c�6�=�=�0�1�2�7�!�M�3�!� $�J���
�$��D�$���C�y���F�D���L��A�
!�2��(!����z�x�&(��&(�P� �"
�W�%)�N�.
�2�3�?�,rc��\rSrSrSrSrSrg)�CommandHooksioz5Hooks related to Command object creation/enumeration.c��[R"USS5 URSSS5 URSSS5 URS	S
S5 URSSS5 URS
SS5 URSSS5 g)zjCreate the default hooks.

These are all empty initially, because by default nothing should get
notified.
zbreezy.commandsz
Command.hooksr�z�Called after creating a command object to allow modifications such as adding or removing options, docs etc. Called with the new breezy.commands.Command object.)r�
r�ahCalled when creating a single command. Called with (cmd_or_none, command_name). get_command should either return the cmd_or_none parameter, or a replacement Command object that should be used for the command. Note that the Command.hooks hooks are core infrastructure. Many users will prefer to use breezy.commands.register_command or plugin_cmds.register_lazy.)r�r�z�Called when creating a single command if no command could be found. Called with (command_name). get_missing_command should either return None, or a Command object to be used for the command.r�z�Called when enumerating commands. Called with a set of cmd_name strings for all the commands found so far. This set  is safe to mutate - e.g. to remove a command. list_commands should return the updated set of command names.rbzDCalled prior to executing a command. Called with the command object.)r)�rczACalled after executing a command. Called with the command object.N)r
r�add_hookrCs rr�CommandHooks.__init__rs���	���t�.��@��
�
��
2�
�	
�	
�
�
��
M�
�		
�	
�
�
�!�
�
�
	
�	
�
�
��
L�
�
	
�	
�
�
��R��	
�
	
�
�
��O��	
rr-N)r'r(r)r*r:rr,r-rrr}r}os
��?�1
rr}c���[R"[UR5R	55VVs/sHup4UPM	 snn5nUbX!-nOUnURU5upvURR	5VVs0sH&up4U[RRLdM$X4_M( nnnXh4$s snnf![a  [R"[S55ef=fs snnf)a	Parse command line.

Arguments and options are parsed at this level before being passed
down to specific command handlers.  This routine knows, from a
lookup table, something about the available options, what optargs
they take, and which commands will accept them.
z$Only ASCII permitted in option names)
rrr�rrrM�UnicodeEncodeErrorrr�rr~�OptionParser�
DEFAULT_VALUE)	r7rXrYr[rrr�rrZs	         rrMrM�s����
!�
!�����8I�8O�8O�8Q�1R�"S�1R���1�1R�"S�
T�F���� ����S��)�)�$�/�
���$�$�*�*�,��,�D�A��F�'�'�5�5�5�	
���,�	��
�:���%#T���S��!�!�'�*P�"Q�R�R�S��s�B?
�C�#C2�3C2�*C/c�f�0nUGHonUSSnUSS:XaU(aURS5X5'M.M0USS:XaU(aUSSX5S-'/nMNSX5S-'MWUSS:XaQU(d<[R"[S5R	XR555eUSSX5S-'/nM�USS:Xa][
U5S	:a<[R"[S5R	XR555eUSSX5S-'/USS&GMUnU(d<[R"[S
5R	XR555eURS5X5'GMr U(a1[R"[S5R	XS55eU$)Nr�r�rr��_listr�z#command {0!r} needs one or more {1}r�r)z#command {0!r} requires argument {1}z"extra argument to command {0}: {1})rrr�rr"r�r)rYr�r��argdict�ap�argnames      rrSrS�s����G����S�b�'��
�b�6�S�=��#'�8�8�A�;�� ��
��V�s�]��-1�!�W��'�)�*���-1��'�)�*�
��V�s�]���)�)��A�B�I�I��]�]�_����.2�!�W��'�)�*���
��V�s�]��4�y�1�}��)�)��A�B�I�I��]�]�_����
*.�c�r��G�g�%�&��D��"�I��G���)�)��A�B�I�I��]�]�_����$(�8�8�A�;�� �Q�T��!�!��8�9�@�@��1�g�N�
�	
��Nrc�F�SSKnUR5nURRnU[R
S'UR
5 [U/UQ70UD6UR5 UR5 $!UR5 UR5 f=f)Nr�COVERAGE_PROCESS_START)
�coverage�Coverage�config�config_file�os�environ�start�exception_to_return_code�stop�save)�the_callabler�r�r��covr�s      r�apply_coveragedr��sy���
�
�
�
�C��*�*�(�(�K�+6�B�J�J�'�(��I�I�K��'��F�t�F�v�F����
����
��	���
����
�s�A>�>"B c�N�SSKnSSKnSSKnUR5upVUR	U5nUR
"[U/UQ70UD6=(d SnUR5 URRU5n	U	R5 U	RS5 U	RS5 U[R"U5 [R"U5 $!UR5 f=f![R"U5 [R"U5 f=f)Nr�cum�)�tempfile�hotshot�
hotshot.stats�mkstemp�Profile�runcallr�r��stats�load�
strip_dirs�
sort_stats�print_statsr��remove)
r�r�r�r�r��pffileno�pfname�prof�retr�s
          r�apply_profiledr�s�������'�'�)��H�����v�&��	����5�|�U�d�U�f�U���
�

�J�J�L��
�
�"�"�6�*��
����
�����	���"���
�����
�	�	�&���
�J�J�L��	�����
�	�	�&��s#�C6�$C!�AC6�!C3�3C6�6.D$c�F�U"U0UD6$![[4a� [R"5n[R
"U[R5n[RRS5(a#[S5 SSKnURUS5 Us$f=f)z�UI level helper for profiling and coverage.

This transforms exceptions into a return value of 3. As such its only
relevant to the UI layer, and should never be called where catching
exceptions may be desirable.
�BRZ_PDBz**** entering debuggerrNr))
�KeyboardInterrupt�	ExceptionrW�exc_infor	�report_exception�stderrr�r�rF�print�pdb�post_mortem)r�r�r�r��exitcoder�s      rr�r�'s�����T�,�V�,�,���y�)�
��<�<�>���)�)�(�C�J�J�?��
�:�:�>�>�)�$�$��*�+���O�O�H�Q�K�(���
�s�
�BB �B c���SSKJn U"[U/UQ70UD6upVUR5 UcUR	5 U$URU5 [R"[S5U5 U$)Nr)�profilezProfile data written to "%s".)	�
breezy.lsprofr�r��sort�pprintr�r	�noter)�filenamer�r�r�r�r�r�s       r�apply_lsprofiledr�=sd��%��1�<�Q�$�Q�&�Q�J�C�	�J�J�L���
�����J�	�
�
�8��
�
�
�7�:�;�X�F��Jrc��UcSSKnURR5nURU5nU(a[RU5$g)aReturn an expanded alias, or None if no alias exists.

cmd
    Command to be checked for an alias.
config
    Used to specify an alternative config to use,
    which is especially useful for testing.
    If it is unspecified, the global config will be used.
Nr)�
breezy.configr��GlobalConfig�	get_alias�cmdline�split)rYr�rz�aliass    rr�r�JsC���~�����+�+�-�����S�!�E���}�}�U�#�#�rc���[R"S[R-5 [	U5n[R"SU5 S=n=n=n=n=n=nn	Sn
/nSn/n
U[U5:GaXnUS:XaSnO�US:XaSnO�US	:XaSnXS
-n
US
-
nO�US:XaSnO�US:XaSn	O�US
:XaSnO�US:XaSnO�US:XaXS
-[RS'US
-
nO�US:XaSnO|US:XaOuURS5(a#[RRUSS5 O<URS5(aU
RUSS5 OURU5 US
-
nU[U5:aGM[R5RnURU
5 [R!5 U(d3SSKJn UR%5nUR'S5(+nU"US9 OU"5 UnU(d[)S5R+/5 gUSS:Xa[)S5R+/5 gSnU	(d)[-US5nU(aUR/S5US'UR/S5n[)UU(+S9nU(aSUlUR*nUU/n[2R4nS[2lU(a+U(a[R6"S5 [9U
U/UQ76nOJU(a*U(a[R6"S5 [;U/UQ76nOU(a
[=U/UQ76nOU"U6nU=(d SS[R;a[R>"S SS!9 U[2lURA5 $!S[R;a[R>"S SS!9 W[2lURA5 f=f)"a5Execute a command.

Args:
  argv: The command-line arguments, without the program name from
    argv[0] These should already be decoded. All library/test code calling
    run_bzr should be passing valid strings (don't need decoding).
  load_plugins: What function to call when triggering plugin loading.
    This function should take no arguments and cause all plugins to be
    loaded.
  disable_plugins: What function to call when disabling plugin
    loading. This function should take no arguments and cause all plugin
    loading to be prohibited (so that code paths in your application that
    know about some plugins possibly being present will fail to import
    those plugins even if they are installed.)

Returns:
  Returns a command exit code or raises an exception.

Special master options: these must come before the command because
they control how the command is interpreted.

--no-plugins
    Do not load plugin modules at all

--no-aliases
    Do not allow aliases

--builtin
    Only use builtin commands.  (Plugins are still allowed to change
    other behaviour.)

--profile
    Run under the Python hotshot profiler.

--lsprof
    Run under the Python lsprof profiler.

--coverage
    Generate code coverage report

--concurrency
    Specify the number of processes that can be run concurrently
    (selftest).
zbreezy version: zbrz arguments: %rFNrz	--profileTz--lsprofz
--lsprof-filerz--no-pluginsz--no-aliasesz	--no-l10nz	--builtinz
--concurrency�BRZ_CONCURRENCYz
--coveragez--profile-importsz-Dr)z-O)r��plugin_load_failure)�warn_load_problemsr�z	--version�version)r�z/--coverage ignored, because --lsprof is in use.z0--coverage ignored, because --profile is in use.�memoryzProcess status after command:)�short)!r	�mutterrz�__version__�_specified_or_unicode_argvrr�r�rMrVrWr�r�get_global_state�cmdline_overrides�
_from_cmdline�set_debug_flags_from_configr�r��suppress_warningr�r^r�rr�rrPrVr�r�r��debug_memory�_reset)rXrr�
opt_lsprof�opt_profile�opt_no_plugins�opt_builtin�opt_coverage�opt_no_l10n�opt_no_aliases�opt_lsprof_file�	argv_copy�i�override_configr^r�r��cr�rYrYr�rT�run_argv�saved_verbosity_levelr�s                          r�run_bzrr�^s���Z
�L�L�#�f�&8�&8�8�9�%�d�+�D�	�L�L�$�d�+���J����~����l�����O��I�	�A��O�
�c�$�i�-��G������K�
�*�_��J�
�/�
!��J�"�q�5�k�O�
��F�A�
�.�
 �!�N�
�.�
 �!�N�
�+�
��K�
�+�
��K�
�/�
!�,0�Q��K�B�J�J�(�)�
��F�A�
�,�
��L�
�%�
%��
�\�\�$�
�
����!�!�!�A�B�%�(�
�\�\�$�
�
��"�"�1�Q�R�5�)����Q��	�Q���?�c�$�i�-�B�/�/�1�C�C���#�#�O�4�	�%�%�'��!����!��!"�!3�!3�4I�!J�J���(:�;����D���v��/�/��3���A�w�+���y�!�2�2�2�6���J���t�A�w�'�
�� �n�n�Q�'�D��G�
�(�(�1�+�C��S�{�?�C�G�����
�
"�
"�C��j�!�H�#�!'� 7� 7��"#������
�
�O�P�"�?�C�C�(�C�C�
���
�
�P�Q� ��0�x�0�C�
�!�#�1��1�C��x�.�C��x�a��
�u�(�(�(����>�e�L�"7���� � �"��	�u�(�(�(����>�e�L�"7���� � �"�s�<B!N#�#AO)c�^�U4SjnU$)z0Decorator that suppresses pipe/interrupt errors.c�V>�T"U0UD6n[RR5 U$![ahnSSKn[USS5ceURUR:wa1[RS:wdURSUR4;aeSnAgSnAf[a gf=f)Nr�errno�win32)
rW�stdout�flush�OSErrorr�r��EPIPE�platform�EINVALr�)r�r�r�er��funcs     �r�ignore_pipe�$display_command.<locals>.ignore_pipes����	��4�*�6�*�F��J�J�����M���		���q�'�4�(�0���w�w�%�+�+�%��<�<�7�*�q�w�w�q�%�,�,�>O�/O���� �	��	�s�'+�
B(�AB�
B(�'B(r-)r�r�s` r�display_commandr��s����$�rc��[[RS;ag[RRS[S5 [RRS[S5 [RRS[
S5 [RRS[S5 [RRS[S5 g)	z/Install the hooks to supply bzr's own commands.r�Nzbzr commandsr�zbzr plugin commandszbzr external command lookupr�zbzr plugin-provider-db check)r�r�r��install_named_hookr�r�r�r�r-rr�install_bzr_command_hooksr�s����W�]�]�?�;�;���M�M�$�$��+�^���M�M�$�$�]�4D�n�U��M�M�$�$��*�,A���M�M�$�$��,�.K���M�M�$�$��3�5S�rc��Uc[RSS$/nUHCn[U[5(d[	SRU55eUR
U5 ME U$![[4a [R"S5ef=f)Nrznot native str or unicode: {!r}z'argv should be list of unicode strings.)
rWrXr;r<�
ValueErrorr"r�UnicodeDecodeErrorr�BzrError)rX�new_argvr^s   rr�r�)s����|��x�x���|���H�I��A��a��%�%� �!B�!I�!I�!�!L�M�M��O�O�A����O��
�*�+�I��o�o�G�H�H�I�s�A	A%�%'Bc�n�UbUSSn[5 [U5n[R"SU5 U$)azMain entry point of command-line interface.

Typically `breezy.initialize` should be called first.

Args:
  argv: list of unicode command-line arguments similar to sys.argv.
    argv[0] is script name usually, it will be ignored.
    Don't pass here sys.argv because this list contains plain strings
    and not unicode; pass None instead.

Returns:
  exit code of brz command.
Nrzreturn code %d)r|�run_bzr_catch_errorsr	r�)rXr�s  r�mainr:s9�����A�B�x��� �
�t�
$�C�	�L�L�!�3�'��Jrc�6�[5 [[U5$)z�Run a bzr command with parameters as described by argv.

This function assumed that that UI layer is setup, that symbol deprecations
are already applied, and that unicode decoding has already been performed
on argv.
)r�r�r�)rXs rrrPs����#�G�T�2�2rc�(�[5 [U5$![apn[U[[
45(d[
USS5(d=[R"[R"5[R5 SnAgeSnAff=f)z�Run brz and report user errors, but let internal errors propagate.

This is used for the test suite, and might be useful for other programs
that want to wrap the commandline interface.
r+TN�)r�r�r�r;r��IOErrorr�r	r�rWr�r�)rXr�s  r�run_bzr_catch_user_errorsr\sk������t�}������a�'�7�+�,�,�G�A�?O�QU�4V�4V��"�"�3�<�<�>�3�:�:�>�����s�
�
B�A%B�B�Bc�$�\rSrSrSrSrSrSrg)�HelpCommandIndexinz+A index for bzr help that returns commands.c��SUlg)Nz	commands/��prefixrCs rr�HelpCommandIndex.__init__qs	��!��rc��U(a8URUR5(aU[UR5Sn[USS9nU/$![a /s$f=f)z�Search for topic amongst commands.

Args:
  topic: A topic to search for.

Returns:
  A list which is either empty or contains a single
  Command entry.
NF)r�)rMr
rr�rT)r�topicrYs   r�
get_topics�HelpCommandIndex.get_topicstsa���U�%�%�d�k�k�2�2��#�d�k�k�*�,�-�E�	�!�%�u�=�C��5�L���	��I�	�s�
A�A�ArN)r'r(r)r*r:rrr,r-rrr
r
ns��5�"�rr
c��\rSrSrSrSrSrg)�Provideri�z)Generic class to be overriden by plugins.c��[e)z�Takes a command and returns the information for that plugin.

:return: A dictionary with all the available information
    for the requested plugin
)rj)rrs  rr��Provider.plugin_for_command�s
��"�!rr-N)r'r(r)r*r:r�r,r-rrrr�s
��3�"rrc��\rSrSrSrSrSrg)�ProvidersRegistryi�z7This registry exists to allow other providers to exist.c#�F# �UR5H	upUv� M g7fr)r)r�_keyrs   r�__iter__�ProvidersRegistry.__iter__�s���"�j�j�l�N�D��N�+�s�!r-N)r'r(r)r*r:rr,r-rrrr�s
��A�rrre)T)TTr)H�
__docformat__rdr�rW�typingrrr�rrr	r
�globalsrrr�r
r�pluginrrrr�rr/r@r=rhrtrArirprNr|rwr�r�r�r�r�r�r<r{r�r�r�r�r�r�r�r�r�r�r}rMrSr�r�r�r�r�r�r�r�r�rrrr
rrr�r-rr�<module>r!s���0�
��	�
�"�!�!�$���I������>�>��y��(
&�
&�N&�h�'�'�N&�b���*�,��":���/�*�%�.�$�	�	�+��	�4��)���
(�VN�S�N�D�N�I�N�(IM�*��*�%)�*�AE�*��*�Z	����	�
�&�*�	�
�,�,�D4
�5�4
�n���
��<3�l��8�,
��( ,�_�]#�@�0�&�"�,	3��$��4	"�	"���)�)��/�0�r

Youez - 2016 - github.com/yon3zu
LinuXploit