§
    cÌcí  ã                   óš   — d Z ddlmZmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZmZmZ ddlmZ  G d„ d	e¦  «        Z G d
„ de¦  «        ZdS )z!Weave-era branch implementations.é   )Ú
controldirÚerrorsÚlockable_files)Úonly_raises)ÚLogicalLockResult)Úmutter)ÚBindingUnsupportedÚBranchFormatÚBranchWriteLockResult)ÚFullHistoryBzrBranchc                   óŒ   — e Zd ZdZdd„Zd„ Z eej        ej	        ¦  «        d„ ¦   «         Z
dd„Zd„ Zd	„ Zd
„ Zd„ Zd„ Zdd„ZdS )Ú
BzrBranch4zBranch format 4.Nc                 óV  — |                       ¦   «         s|                      d¦  «         | j                             | ¦  «         | j                             ¦   «          	 t          | j        | j                             |¬¦  «        ¦  «        S #  | j                             ¦   «          ‚ xY w)z¿Lock the branch for write operations.

        :param token: A token to permit reacquiring a previously held and
            preserved lock.
        :return: A BranchWriteLockResult.
        Úw)Útoken)Ú	is_lockedÚ
_note_lockÚ
repositoryÚ_warn_if_deprecatedÚ
lock_writer   ÚunlockÚcontrol_files)Úselfr   s     úA/usr/lib/python3/dist-packages/breezy/plugins/weave_fmt/branch.pyr   zBzrBranch4.lock_write,   s§   € ð �~Š~ÑÔð 	!Ø�OŠO˜CÑ Ô Ð àŒ×+Ò+¨DÑ1Ô1Ð1ØŒ×"Ò"Ñ$Ô$Ð$ð	Ý(¨¬Ø)-Ô);×)FÒ)FÈUÐ)FÑ)SÔ)SñUô Uð Uøð	ØŒO×"Ò"Ñ$Ô$Ð$Øøøøs   Á-B ÂB(c                 óT  — |                       ¦   «         s|                      d¦  «         | j                             | ¦  «         | j                             ¦   «          	 | j                             ¦   «          t          | j        ¦  «        S #  | j                             ¦   «          ‚ xY w)z`Lock the branch for read operations.

        :return: A breezy.lock.LogicalLockResult.
        Úr)r   r   r   r   Ú	lock_readr   r   r   ©r   s    r   r   zBzrBranch4.lock_read?   sœ   € ð
 �~Š~ÑÔð 	!Ø�OŠO˜CÑ Ô Ð àŒ×+Ò+¨DÑ1Ô1Ð1ØŒ×!Ò!Ñ#Ô#Ð#ð	ØÔ×(Ò(Ñ*Ô*Ð*Ý$ T¤[Ñ1Ô1Ð1øð	ØŒO×"Ò"Ñ$Ô$Ð$Øøøøs   Á,B ÂB'c                 óÂ  — | j         j        dk    r | j        �| j                             ¦   «          	 | j                              ¦   «          | j                             ¦   «          | j                              ¦   «         s|                      ¦   «          d S d S # | j                             ¦   «          | j                              ¦   «         s|                      ¦   «          w w xY w)Né   )r   Ú_lock_countÚ
conf_storeÚsave_changesr   r   r   Ú_clear_cached_stater   s    r   r   zBzrBranch4.unlockP   sâ   € àÔÔ)¨QÒ.Ð.°4´?Ð3NØŒO×(Ò(Ñ*Ô*Ð*ð	+ØÔ×%Ò%Ñ'Ô'Ð'ð ŒO×"Ò"Ñ$Ô$Ð$ØÔ%×/Ò/Ñ1Ô1ð +à×(Ò(Ñ*Ô*Ð*Ð*Ð*ð+ð +øð ŒO×"Ò"Ñ$Ô$Ð$ØÔ%×/Ò/Ñ1Ô1ð +à×(Ò(Ñ*Ô*Ð*Ð*ð+øøøs   ²B ÂA	CFc                 ó¶   — ddl m} ddlm}  |¦   «         }|r1|                     | j        ¦  «         | j        j        j        |_        n |¦   «         |_        |S )zHReturn the most suitable metadir for a checkout of this branch.
        é   )ÚRepositoryFormat7r   )ÚBzrDirMetaFormat1)r   r'   Ú
