§
    cÌcp  ã                   óš   — d Z ddlmZmZmZ ddlmZ ddlmZm	Z	 ddl
mZ  G d„ de¦  «        Z G d	„ d
e¦  «        Z G d„ de	¦  «        ZdS )zFull history branch formats.é   )ÚdebugÚerrorsÚrevision)ÚBranché   )Ú	BzrBranchÚBranchFormatMetadir)Úmutter_callsitec                   óL   ‡ — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zˆ fd„Z		 	 d
d	„Z
ˆ xZS )ÚFullHistoryBzrBranchz4Bzr branch which contains the full revision history.c                 óv  — |rt          |t          ¦  «        st          j        || ¬¦  «        ‚|                      ¦   «         5  |                      |¦  «        }t          |¦  «        |k    r!t          dt          |¦  «        |fz  ¦  «        ‚|                      |¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )N)Úrevision_idÚbranchz%d != %d)	Ú
isinstanceÚbytesr   ÚInvalidRevisionIdÚ
lock_writeÚ_lefthand_historyÚlenÚAssertionErrorÚ_set_revision_history)ÚselfÚrevnor   Úhistorys       ú8/usr/lib/python3/dist-packages/breezy/bzr/fullhistory.pyÚset_last_revision_infoz+FullHistoryBzrBranch.set_last_revision_info'   s  € Øð 	6¥*¨[½%Ñ"@Ô"@ð 	6ÝÔ*Ø'°ð6ñ 6ô 6ð 6à�_Š_ÑÔð 	0ð 	0ð ×,Ò,¨[Ñ9Ô9ˆGÝ�7‰|Œ|˜uÒ$Ð$Ý$ Zµ3°w±<´<ÀÐ2GÑ%GÑHÔHÐHØ×&Ò& wÑ/Ô/Ð/ð	0ð 	0ð 	0ñ 	0ô 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0øøøð 	0ð 	0ð 	0ð 	0ð 	0ð 	0s   ÁAB.Â.B2Â5B2c                 ó|   — |                       ¦   «         }t          |¦  «        }|r
||d         fS dt          j        fS )Néÿÿÿÿé    )Ú_revision_historyr   Ú_mod_revisionÚNULL_REVISION)r   Úrhr   s      r   Ú_read_last_revision_infoz-FullHistoryBzrBranch._read_last_revision_info4   sB   € Ø×#Ò#Ñ%Ô%ˆÝ�B‘”ˆØð 	4Ø˜2˜bœ6�?Ð"à•}Ô2Ð3Ð3ó    c                 ó2  — dt           j        v rt          dd¦  «         t          j        }|D ]} ||¦  «         Œt
          j        d         r|                      ¦   «         \  }}t          |¦  «        dk    rt          j	        }n|d         }|  
                    t          |¦  «        |¦  «         |                      |¦  «         |                      ¦   «          |                      |¦  «         t
          j        d         r|                      ||¦  «         d S d S )NÚevilé   z)set_revision_history scales with history.Úpost_change_branch_tipr   r   )r   Údebug_flagsr
   r!   Úcheck_not_reserved_idr   ÚhooksÚlast_revision_infor   r"   Ú _run_pre_change_branch_tip_hooksÚ_write_revision_historyÚ_clear_cached_stateÚ_cache_revision_historyÚ!_run_post_change_branch_tip_hooks)r   Úrev_historyr+   Úrev_idÚ	old_revnoÚ	old_revidÚrevids          r   r   z*FullHistoryBzrBranch._set_revision_history<   s,  € Ø•UÔ&Ð&Ð&Ý˜AÐJÑKÔKÐKÝ -Ô CÐØ!ð 	*ð 	*ˆFØ!Ð! &Ñ)Ô)Ð)Ð)ÝŒ<Ð0Ô1ð 	=ð $(×#:Ò#:Ñ#<Ô#<Ñ ˆI�yÝˆ{ÑÔ˜qÒ Ð Ý!Ô/ˆEˆEà ”OˆEØ×-Ò-­c°+Ñ.>Ô.>ÀÑFÔFÐFØ×$Ò$ [Ñ1Ô1Ð1Ø× Ò Ñ"Ô"Ð"Ø×$Ò$ [Ñ1Ô1Ð1ÝŒ<Ð0Ô1ð 	IØ×2Ò2°9¸iÑHÔHÐHÐHÐHð	Ið 	Ir%   c                 ó”   — | j                              dd                     |¦  «        | j                             ¦   «         ¬¦  «         dS )z•Factored out of set_revision_history.

        This performs the actual writing to disk.
        It is intended to be called by set_revision_history.úrevision-historyó   
)ÚmodeN)Ú
_transportÚ	put_bytesÚjoinÚ
controldirÚ_get_file_mode©r   r   s     r   r/   z,FullHistoryBzrBranch._write_revision_historyQ   sO   € ð
 	Œ×!Ò!Ø §
