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__/shelf_ui.cpython-313.pyc
�

p��ggM����SSKrSSKrSSKrSSKrSSKJr SSKrSSKJrJ	r	J
r
JrJrJ
r
JrJrJrJrJr SSKJr "SS\5r"SS	5r"S
S\5r"SS
5r"SS5rg)�N)�BytesIO�)�builtins�delta�diff�errors�osutils�patches�shelf�textfile�trace�ui�workingtree)�gettextc��\rSrSrSrSrg)�	UseEditor�)z)Use an editor instead of selecting hunks.�N)�__name__�
__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r��1/usr/lib/python3/dist-packages/breezy/shelf_ui.pyrr)s��3rrc
��\rSrSr\"S5\"S5\"S5\"S5\"S5\"S5\"S5\"S	5S
.rSrSrS
rSr	Sr
SrSrSr
g)�
ShelfReporter�-zShelve adding file "%(path)s"?zShelve binary changes?z0Shelve changing "%s" from %(other)s to %(this)s?z Shelve removing file "%(path)s"?zShelve %d change(s)?zShelve?zDShelve changing target of "%(path)s" from "%(other)s" to "%(this)s"?z*Shelve renaming "%(other)s" => "%(this)s"?�zadd file�binary�change kindzdelete file�final�hunk�
modify target�renameFc�8�[R"5Ulg�N)r�_ChangeReporter�delta_reporter��selfs r�__init__�ShelfReporter.__init__=s��#�3�3�5��rc�0�[R"S5 g)z.Report that no changes were selected to apply.zNo changes to shelve.N)r
�warningr+s r�
no_changes�ShelfReporter.no_changes@s��
�
�
�-�.rc�H�[R"[S5U-5 g)z&Report the id changes were shelved to.zChanges shelved with id "%d".N�r
�noter)r,�shelf_ids  r�
shelved_id�ShelfReporter.shelved_idDs��
�
�
�7�:�;�h�F�Grc�B�[R"[S55 g)z/Report that changes were made without shelving.zSelected changes destroyed.Nr4r+s r�changes_destroyed�ShelfReporter.changes_destroyedHs��
�
�
�7�8�9�:rc��[R"[S55 UR5n[R
"X R5 g)z&Report the changes that were selected.zSelected changes:N)r
r5r�iter_changesr�report_changesr*)r,�	transform�changess   r�selected_changes�ShelfReporter.selected_changesLs6��
�
�
�7�.�/�0��(�(�*��
���W�&9�&9�:rc���USS:XaUSUSS.nO9USS:XaUSUSUSS.nO USS	:XaUSUSUSS.nOS
US0nURUSU-nU$)z+Determine the prompt for a change to apply.rr&��)�this�otherr"�)�pathrGrFr%rI)�vocab)r,�change�vals�prompts    r�
prompt_change�ShelfReporter.prompt_changeRs����!�9�� �"�1�I��q�	�:�D�
�A�Y�-�
'�"�1�I��q�	�6�!�9�M�D�
�A�Y�/�
)�"�1�I��q�	�6�!�9�M�D��F�1�I�&�D����F�1�I�&��-���
r)r*N)rrrrrrJ�invert_diffr-r1r7r:rArNrrrrrr-sz���<�=��2�3��Q�R��A�B��/�0��	�"� �R�
��F�G�
�E��K�6�/�H�;�;�rrc
��\rSrSr\"S5\"S5\"S5\"S5\"S5\"S5\"S5\"S	5S
.rSrSrS
rg)�
ApplyReporter�`zDelete file "%(path)s"?zApply binary changes?z-Change "%(path)s" from %(this)s to %(other)s?zAdd file "%(path)s"?zApply %d change(s)?z
Apply change?z;Change target of "%(path)s" from "%(this)s" to "%(other)s"?z!Rename "%(this)s" => "%(other)s"?r Tc��gr(rr+s rr:�ApplyReporter.changes_destroyedps��rrN)	rrrrrrJrPr:rrrrrRrR`s`���5�6��1�2��N�O��5�6��.�/���(� �I�
��=�>�
�E��K�
rrRc��\rSrSrSrSSjr\SSj5rSrSr	SSjr
S	rSS
jrSr
SrS
r\S5rSrg)�Shelver�tz3Interactively shelve the changes in a working tree.Nc��XlX lX0lURc[RUlU	cUR5n	X�lX@lXPlX`l	Xpl
X�lU
c
[5n
X�l
URRR5nUR!X!5UlURR%5 g)aIConstructor.

