§
    cÌc-O  ã                   ó   — d dl Z d dlZd dlZd dlZd dlZd dlmZ ddlmZm	Z	m
Z
mZmZmZmZmZmZmZmZ ddlmZ  G d„ de¦  «        Z G d„ d	¦  «        Z G d
„ de¦  «        Z G d„ d¦  «        Z G d„ d¦  «        ZdS )é    N)ÚBytesIOé   )ÚbuiltinsÚdeltaÚdiffÚerrorsÚosutilsÚpatchesÚshelfÚtextfileÚtraceÚuiÚworkingtree)Úgettextc                   ó   — e Zd ZdZdS )Ú	UseEditorz)Use an editor instead of selecting hunks.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    ú1/usr/lib/python3/dist-packages/breezy/shelf_ui.pyr   r   )   s   € € € € € Ø3Ð3Ð3Ð3r   r   c            
       óÜ   — e Zd Z ed¦  «         ed¦  «         ed¦  «         ed¦  «         ed¦  «         ed¦  «         ed¦  «         ed¦  «        d	œZd
Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d„ ZdS )ÚShelfReporterzShelve adding file "%(path)s"?zShelve binary changes?z0Shelve changing "%s" from %(other)s to %(this)s?z Shelve removing file "%(path)s"?zShelve %d change(s)?zShelve?zDShelve changing target of "%(path)s" from "%(other)s" to "%(this)s"?z*Shelve renaming "%(other)s" => "%(this)s"?©zadd fileÚbinaryúchange kindzdelete fileÚfinalÚhunkúmodify targetÚrenameFc                 ó6   — t          j        ¦   «         | _        d S ©N)r   Ú_ChangeReporterÚdelta_reporter©Úselfs    r   Ú__init__zShelfReporter.__init__>   s   € Ý#Ô3Ñ5Ô5ˆÔÐÐr   c                 ó.   — t          j        d¦  «         dS )z.Report that no changes were selected to apply.zNo changes to shelve.N)r   Úwarningr'   s    r   Ú
no_changeszShelfReporter.no_changesA   s   € åŒÐ-Ñ.Ô.Ð.Ð.Ð.r   c                 óN   — t          j        t          d¦  «        |z  ¦  «         dS )z&Report the id changes were shelved to.zChanges shelved with id "%d".N©r   Únoter   )r(   Úshelf_ids     r   Ú
shelved_idzShelfReporter.shelved_idE   s&   € åŒ
•7Ð:Ñ;Ô;¸hÑFÑGÔGÐGÐGÐGr   c                 óH   — t          j        t          d¦  «        ¦  «         dS )z/Report that changes were made without shelving.zSelected changes destroyed.Nr.   r'   s    r   Úchanges_destroyedzShelfReporter.changes_destroyedI   s!   € åŒ
•7Ð8Ñ9Ô9Ñ:Ô:Ð:Ð:Ð:r   c                 ó¤   — t          j        t          d¦  «        ¦  «         |                     ¦   «         }t	          j        || j        ¦  «         dS )z&Report the changes that were selected.zSelected changes:N)r   r/   r   Úiter_changesr   Úreport_changesr&   )r(   Ú	transformÚchangess      r   Úselected_changeszShelfReporter.selected_changesM   sH   € åŒ
•7Ð.Ñ/Ô/Ñ0Ô0Ð0Ø×(Ò(Ñ*Ô*ˆÝÔ˜W dÔ&9Ñ:Ô:Ð:Ð:Ð:r   c                 ó  — |d         dk    r|d         |d         dœ}nT|d         dk    r|d         |d         |d         dœ}n/|d         d	k    r|d         |d         |d         dœ}n
d
|d         i}| j         |d                  |z  }|S )z+Determine the prompt for a change to apply.r   r"   é   é   )ÚthisÚotherr   é   )Úpathr>   r=   r!   r@   )Úvocab)r(   ÚchangeÚvalsÚprompts       r   Úprompt_changezShelfReporter.prompt_changeS   s¨   € à�!Œ9˜Ò Ð Ø" 1œI°°q´	Ð:Ð:ˆDˆDØ�AŒY˜-Ò'Ð'Ø" 1œI°°q´	À6È!Ä9ÐMÐMˆDˆDØ�AŒY˜/Ò)Ð)Ø" 1œI°°q´	À6È!Ä9ÐMÐMˆDˆDà˜F 1œIÐ&ˆDØ”˜F 1œIÔ&¨Ñ-ˆØˆr   N)r   r   r   r   rA   Úinvert_diffr)   r,   r1   r3   r9   rE   r   r   r   r   r   -   s  € € € € € à ˜Ð!AÑBÔBØ�wÐ7Ñ8Ô8Ø#˜Gð %4ñ 5ô 5à#˜GÐ$FÑGÔGØ�gÐ4Ñ5Ô5Ø�W˜YÑ'Ô'Ø%˜gð 'Tñ Uô Uà�wð  .ñ /ô /ðð €Eð €Kð6ð 6ð 6ð/ð /ð /ðHð Hð Hð;ð ;ð ;ð;ð ;ð ;ðð ð ð ð r   r   c            
       ó¾   — e Zd Z ed¦  «         ed¦  «         ed¦  «         ed¦  «         ed¦  «         ed¦  «         ed¦  «         ed¦  «        d	œZd