bzr.bzrdirr(   Úset_branch_formatÚ_formatr   Úrepository_format)r   Úlightweightr'   r(   Úformats        r   Ú_get_checkout_formatzBzrBranch4._get_checkout_format]   s}   € ð 	2Ð1Ð1Ð1Ð1Ð1Ø3Ð3Ð3Ð3Ð3Ð3Ø"Ð"Ñ$Ô$ˆØð 	;Ø×$Ò$ T¤\Ñ2Ô2Ð2Ø'+¤Ô'>Ô'PˆFÔ$Ð$à'8Ð'8Ñ':Ô':ˆFÔ$Øˆó    c                 ó4   — t          j        | j        ¦  «        ‚©N)r   ÚUpgradeRequiredÚuser_urlr   s    r   ÚunbindzBzrBranch4.unbindj   s   € ÝÔ$ T¤]Ñ3Ô3Ð3r0   c                 ó    — t          | ¦  «        ‚r2   )r	   )r   Úothers     r   ÚbindzBzrBranch4.bindm   s   € Ý  Ñ&Ô&Ð&r0   c                 ó*   — t          | j        ¦  «        ‚r2   )ÚNotImplementedErrorÚset_bound_location)r   Úlocations     r   r;   zBzrBranch4.set_bound_locationp   s   € Ý! $Ô"9Ñ:Ô:Ð:r0   c                 ó   — d S r2   © r   s    r   Úget_bound_locationzBzrBranch4.get_bound_locations   ó   € Øˆtr0   c                 ó   — d S r2   r>   r   s    r   ÚupdatezBzrBranch4.updatev   r@   r0   c                 ó   — d S r2   r>   )r   Úpossible_transportss     r   Úget_master_branchzBzrBranch4.get_master_branchy   r@   r0   r2   )F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   ÚLockNotHeldÚ
LockBrokenr   r/   r5   r8   r;   r?   rB   rE   r>   r0   r   r   r   )   sÞ   € € € € € ØÐðð ð ð ð&ð ð ð" €[�Ô# VÔ%6Ñ7Ô7ð
+ð 
+ñ 8Ô7ð
+ðð ð ð ð4ð 4ð 4ð'ð 'ð 'ð;ð ;ð ;ðð ð ðð ð ðð ð ð ð ð r0   r   c                   óV   ‡ — e Zd ZdZ	 	 dd„Zˆ fd„Zd„ Zd„ Z	 	 dd„Zd	„ Z	d
„ Z
dZˆ xZS )ÚBzrBranchFormat4z±Bzr branch format 4.

    This format has:
     - a revision-history file.
     - a branch-lock lock file [ to be shared with the bzrdir ]

    It does not support binding.
    Nc                 ó6  ‡— |rt          j        ‰j        ¦  «        ‚|�"t          d                     | ¦  «        ¦  «        ‚ˆfd„| j        D ¦   «         st          j        | ‰j        ¦  «        ‚ddg}t          d| ‰j        ¦  «         ‰ 	                    | |¬¦  «        }t          j        |dt          j        ¦  «        }|                     ¦   «          	 |                     ¦   «          d	}n# t           j        $ r d
}Y nw xY w	 |D ]/\  }	}
|                     |	|
‰                     ¦   «         ¬¦  «         Œ0	 |r|                     ¦   «          n# |r|                     ¦   «          w w xY w|                      ‰|d	d¬¦  «        }|                      ‰||¦  «         |S )züCreate a branch of this format in a_controldir.

        :param a_controldir: The bzrdir to initialize the branch in
        :param name: Name of colocated branch to create, if any
        :param repository: Repository for this branch (unused)
        Nz)initialize(repository=<not None>) on {!r}c                 ó:   •— g | ]}t          ‰j        |¦  «        ‘ŒS r>   )Ú