¢
¨7Ñ 3Ô 3Ø”×/Ò/Ñ1Ô1ð 	"ñ 	3ô 	3ð 	3ð 	3ð 	3r%   c                 ó¦   — | j                              d¦  «                             d¦  «        }|dd …         dgk    r|                     ¦   «          |S )Nr9   r:   r   r%   )r<   Ú	get_bytesÚsplitÚpoprA   s     r   Ú_gen_revision_historyz*FullHistoryBzrBranch._gen_revision_historyZ   sM   € Ø”/×+Ò+Ð,>Ñ?Ô?×EÒEÀeÑLÔLˆØ�2�3�3Œ<˜C˜5Ò Ð à�KŠK‰MŒMˆMØˆr%   c                 óì  •— t          |t          ¦  «        s+t          t          | ¦  «                             ||¦  «         d S |t
          j        k    rg }n|                      ¦   «         }|�t|g k    rn	 |d |                     |¦  «        dz   …         }nL# t          $ r? | j
                             |¦  «        }|                     | j
        ¦  «        dd …         }Y nw xY w|                     |¦  «         d S )Nr   )r   r   Úsuperr   Ú_synchronize_historyr!   r"   r    ÚindexÚ
ValueErrorÚ
repositoryÚget_revisionÚget_historyr   )r   Údestinationr   Únew_historyÚrevÚ	__class__s        €r   rI   z)FullHistoryBzrBranch._synchronize_historya   s  ø€ Ý˜+Õ';Ñ<Ô<ð 	Ý•)˜TÑ"Ô"×7Ò7Ø˜[ñ*ô *ð *àˆFØ�-Ô5Ò5Ð5ØˆKˆKà×0Ò0Ñ2Ô2ˆKØÐ" {°bÒ'8Ð'8ðCØ)Ð*M¨;×+<Ò+<¸[Ñ+IÔ+IÈAÑ+MÐ*MÔN��øÝð Cð Cð CØ”o×2Ò2°;Ñ?Ô?�Ø!Ÿošo¨d¬oÑ>Ô>¸q¸r¸rÔB���ðCøøøð 	×)Ò)¨+Ñ6Ô6Ð6Ð6Ð6s   Á2 B ÂACÃCNc                 ó´   — |                       ¦   «         5  |                      |                      |||¦  «        ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )aƒ  Create a new revision history that will finish with revision_id.

        :param revision_id: the new tip to use.
        :param last_rev: The previous last_revision. If not None, then this
            must be a ancestory of revision_id, or DivergedBranches is raised.
        :param other_branch: The other branch that DivergedBranches should
            raise with respect to.
        N)r   r   r   )r   r   Úlast_revÚother_branchs       r   Úgenerate_revision_historyz.FullHistoryBzrBranch.generate_revision_historyr   sÂ   € ð �_Š_ÑÔð 	Wð 	WØ×&Ò& t×'=Ò'=¸kØ>FÈñ(Vô (Vñ Wô Wð Wð	Wð 	Wð 	Wñ 	Wô 	Wð 	Wð 	Wð 	Wð 	Wð 	Wð 	Wð 	Wøøøð 	Wð 	Wð 	Wð 	Wð 	Wð 	Ws   •+AÁAÁA)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r$   r   r/   rF   rI   rV   Ú__classcell__)rR   s   @r   r   r   $   s±   ø€ € € € € Ø>Ð>ð0ð 0ð 0ð4ð 4ð 4ðIð Ið Ið*3ð 3ð 3ðð ð ð7ð 7ð 7ð 7ð 7ð" ?CØ/3ðWð Wð Wð Wð Wð Wð Wð Wr%   r   c                   ó   — e Zd ZdZdS )Ú