Zd„ ZdS )ÚApplyReporterzDelete file "%(path)s"?zApply binary changes?z-Change "%(path)s" from %(this)s to %(other)s?zAdd file "%(path)s"?zApply %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                 ó   — d S r$   r   r'   s    r   r3   zApplyReporter.changes_destroyedq   s   € Øˆr   N)r   r   r   r   rA   rF   r3   r   r   r   rH   rH   a   s´   € € € € € à ˜Ð!:Ñ;Ô;Ø�wÐ6Ñ7Ô7Ø#˜Gð %5ñ 6ô 6à#˜GÐ$:Ñ;Ô;Ø�gÐ3Ñ4Ô4Ø�W˜_Ñ-Ô-Ø%˜gð 'Tñ Uô Uà�wÐBÑCÔCð
ð 
€Eð €Kðð ð ð ð r   rH   c                   ó†   — e Zd ZdZ	 	 	 dd„Ze	 	 dd„¦   «         Zd„ Zd„ Zdd„Z	d	„ Z
dd
„Zd„ Zd„ Zd„ Zed„ ¦   «         ZdS )ÚShelverz3Interactively shelve the changes in a working tree.NFc                 ó²  — || _         || _        || _        | j        €t          j        | _        |	€|                     ¦   «         }	|	| _        || _        || _        || _	        || _
        || _        |
€t          ¦   «         }
|
| _        | j         j                             ¦   «         }|                     ||¦  «        | _        | j                              ¦   «          dS )a©  Constructor.

        :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(   rM   rN   rO   rT   rU   rV   rW   rX   rS   rY   Úconfigs               r   r)   zShelver.__init__x   sÌ   € ð" #ˆŒØ&ˆÔØ&ˆÔØÔÐ#Ý"œzˆDÔØˆ?Ø×1Ò1Ñ3Ô3ˆGØˆŒØˆŒ	Ø$ˆŒØ"ˆŒØˆŒØˆŒØÐÝ$‘”ˆHØ ˆŒØ”Ô&×1Ò1Ñ3Ô3ˆØ#×5Ò5°kÀ9ÑMÔMˆÔØŒ×&Ò&Ñ(Ô(Ð(Ð(Ð(r   c                 óT  ‡— ‰€dŠn|rˆfd„|D ¦   «         }t           j                             ‰¦  «        \  }}	|                     ¦   «         5  t	          j        d||j        |¦  «        }