:param work_tree: The working tree to shelve changes from.
:param target_tree: The "unchanged" / old tree to compare the
    work_tree to.
:param auto: If True, shelve each possible change.
:param auto_apply: If True, shelve changes with no final prompt.
:param file_list: If supplied, only files in this list may be shelved.
:param message: The message to associate with the shelved changes.
:param destroy: Change the working tree without storing the shelved
    changes.
:param manager: The shelf manager to use.
:param reporter: Object for reporting changes to user.
N)�	work_tree�target_tree�diff_writer�sys�stdout�get_shelf_manager�manager�auto�
auto_apply�	file_list�message�destroyr�reporter�branch�
get_config�get_change_editor�
change_editor�lock_tree_write)r,rZr[r\rarbrcrdrer`rf�configs            rr-�Shelver.__init__ws���6#��&��&�����#�"�z�z�D���?��1�1�3�G����	�$��"��������$��H� �
����&�&�1�1�3��#�5�5�k�M������&�&�(rc��UcSnO-U(a&UVs/sHn[R"Xh5PM nn[RR	U5up�U	R5 [R"SX)RU	5nU	RU5nU"X�XX<XW5sSSS5 $s snf!,(df   g=f)aCreate a shelver from commandline arguments.

The returned shelver wil have a work_tree that is locked and should
be unlocked.

:param revision: RevisionSpec of the revision to compare to.
:param all: If True, shelve all changes without prompting.
:param file_list: If supplied, only files in this list may be  shelved.
:param message: The message to associate with the shelved changes.
:param directory: The directory containing the working tree.
:param destroy: Change the working tree without storing the shelved
    changes.
N�.�shelf2)
r	�pathjoinr�WorkingTree�open_containingrkr�_get_one_revision_treerg�safe_relpath_files)
�klassr\�revision�allrcrd�	directoryre�f�treerIr[�filess
             r�	from_args�Shelver.from_args�s���0���I�
�AJ�K��A��)�)�)�7��I�K� �,�,�<�<�Y�G�
���
!�
!�
#�"�9�9��(�K�K���K��+�+�I�6�E���;�S���$�
#��	L�$�
#�s� B-�%>B2�2
Cc�F�[R"URURUR5n[
R"5UlSnUR5HlnUSS:XaX RXS5-
nM%URURR!U55(dMVUR#U5 US-
nMn US:�a�URR%UR&5 UR((d0URURRSU-5(a|UR*(a+UR-5 URR/5 O[UR0R3XR45nURR7U5 OURR95 [:R<"UR5 UR?5 g![RaO URURRS5(aUS-
nURUS5 GMGMf=f![:R<"UR5 UR?5 f=f)z!Interactively shelve the changes.rzmodify textrr!r#N) r�ShelfCreatorrZr[rc�tempfile�mkdtemp�tempdir�iter_shelvable�handle_modify_textr�
BinaryFile�prompt_boolrfrJ�shelve_content_changerN�
shelve_changerA�work_transformrbrer?r:r`�shelve_changesrdr7r1�shutil�rmtree�finalize)r,�creator�changes_shelvedrKr6s     r�run�Shelver.run�s���$�$�T�^�^�T�5E�5E�t�~�~�V���'�'�)�����	�!�0�0�2���!�9�
�-�E�'�+B�+B�7�ST�I�+V�V���'�'��
�
�(C�(C�F�(K�L�L��-�-�f�5�'�1�,��3���"��
�
�.�.�w�/E�/E�F��?�?�d�&6�&6��M�M�'�'��0�?�B�'�'��|�|��)�)�+��
�
�7�7�9�#'�<�<�#>�#>�w���#U���
�
�0�0��:���
�
�(�(�*��M�M�$�,�,�'������/"�,�,�E��+�+�D�M�M�,?�,?��,I�J�J�+�q�0�O�#�9�9�&��)�D�D�K�E��,
�M�M�$�,�,�'�����s8�I.�1H�/I.�:DI.�AI+�"I.�*I+�+I.�.2J c��URbURR5 URR5 gr()rj�finishrZ�unlockr+s rr��Shelver.finalize�s0�����)����%�%�'������rc��[5nU(aURnURnOURnURnURU5nURU5n[R
"5n[R"XEX8S9n	U	R
XgSS5 URS5 [R"U5$)z�Return a parsed version of a file's patch.

:param file_id: The id of the file to generate a patch for.
:param invert: If True, provide an inverted patch (insertions displayed
    as removals, removals displayed as insertions).
:return: A patches.Patch.
��
path_encoding�filer)rrZr[�id2pathr	�get_terminal_encodingr�DiffText�seekr
�parse_patch)
r,�file_id�invert�	diff_file�old_tree�new_tree�old_path�new_pathr��text_differs
          r�get_parsed_patch�Shelver.get_parsed_patch�s����I�	���~�~�H��'�'�H��'�'�H��~�~�H��#�#�G�,���#�#�G�,���5�5�7�
��m�m��	�
��	����V�V�<����q���"�"�9�-�-rc�>�[RRXUS9$)N)�default)r�
ui_factory�choose)r,rd�choicesr�s    rrM�Shelver.prompts���}�}�#�#�G�g�#�F�Frc�$�UR(agSnSnU(a
US-
nUS-
nUS-
nUS-
nURXS5nUcS	nOX5nUS
:XagUS:Xa
U(a[eUS:XaSUlgUS:Xa[R"5eg
)z�Prompt the user with a yes/no question.

This may be overridden by self.auto.  It may also *set* self.auto.  It
may also raise UserAbort.
:param question: The question to ask the user.
:return: True or False
T�ynz&yes
&No�ez
&edit manually�fqz
&finish
&quitr�n�yrz�qF)rarMrr�	UserAbort)r,�question�allow_editor�alternatives_chars�alternatives�choice�chars       rr��Shelver.prompt_bools����9�9��!��"����#�%���.�.�L��d�"���*�*�����X�Q�7���>��D�%�-�D��3�;��
�S�[�\��O�
�S�[��D�I���3�;��"�"�$�$�rc��URRU5nURRX25nURXU5upVUS:waUR
X%5 U$![a URX$5upVN8f=f)z�Handle modified text, by using hunk selection or file editing.

:param creator: A ShelfCreator.
:param file_id: The id of the file that was modified.
:return: The number of changes.
r)rZr��get_file_lines�
_select_hunksr�
_edit_file�shelve_lines)r,r�r�rI�work_tree_lines�lines�change_counts       rr��Shelver.handle_modify_text5s����~�~�%�%�g�.���.�.�7�7��F��	L�"&�"4�"4�W��"W��E��1��� � ��0����	�	L�"&�/�/�'�"K��E�<�	L�s�A%�%B�Bc��URR(aUnO6URRU5nURR	U5n[
R"U5 [
R"U5 URX RR5n/nUR(GdSnURRUR55 URH�n	URRU	R55 URURRSUR SLS9n
URR(dU
(+n
U
(a(U	=R"U-
slUR%U	5 M�X�R&U	R(-
-nM� [*R,R/5 URR(a[1U5nO![1UR5[1U5-
n[2R4"XG5n[7U5n
X�4$)a_Provide diff hunk selection for modified text.

If self.reporter.invert_diff is True, the diff is inverted so that
insertions are displayed as removals and vice versa.

:param creator: a ShelfCreator
:param file_id: The id of the file to shelve.
:param work_tree_lines: Line contents of the file in the working tree.
:return: number of shelved hunks.
rr$N)r�)rfrPr[r�r�r�check_text_linesr�rar\�write�
get_header�hunks�as_bytesr�rJrj�mod_pos�append�	mod_range�
orig_ranger]r^�flush�lenr
�iter_patched_from_hunks�list)r,r�r�r��target_linesrI�parsed�final_hunks�offsetr$�selectedr��patchedr�s              rr��Shelver._select_hunksFs����=�=�$�$�*�L��#�#�+�+�G�4�D��+�+�:�:�4�@�L��!�!�/�2��!�!�,�/��&�&�w�
�
�0I�0I�J�����y�y�y��F����"�"�6�#4�#4�#6�7������ � �&�&�t�}�}��7��+�+��M�M�'�'��/�"&�"4�"4�D�"@�,����}�}�0�0�#+�|�H���L�L�F�*�L��&�&�t�,��n�n�t���>�>�F�%�	�
�
�����=�=�$�$��{�+�L��v�|�|�,�s�;�/?�?�L��1�1�,�L���W�
���"�"rc��[R"URRURRRU5URRRU555nX0RX#54$)a	:param file_id: id of the file to edit.
:param work_tree_lines: Line contents of the file in the working tree.
:return: (lines, change_region_count), where lines is the new line
    content of the file, and change_region_count is the number of
    changed regions.
)r	�split_linesrj�	edit_filer�r�r��_count_changed_regions)r,r�r�r�s    rr��Shelver._edit_filessr���#�#����(�(��"�"�+�+�3�3�G�<��"�"�+�+�3�3�G�<�
�
���1�1�/�I�I�Irc�l�[R"SX5nUR5n[U5S-
$)NrE)�patiencediff�PatienceSequenceMatcher�get_matching_blocksr�)�	old_lines�	new_lines�matcher�blockss    rr��Shelver._count_changed_regions�s0���6�6�t�Y�R���,�,�.���6�{�Q��r)rarbrjrer\rcr`rdrfr[r�rZ)NFFNNFNN)NFNNNF)F)rrrrrr-�classmethodr}r�r�r�rMr�r�r�r��staticmethodr�rrrrrWrWts���=��
�������-)�^�������%��%�N!�F �
.�2G�!�F�"+#�Z
J����rrWc�T�\rSrSrSr\S
Sj5rSSjrSrSr	Sr
S	rg)�	Unshelveri�z%Unshelve changes into a working tree.Nc
��[RRU5upVUR5 UR	5nUb
[U5nO2UR5nUc[R"[S55eSnSn	Sn
SnUS:XaSnSn	O"US:XaSnSn	SnOUS:XaSnSn
O
US:XaSnSn	U"UUUUU	U
UU5$![a [R"U5ef=f! UR5 e=f)awCreate an unshelver from commandline arguments.

The returned shelver will have a tree that is locked and should
be unlocked.

:param shelf_id: Integer id of the shelf, as a string.
:param action: action to perform.  May be 'apply', 'dry-run',
    'delete', 'preview'.
:param directory: The directory to unshelve changes into.
:param write_diff_to: See Unshelver.__init__().
zNo changes are shelved.TFzdry-run�previewzdelete-only�keep)rrrrsrkr_�int�
ValueErrorr�InvalidShelfId�
last_shelfr�CommandErrorrr�)rvr6�actionry�
write_diff_tor{rIr`�
apply_changes�delete_shelf�
read_shelf�	show_diffs            rr}�Unshelver.from_args�s8��!�,�,�<�<�Y�G�
������	��,�,�.�G��#�9�"�8�}�H�#�-�-�/���#� �-�-�g�6O�.P�Q�Q� �M��L��J��I���"� %�
�$���9�$� %�
�$�� �	��=�(� %�
�"�
��6�!� $�
�$�����������	
�		
��5"�9��.�.�x�8�8�9��.	��K�K�M��s6�C-�C	�AC-�C-�%
C-�0
C-�	!C*�*C-�-Dc	��XlUR5nX lX0lX@lXPlX`lXplX�lg)aKConstructor.

:param tree: The working tree to unshelve into.
:param manager: The ShelveManager containing the shelved changes.
:param shelf_id:
:param apply_changes: If True, apply the shelved changes to the
    working tree.
:param delete_shelf: If True, delete the changes from the shelf.
:param read_shelf: If True, read the changes from the shelf.
:param show_diff: If True, show the diff that would result from
    unshelving the changes.
:param write_diff_to: A file-like object where the diff will be
    written to. If None, ui.ui_factory.make_output_stream() will
    be used.
N)	r{r_r`r6r�r�r�r�r�)	r,r{r`r6r�r�r�r�r�s	         rr-�Unshelver.__init__�s=��4�	��(�(�*���� �
�*��(��$��"��*�rc���[R"5nURURR	55 UR
(Ga&[R"[S5UR-5 URRUR5nURUR5 URb,[R"[S5UR-5 [R "5nUR#5nX4lUR&(aUR)5 O4UR*(aUR-U5 OUR/U5 UR0(aQURR1UR5 [R"[S5UR-5 SSS5 g!,(df   g=f)z!Perform the unshelving operation.zUsing changes with id "%d".NzMessage: %szDeleted changes with id "%d".)�
contextlib�	ExitStack�
enter_contextr{rkr�r
r5rr6r`�
get_unshelver�callbackr�rdrr)�make_merger�change_reporterr��do_merger��
write_diff�show_changesr�)r,�
exit_stack�	unshelverr�mergers     rr��
Unshelver.run�s?��
�
!�
!�
#�z��$�$�T�Y�Y�%>�%>�%@�A������
�
�7�#@�A�D�M�M�Q�R� �L�L�6�6�t�}�}�E�	��#�#�I�$6�$6�7��$�$�0��J�J�w�}�5�	�8I�8I�I�J�"'�"7�"7�"9��"�.�.�0��)8�&��%�%��O�O�%��^�^��O�O�F�+��%�%�f�-�� � ����)�)�$�-�-�8��
�
�7�#B�C�d�m�m�S�T�'$�
#�
#�s�GG#�#
G1c�`�UR5nUR5nUR5nURc"[R
R
SS9Ul[R"5n[R"URX@RUS9 UR5 g)z2Write this operation's diff to self.write_diff_to.N�exact)�
encoding_typer�)
r�make_preview_transform�get_preview_treer�rr��make_output_streamr	�get_diff_header_encodingr�show_diff_trees�	this_treer�)r,r
�tree_merger�ttr�r�s      rr	�Unshelver.write_diffs����(�(�*��
�
/�
/�
1���&�&�(�����%�!#���!A�!A�PW�!A�!X�D���8�8�:�
�������h�(:�(:�-�	
�	���
rc�d�UR5nUR5nUR5 g)z/Show the changes that this operation specifies.N)rrr�)r,r
rrs    rr
�Unshelver.show_changess'���(�(�*��
�
/�
/�
1��
���
r)r�r�r`r�r6r�r{r�)N�applyroN)TTTFN)rrrrrr�r}r-r�r	r
rrrrr�r��sB��/��KO�8
��8
�~�����"+�HU�.�rr�)rr�r]r��iorr��rrrrr	r
rrr
rr�i18nr�	ExceptionrrrRrWr�rrr�<module>r"sn��"�
�
���������4�	�4�0�0�f
�M�
�(R�R�jK�Kr

Youez - 2016 - github.com/yon3zu
LinuXploit