BzrBranch5z•A format 5 branch. This supports new features over plain branches.

    It has support for a master_branch which is the data for bound branches.
    N)rW   rX   rY   rZ   © r%   r   r]   r]   �   s   € € € € € ðð ð ð r%   r]   c                   óJ   — e Zd ZdZd„ Zed„ ¦   «         Zd„ Z	 	 d	d„Zd„ Z	dZ
dS )
ÚBzrBranchFormat5a  Bzr branch format 5.

    This format has:
     - a revision-history file.
     - a format string
     - a lock dir guarding the branch itself
     - all of this stored in a branch/ subdirectory
     - works with shared repositories.

    This format is new in bzr 0.8.
    c                 ó   — t           S )N)r]   ©r   s    r   Ú_branch_classzBzrBranchFormat5._branch_class•   s   € ÝÐr%   c                 ó   — dS )z%See BranchFormat.get_format_string().s   Bazaar-NG branch format 5
r^   )Úclss    r   Úget_format_stringz"BzrBranchFormat5.get_format_string˜   s
   € ð .Ð-r%   c                 ó   — dS )z*See BranchFormat.get_format_description().zBranch format 5r^   rb   s    r   Úget_format_descriptionz'BzrBranchFormat5.get_format_description�   s   € à Ð r%   Nc                 óp   — |rt          j        |j        ¦  «        ‚ddg}|                      ||||¦  «        S )z/Create a branch of this format in a_controldir.)r9   r%   )zbranch-namer%   )r   ÚUpgradeRequiredÚuser_urlÚ_initialize_helper)r   Úa_controldirÚnamerL   Úappend_revisions_onlyÚ
utf8_filess         r   Ú
initializezBzrBranchFormat5.initialize¡   sJ   € ð !ð 	@ÝÔ(¨Ô)>Ñ?Ô?Ð?Ø/Ø*ðˆ
ð ×&Ò& |°ZÀÀzÑRÔRÐRr%   c                 ó   — dS )NFr^   rb   s    r   Úsupports_tagszBzrBranchFormat5.supports_tags«   s   € Øˆur%   F)NNN)rW   rX   rY   rZ   rc   Úclassmethodrf   rh   rq   rs   Úsupports_reference_locationsr^   r%   r   r`   r`   ˆ   s‹   € € € € € ð
ð 
ðð ð ð ð.ð .ñ „[ð.ð!ð !ð !ð >BØ)-ðSð Sð Sð Sðð ð ð $)Ð Ð Ð r%   r`   N)rZ   Ú r   r   r   r!   r   r   r   r	   Útracer
   r   r]   r`   r^   r%   r   ú<module>rx      s4  ðð" #Ð "ðð ð ð ð ð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ð ð ð
 $Ð #Ð #Ð #Ð #Ð #ðZWð ZWð ZWð ZWð ZW˜9ñ ZWô ZWð ZWðzð ð ð ð Ð%ñ ô ð ð&)ð &)ð &)ð &)ð &)Ð*ñ &)ô &)ð &)ð &)ð &)r%   