|                     |¦  «        } | ||
||||||¦  «        cddd¦  «         S # 1 swxY w Y   dS )aa  Create 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ú.c                 ó:   •— g | ]}t          j        ‰|¦  «        ‘ŒS r   )r	   Úpathjoin)Ú.0ÚfÚ	directorys     €r   ú
<listcomp>z%Shelver.from_args.<locals>.<listcomp>°   s&   ø€ ÐKÐKÐK¸A�Ô)¨)°QÑ7Ô7ÐKÐKÐKr   Úshelf2)r   ÚWorkingTreeÚopen_containingr^   r   Ú_get_one_revision_treerZ   Úsafe_relpath_files)ÚklassrO   ÚrevisionÚallrV   rW   rf   rX   Útreer@   rN   Úfiless         `     r   Ú	from_argszShelver.from_args�   s  ø€ ð  ÐØˆIˆIØð 	LØKÐKÐKÐKÀÐKÑKÔKˆIÝ Ô,×<Ò<¸YÑGÔG‰
ˆˆdð ×!Ò!Ñ#Ô#ð 	+ð 	+Ý"Ô9¸(ÀHØ:>¼+ÀtñMô MˆKà×+Ò+¨IÑ6Ô6ˆEØ�5˜˜{¨K¸¸cÀ5Ø  'ñ+ô +ð		+ð 	+ð 	+ð 	+ñ 	+ô 	+ð 	+ð 	+ð 	+ð 	+ð 	+ð 	+øøøð 	+ð 	+ð 	+ð 	+ð 	+ð 	+s   ÁABÂB!Â$B!c                 óÈ  — t          j        | j        | j        | j        ¦  «        }t          j        ¦   «         | _        d}	 |                     ¦   «         D ]Ð}|d         dk    r{	 ||  	                    ||d         ¦  «        z  }Œ/# t          j        $ rH |                      | j        j        d         ¦  «        r |dz  }|                     |d         ¦  «         Y Œ…w xY w|                      | j                             |¦  «        ¦  «        r|                     |¦  «         |dz  }ŒÑ|dk    r¾| j                             |j        ¦  «         | j        s(|                      | j        j        d         |z  ¦  «        ro| j        r.|                     ¦   «          | j                             ¦   «          nT| j                             || j        ¦  «        }| j                             |¦  «         n| j                             ¦   «          t;          j        | j        ¦  «         |                     ¦   «          dS # t;          j        | j        ¦  «         |                     ¦   «          w xY w)z!Interactively shelve the changes.r   zmodify textr   r   r   N) r   ÚShelfCreatorrM   rN   rV   ÚtempfileÚmkdtempÚtempdirÚiter_shelvableÚhandle_modify_textr   Ú
BinaryFileÚprompt_boolrY   rA   Úshelve_content_changerE   Úshelve_changer9   Úwork_transformrU   rX   r7   r3   rS   Úshelve_changesrW   r1   r,   ÚshutilÚrmtreeÚfinalize)r(   ÚcreatorÚchanges_shelvedrB   r0   s        r   ÚrunzShelver.run»   sr  € åÔ$ T¤^°TÔ5EØ%)¤^ñ5ô 5ˆåÔ'Ñ)Ô)ˆŒØˆð	Ø!×0Ò0Ñ2Ô2ð -ð -�Ø˜!”9 Ò-Ð-ðEØ'¨4×+BÒ+BÀ7ØCIÈ!Ä9ñ,Nô ,Nñ N˜˜øå!Ô,ð Eð Eð EØ×+Ò+¨D¬MÔ,?ÀÔ,IÑJÔJð EØ+¨qÑ0˜OØ#×9Ò9¸&À¼)ÑDÔDÐDøøðEøøøð
 ×'Ò'¨¬×(CÒ(CÀFÑ(KÔ(KÑLÔLð -Ø×-Ò-¨fÑ5Ô5Ð5Ø'¨1Ñ,˜øØ Ò"Ð"Ø”×.Ò.¨wÔ/EÑFÔFÐFØ”Oð ; t×'7Ò'7ØœÔ+¨GÔ4°ÑFñ(Hô (Hð ;à”|ð ;Ø×)Ò)Ñ+Ô+Ð+Øœ×7Ò7Ñ9Ô9Ð9Ð9à#'¤<×#>Ò#>¸wØ?C¼|ñ$Mô $M˜àœ×0Ò0°Ñ:Ô:Ð:øà”×(Ò(Ñ*Ô*Ð*åŒM˜$œ,Ñ'Ô'Ð'Ø×ÒÑÔÐÐÐøõ ŒM˜$œ,Ñ'Ô'Ð'Ø×ÒÑÔÐÐøøøs2   Á"H2 Á$BÂH2 ÂACÃH2 ÃCÃD(H2 È2/I!c                 óx   — | j         �| j                              ¦   «          | j                             ¦   «          d S r$   )r]   ÚfinishrM   Úunlockr'   s    r   r‚   zShelver.finalizeà   s:   € ØÔÐ)ØÔ×%Ò%Ñ'Ô'Ð'ØŒ×ÒÑÔÐÐÐr   c                 óˆ  — t          ¦   «         }|r| j        }| j        }n| j        }| j        }|                     |¦  «        }|                     |¦  «        }t	          j        ¦   «         }t          j        ||||¬¦  «        }	|	                     ||dd¦  «        }
|                     d¦  «         t          j
        |¦  «        S )a&  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   )r   rM   rN   Úid2pathr	   Úget_terminal_encodingr   ÚDiffTextÚseekr
   Úparse_patch)r(   Úfile_idÚinvertÚ	diff_fileÚold_treeÚnew_treeÚold_pathÚnew_pathr‹   Útext_differÚpatchs              r   Úget_parsed_patchzShelver.get_parsed_patchå   sÇ   € õ ‘I”Iˆ	Øð 	&Ø”~ˆHØÔ'ˆHˆHàÔ'ˆHØ”~ˆHØ×#Ò# GÑ,Ô,ˆØ×#Ò# GÑ,Ô,ˆÝÔ5Ñ7Ô7ˆÝ”m H¨h¸	Ø2?ðAñ Aô Aˆà× Ò  ¨8°V¸VÑDÔDˆØ�Š�qÑÔÐÝÔ" 9Ñ-Ô-Ð-r   c                 óF   — t           j                             |||¬¦  «        S )N)Údefault)r   Ú
ui_factoryÚchoose)r(   rW   Úchoicesr�   s       r   rD   zShelver.promptý   s   € ÝŒ}×#Ò# G¨W¸gÐ#ÑFÔFÐFr   c                 ó  — | j         rdS d}d}|r
|dz  }|dz  }|dz  }|dz  }|                      ||d¦  «        }|€d
}n||         }|dk    rdS |dk    r	|rt          ‚|dk    r	d| _         dS |dk    rt          j        ¦   «         ‚dS )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ÚnÚyre   ÚqF)rT   rD   r   r   Ú	UserAbort)r(   ÚquestionÚallow_editorÚalternatives_charsÚalternativesÚchoiceÚchars          r   r{   zShelver.prompt_bool   sÏ   € ð Œ9ð 	Ø�4Ø!ÐØ"ˆØð 	/Ø #Ñ%ÐØÐ.Ñ.ˆLØ˜dÑ"ÐØÐ*Ñ*ˆØ—’˜X |°QÑ7Ô7ˆØˆ>àˆDˆDà% fÔ-ˆDØ�3Š;ˆ;Ø�4Ø�SŠ[ˆ[˜\ˆ[ÝˆOØ�SŠ[ˆ[ØˆDŒIØ�4Ø�3Š;ˆ;ÝÔ"Ñ$Ô$Ð$à�5r   c                 ó2  — | j                              |¦  «        }| j                              ||¦  «        }	 |                      |||¦  «        \  }}n)# t          $ r |                      ||¦  «        \  }}Y nw xY w|dk    r|                     ||¦  «         |S )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   )rM   r�   Úget_file_linesÚ_select_hunksr   Ú
_edit_fileÚshelve_lines)r(   rƒ   r’   r@   Úwork_tree_linesÚlinesÚchange_counts          r   ry   zShelver.handle_modify_text#  s½   € ð Œ~×%Ò% gÑ.Ô.ˆØœ.×7Ò7¸¸gÑFÔFˆð	LØ"&×"4Ò"4°W¸gØ5Dñ#Fô #FÑˆE�<�<øåð 	Lð 	Lð 	LØ"&§/¢/°'¸?Ñ"KÔ"KÑˆE�<�<�<ð	Løøøà˜1ÒÐØ× Ò  ¨%Ñ0Ô0Ð0ØÐs   ·A Á#A8Á7A8c                 óì  — | j         j        r|}n4| j                             |¦  «        }| j                             |¦  «        }t          j        |¦  «         t          j        |¦  «         |                      || j         j        ¦  «        }g }| j        sÛd}| j	         
                    |                     ¦   «         ¦  «         |j        D ]¥}	| j	         
                    |	                     ¦   «         ¦  «         |                      | j         j        d         | j        du¬¦  «        }
| j         j        s|
 }
|
r&|	xj        |z  c_        |                     |	¦  «         Œ“||	j        |	j        z
  z  }Œ¦t*          j                             ¦   «          | j         j        rt1          |¦  «        }n$t1          |j        ¦  «        t1          |¦  «        z
  }t3          j        ||¦  «        }t7          |¦  «        }||fS )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.
        r   r    N)rª   )rY   rF   rN   r�   r°   r   Úcheck_text_linesr›   rT   rO   ÚwriteÚ
get_headerÚhunksÚas_bytesr{   rA   r]   Úmod_posÚappendÚ	mod_rangeÚ
orig_rangerP   rQ   ÚflushÚlenr
   Úiter_patched_from_hunksÚlist)r(   rƒ   r’   r´   Útarget_linesr@   ÚparsedÚfinal_hunksÚoffsetr    Úselectedr¶   Úpatchedrµ   s                 r   r±   zShelver._select_hunks5  s÷  € ð Œ=Ô$ð 	AØ*ˆLˆLàÔ#×+Ò+¨GÑ4Ô4ˆDØÔ+×:Ò:¸4Ñ@Ô@ˆLÝÔ! /Ñ2Ô2Ð2ÝÔ! ,Ñ/Ô/Ð/Ø×&Ò& w°´Ô0IÑJÔJˆØˆØŒyð 	AØˆFØÔ×"Ò" 6×#4Ò#4Ñ#6Ô#6Ñ7Ô7Ð7Øœð Að A�ØÔ ×&Ò& t§}¢}¡¤Ñ7Ô7Ð7Ø×+Ò+¨D¬MÔ,?ÀÔ,GØ:>Ô:LØAEð;Fð ,ñ Hô H�ð ”}Ô0ð .Ø$, �HØð AØ�L”L FÑ*�L”LØ×&Ò& tÑ,Ô,Ð,Ð,à˜tœ~°´Ñ?Ñ@�F�FÝŒ
×ÒÑÔÐØŒ=Ô$ð 	@Ý˜{Ñ+Ô+ˆLˆLå˜vœ|Ñ,Ô,­s°;Ñ/?Ô/?Ñ?ˆLÝÔ1°,Ø2=ñ?ô ?ˆå�W‘”ˆØ�lÐ"Ð"r   c                 ó   — t          j        | j                             | j        j                             |¦  «        | j        j                             |¦  «        ¦  «        ¦  «        }||                      ||¦  «        fS )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_linesr]   Ú	edit_filer•   r�   r–   Ú_count_changed_regions)r(   r’   r´   rµ   s       r   r²   zShelver._edit_fileb  sv   € õ Ô# DÔ$6×$@Ò$@ØÔÔ'×/Ò/°Ñ8Ô8ØÔÔ'×/Ò/°Ñ8Ô8ñ%:ô %:ñ ;ô ;ˆð �d×1Ò1°/À5ÑIÔIÐIÐIr   c                 óz   — t          j        d | |¦  «        }|                     ¦   «         }t          |¦  «        dz
  S )Nr<   )ÚpatiencediffÚPatienceSequenceMatcherÚget_matching_blocksrÂ   )Ú	old_linesÚ	new_linesÚmatcherÚblockss       r   rÎ   zShelver._count_changed_regionso  s>   € åÔ6°t¸YØ7@ñBô Bˆà×,Ò,Ñ.Ô.ˆÝ�6‰{Œ{˜Q‰Ðr   )NFFNNFNN)NFNNNF)F)r   r   r   r   r)   Úclassmethodrr   r…   r‚   r›   rD   r{   ry   r±   r²   ÚstaticmethodrÎ   r   r   r   rK   rK   u   s  € € € € € Ø=Ð=àFKØ;?Ø7;ð#)ð #)ð #)ð #)ðJ ØJNØ8=ð+ð +ð +ñ „[ð+ð:#ð #ð #ðJ ð  ð  ð
.ð .ð .ð .ð0Gð Gð Gð!ð !ð !ð !ðFð ð ð$+#ð +#ð +#ðZJð Jð Jð ðð ñ „\ðð ð r   rK   c                   óN   — e Zd ZdZe	 	 dd„¦   «         Z	 	 	 dd„Zd	„ Zd
„ Zd„ Z	dS )Ú	Unshelverz%Unshelve changes into a working tree.NÚapplyra   c           
      ó4  — t           j                             |¦  «        \  }}|                     ¦   «          	 |                     ¦   «         }|�3	 t          |¦  «        }nY# t          $ r t          j        |¦  «        ‚w xY w| 	                    ¦   «         }|€!t          j        t          d¦  «        ¦  «        ‚d}d}	d}
d}|dk    rd}d}	n"|dk    rd}d}	d}n|dk    rd}d}
n
|dk    rd}d}	n#  |                     ¦   «          ‚ xY w | |||||	|
||¦  «        S )	a·  Create 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__().
        NzNo changes are shelved.TFzdry-runÚpreviewzdelete-onlyÚkeep)r   ri   rj   r^   rR   ÚintÚ
ValueErrorr   ÚInvalidShelfIdÚ
last_shelfr   ÚCommandErrorr   rˆ   )rm   r0   Úactionrf   Úwrite_diff_torp   r@   rS   Úapply_changesÚdelete_shelfÚ
read_shelfÚ	show_diffs               r   rr   zUnshelver.from_argsz  sv  € õ !Ô,×<Ò<¸YÑGÔG‰
ˆˆdØ×ÒÑÔÐð	Ø×,Ò,Ñ.Ô.ˆGØÐ#ð9Ý" 8™}œ}�H�HøÝ!ð 9ð 9ð 9ÝÔ.¨xÑ8Ô8Ð8ð9øøøð #×-Ò-Ñ/Ô/�ØÐ#Ý Ô-ÝÐ 9Ñ:Ô:ñ<ô <ð <à ˆMØˆLØˆJØˆIØ˜Ò"Ð"Ø %�Ø$��Ø˜9Ò$Ð$Ø %�Ø$�Ø �	�	Ø˜=Ò(Ð(Ø %�Ø"�
�
Ø˜6Ò!Ð!Ø $�Ø$�øøð	Ø�KŠK‰MŒMˆMØøøøØˆu�T˜7 H¨m¸\Ø ¨Mñ;ô ;ð 	;s$   ¸C. ÁA ÁC. ÁA>Á>A/C. Ã.DTFc	                 óž   — || _         |                     ¦   «         }|| _        || _        || _        || _        || _        || _        || _        dS )a³  Constructor.

        :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)	rp   rR   rS   r0   ræ   rç   rè   ré   rå   )	r(   rp   rS   r0   ræ   rç   rè   ré   rå   s	            r   r)   zUnshelver.__init__­  sV   € ð$ ˆŒ	Ø×(Ò(Ñ*Ô*ˆØˆŒØ ˆŒØ*ˆÔØ(ˆÔØ$ˆŒØ"ˆŒØ*ˆÔÐÐr   c                 ó€  — t          j        ¦   «         5 }|                     | j                             ¦   «         ¦  «         | j        �rt          j        t          d¦  «        | j	        z  ¦  «         | j
                             | j	        ¦  «        }|                     |j        ¦  «         |j        �)t          j        t          d¦  «        |j        z  ¦  «         t          j        ¦   «         }|                     ¦   «         }||_        | j        r|                     ¦   «          n2| j        r|                      |¦  «         n|                      |¦  «         | j        rH| j
                             | j	        ¦  «         t          j        t          d¦  «        | j	        z  ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )z!Perform the unshelving operation.zUsing changes with id "%d".NzMessage: %szDeleted changes with id "%d".)Ú
contextlibÚ	ExitStackÚenter_contextrp   r^   rè   r   r/   r   r0   rS   Úget_unshelverÚcallbackr‚   rW   r   r%   Úmake_mergerÚchange_reporterræ   Údo_mergeré   Ú
write_diffÚshow_changesrç   )r(   Ú
exit_stackÚ	unshelverrò   Úmergers        r   r…   zUnshelver.runÉ  sâ  € åÔ!Ñ#Ô#ð 	* zØ×$Ò$ T¤Y×%>Ò%>Ñ%@Ô%@ÑAÔAÐAØŒñ .Ý”
�7Ð#@ÑAÔAØœ=ñ)ñ *ô *ð *à œL×6Ò6°t´}ÑEÔE�	Ø×#Ò# IÔ$6Ñ7Ô7Ð7ØÔ$Ð0Ý”J�w }Ñ5Ô5¸	Ô8IÑIÑJÔJÐJÝ"'Ô"7Ñ"9Ô"9�Ø"×.Ò.Ñ0Ô0�Ø)8�Ô&ØÔ%ð .Ø—O’OÑ%Ô%Ð%Ð%Ø”^ð .Ø—O’O FÑ+Ô+Ð+Ð+à×%Ò% fÑ-Ô-Ð-ØÔ ð *Ø”×)Ò)¨$¬-Ñ8Ô8Ð8Ý”
�7Ð#BÑCÔCØœ=ñ)ñ *ô *ð *ð)	*ð 	*ð 	*ñ 	*ô 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*øøøð 	*ð 	*ð 	*ð 	*ð 	*ð 	*s   ”FF3Æ3F7Æ:F7c                 óh  — |                      ¦   «         }|                     ¦   «         }|                     ¦   «         }| j        €%t          j                             d¬¦  «        | _        t          j        ¦   «         }t          j
        |j        || j        |¬¦  «         |                     ¦   «          dS )z2Write this operation's diff to self.write_diff_to.NÚexact)Úencoding_typerŠ   )rñ   Úmake_preview_transformÚget_preview_treerå   r   rž   Úmake_output_streamr	   Úget_diff_header_encodingr   Úshow_diff_treesÚ	this_treer‚   )r(   rø   Útree_mergerÚttr–   r‹   s         r   rô   zUnshelver.write_diffâ  s©   € à×(Ò(Ñ*Ô*ˆØ×/Ò/Ñ1Ô1ˆØ×&Ò&Ñ(Ô(ˆØÔÐ%Ý!#¤×!AÒ!AØ%ð "Bñ "'ô "'ˆDÔåÔ8Ñ:Ô:ˆÝÔ˜VÔ-¨x¸Ô9KØ+8ð	:ñ 	:ô 	:ð 	:à
�Š‰Œˆˆˆr   c                 ó~   — |                      ¦   «         }|                     ¦   «         }|                     ¦   «          dS )z/Show the changes that this operation specifies.N)rñ   rü   r‚   )r(   rø   r  r  s       r   rõ   zUnshelver.show_changesï  s5   € à×(Ò(Ñ*Ô*ˆà×/Ò/Ñ1Ô1ˆØ
�Š‰Œˆˆˆr   )NrÛ   ra   N)TTTFN)
r   r   r   r   r×   rr   r)   r…   rô   rõ   r   r   r   rÚ   rÚ   w  sŒ   € € € € € Ø/Ð/àØBEØ $ð0;ð 0;ð 0;ñ „[ð0;ðd ?CØ?DØ#ð+ð +ð +ð +ð8*ð *ð *ð2ð ð ðð ð ð ð r   rÚ   )rì   rÐ   r€   rP   ru   Úior   Ú r   r   r   r   r	   r
   r   r   r   r   r   Úi18nr   Ú	Exceptionr   r   rH   rK   rÚ   r   r   r   ú<module>r	     sÌ  ðð" Ð Ð Ð Ø Ð Ð Ð Ø €€€Ø 
€
€
€
Ø €€€à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð Ð Ð Ð Ð Ð ð4ð 4ð 4ð 4ð 4�	ñ 4ô 4ð 4ð1ð 1ð 1ð 1ð 1ñ 1ô 1ð 1ðhð ð ð ð �Mñ ô ð ð(ð ð ð ð ñ ô ð ðD}ð }ð }ð }ð }ñ }ô }ð }ð }ð }r   