isinstancer+   )Ú.0r.   Úa_controldirs     €r   ú
<listcomp>z/BzrBranchFormat4.initialize.<locals>.<listcomp>”   s2   ø€ ð *ð *ð *¸V•
˜<Ô/°Ñ8Ô8ð *ð *ð *r0   )zrevision-historyr0   )zbranch-namer0   zcreating branch %r in %s)Únamezbranch-lockTF)Úmode)Ú_foundÚfound_repository)r   r3   r4   r:   r.   Ú_compatible_bzrdirsÚIncompatibleFormatr+   r   Úget_branch_transportr   ÚLockableFilesÚTransportLockÚcreate_lockr   ÚLockContentionÚ	put_bytesÚ_get_file_moder   ÚopenÚ_run_post_branch_init_hooks)r   rR   rT   r   Úappend_revisions_onlyÚ
utf8_filesÚbranch_transportr   Ú
lock_takenÚfilenameÚcontentÚbranchs    `          r   Ú
initializezBzrBranchFormat4.initialize‡   s"  ø€ ð !ð 	@ÝÔ(¨Ô)>Ñ?Ô?Ð?ØÐ!Ý%Ø;×BÒBÀ4ÑHÔHñJô Jð Jð*ð *ð *ð *ØÔ(ð*ñ *ô *ð 	HåÔ+¨D°,Ô2FÑGÔGÐGØ/Ø*ðˆ
õ 	Ð)¨4°Ô1FÑGÔGÐGØ'×<Ò<¸TÈÐ<ÑMÔMÐÝ&Ô4Ð5EØ5BÅNÔD`ñbô bˆà×!Ò!Ñ#Ô#Ð#ð	Ø×$Ò$Ñ&Ô&Ð&ð ˆJˆJøõ Ô$ð 	ð 	ð 	ØˆJˆJˆJð	øøøð	'Ø'1ð 8ð 8Ñ#�˜7Ø ×*Ò*Ø˜gØ%×4Ò4Ñ6Ô6ð +ñ 8ô 8ð 8ð 8ð8ð
 ð 'Ø×$Ò$Ñ&Ô&Ð&øøð ð 'Ø×$Ò$Ñ&Ô&Ð&Ð&ð'øøøà—’˜<¨°dØ,0ð ñ 2ô 2ˆà×(Ò(¨°t¸VÑDÔDÐDØˆs   ÃC+ Ã+C?Ã>C?Ä2E ÅE&c                 óŽ   •— t          ¦   «                              ¦   «          ddlm}m}m}  |¦   «         | _        |||g| _        d S )Nr&   )ÚBzrDirFormat4ÚBzrDirFormat5ÚBzrDirFormat6)ÚsuperÚ__init__Úbzrdirrl   rm   rn   Ú_matchingcontroldirrX   )r   rl   rm   rn   Ú	__class__s       €r   rp   zBzrBranchFormat4.__init__²   ss   ø€ Ý‰Œ×ÒÑÔÐð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð $1 =¡?¤?ˆÔ Ø$1°=Ø$1ð$3ˆÔ Ð Ð r0   c                 ó4   — | j                              ¦   «         S )z@The network name for this format is the control dirs disk label.)rr   Úget_format_stringr   s    r   Únetwork_namezBzrBranchFormat4.network_name»   s   € àÔ'×9Ò9Ñ;Ô;Ð;r0   c                 ó   — dS )NzBranch format 4r>   r   s    r   Úget_format_descriptionz'BzrBranchFormat4.get_format_description¿   s   € Ø Ð r0   Fc                 óÔ   — |€|                      ¦   «         }|dk    rt          j        | ¦  «        ‚|st          ‚|€|                     ¦   «         }t          | |j        ||||¬¦  «        S )zSee BranchFormat.open().NÚ )r+   Ú_control_filesrR   rT   Ú_repositoryrD   )Ú_get_selected_branchÚ_mod_controldirÚNoColocatedBranchSupportr:   Úopen_repositoryr   r{   )r   rR   rT   rV   Úignore_fallbacksrW   rD   s          r   ra   zBzrBranchFormat4.openÂ   s‰   € ð ˆ<Ø×4Ò4Ñ6Ô6ˆDØ�2Š:ˆ:Ý!Ô:¸4Ñ@Ô@Ð@Øð 	&å%Ð%ØÐ#Ø+×;Ò;Ñ=Ô=ÐÝ $Ø)5Ô)DØ'3Ø#Ø&6Ø.AðCñ Cô Cð 	Cr0   c                 ó   — dS )NzBazaar-NG branch format 4r>   r   s    r   Ú__str__zBzrBranchFormat4.__str__Õ   s   € Ø*Ð*r0   c                 ó   — dS )NFr>   r   s    r   Úsupports_leaving_lockz&BzrBranchFormat4.supports_leaving_lockØ   s   € Øˆur0   )NNN)NFFNN)rF   rG   rH   rI   rj   rp   rv   rx   ra   rƒ   r…   Úsupports_reference_locationsÚ__classcell__)rs   s   @r   rM   rM   }   s¾   ø€ € € € € ðð ð >BØ)-ð)ð )ð )ð )ðV3ð 3ð 3ð 3ð 3ð<ð <ð <ð!ð !ð !ð LQØ8<ðCð Cð Cð Cð&+ð +ð +ðð ð ð $)Ð Ð Ð Ð Ð r0   rM   N)rI   rz   r   r~   r   r   Ú
decoratorsr   Úlockr   Útracer   ri   r	   r
   r   Úbzr.fullhistoryr   r   rM   r>   r0   r   ú<module>rŒ      sE  ðð" (Ð 'ðð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð &Ð %Ð %Ð %Ð %Ð %Ø Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð
ð ð ð ð ð ð
Qð Qð Qð Qð QÐ%ñ Qô Qð Qðh^)ð ^)ð ^)ð ^)ð ^)�|ñ ^)ô ^)ð ^)ð ^)ð ^)r0   