§
    cÌc@= ã                   óz  — d Z ddlZddlZddlmZmZmZ ddlmZ  e e¦   «         d¦  «         ddl	m
Z
mZmZ ddlmZmZmZmZmZ dd	lmZmZ erd
dlmZ  G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ de¦  «        Z G d„ d¦  «        Z G d„ deej        ¦  «        Z  G d„ de ¦  «        Z! G d„ de!¦  «        Z" G d„ dej#        ¦  «        Z$ G d„ dej#        ¦  «        Z% G d „ d!ej&        ¦  «        Z' G d"„ d#ej&        ¦  «        Z( e!¦   «         ej        _)        dS )$a‹  BzrDir logic. The BzrDir is the basic control directory used by bzr.

At format 7 this was split out into Branch, Repository and Checkout control
directories.

Note: This module has a lot of ``open`` functions/methods that return
references to in-memory objects. As a rule, there are no matching ``close``
methods. To free any associated resources, simply stop referencing the
objects returned.
é    N)ÚSetÚTYPE_CHECKINGÚcasté   )Úlazy_importa�  
from breezy import (
    branch as _mod_branch,
    lockable_files,
    osutils,
    repository,
    revision as _mod_revision,
    ui,
    urlutils,
    win32utils,
    )
from breezy.bzr import (
    branch as _mod_bzrbranch,
    fetch,
    fullhistory as fullhistorybranch,
    knitpack_repo,
    remote,
    vf_search,
    workingtree_3,
    workingtree_4,
    )
from breezy.i18n import gettext
)ÚmutterÚnoteÚwarning)ÚconfigÚ
controldirÚerrorsÚlockdirÚ	transport)Údo_catching_redirectionsÚlocalé   )Ú	BzrBranchc                   ó   — e Zd ZdZd„ ZdS )ÚMissingFeaturezQMissing feature %(feature)s not provided by this version of Breezy or any plugin.c                 ó   — || _         d S ©N©Úfeature©Úselfr   s     ú3/usr/lib/python3/dist-packages/breezy/bzr/bzrdir.pyÚ__init__zMissingFeature.__init__T   ó   € ØˆŒˆˆó    N©Ú__name__Ú
__module__Ú__qualname__Ú_fmtr   © r   r   r   r   O   s*   € € € € € ð/€Dðð ð ð ð r   r   c                   ó   — e Zd ZdZd„ ZdS )ÚFeatureAlreadyRegisteredz4The feature %(feature)s has already been registered.c                 ó   — || _         d S r   r   r   s     r   r   z!FeatureAlreadyRegistered.__init__\   r   r   Nr    r%   r   r   r'   r'   X   s(   € € € € € àA€Dðð ð ð ð r   r'   c                   ó  — e Zd ZdZd„ Zd„ Z	 	 	 	 d%d„Zd„ Z	 	 d&d	„Zd
„ Z	d„ Z
	 	 	 	 	 d'd„Zd„ Zd„ Zd(d„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zed„ ¦   «         Zed„ ¦   «         Zd„ Zd)d„Zd*d„Zd„ Zd „ Zed+d,d"„¦   «         Z d#„ Z!d$„ Z"dS )-ÚBzrDira   A .bzr control diretory.

    BzrDir instances let you create or open any of the things that can be
    found within .bzr - checkouts, branches and repositories.

    :ivar transport:
        the transport which this bzr dir is rooted at (i.e. file:///.../.bzr/)
    :ivar root_transport:
        a transport connected to the directory this bzr was opened from
        (i.e. the parent directory holding the .bzr directory).

    Everything in the bzrdir should have the same file permissions.

    :cvar hooks: An instance of BzrDirHooks.
    c                 óN  — 	 |                       ¦   «         }nz# t          j        t          j        f$ r\ 	 |                      ¦   «         }nC# t          j        $ r1 	 |                      ¦   «         }n# t          j        $ r Y Y Y dS w xY wY nw xY wY nw xY w|                     ¦   «          dS )zÂInvoke break_lock on the first object in the bzrdir.

        If there is a tree, the tree is opened and break_lock() called.
        Otherwise, branch is tried, and finally repository.
        N)	Úopen_workingtreer   ÚNotLocalUrlÚNoWorkingTreeÚopen_branchÚNotBranchErrorÚopen_repositoryÚNoRepositoryPresentÚ
break_lock)r   Úthing_to_unlocks     r   r3   zBzrDir.break_lockq   sÚ   € ð		Ø"×3Ò3Ñ5Ô5ˆOˆOøÝÔ"¥FÔ$8Ð9ð 	ð 	ð 	ðØ"&×"2Ò"2Ñ"4Ô"4��øÝÔ(ð ð ð ðØ&*×&:Ò&:Ñ&<Ô&<�O�OøÝÔ1ð ð ð Ø�F�F�F�Fðøøøð $�Oðøøøøøð	øøøð 	×"Ò"Ñ$Ô$Ð$Ð$Ð$s\   ‚ —B³AÁBÁBÁA-Á,BÁ-BÁ<BÁ=BÂBÂBÂBÂBÂBÂBc                 óš   — |j         }	 |                      ¦   «         j                             |¦  «         dS # t          j        $ r Y dS w xY w)z@Check that a bzrdir as a whole can be converted to a new format.N)Úrepository_formatr1   Ú_formatÚcheck_conversion_targetr   r2   )r   Útarget_formatÚtarget_repo_formats      r   r8   zBzrDir.check_conversion_target…   sk   € ð +Ô<Ðð	Ø× Ò Ñ"Ô"Ô*×BÒBØ"ñ$ô $ð $ð $ð $øåÔ)ð 	ð 	ð 	àˆDˆDð	øøøs   ‰,7 ·A
Á	A
NFTc
                 ód  — |du}
|                       |
¦  «        }	 |                      ¦   «         }n# t          j        $ r d}Y nw xY w|                      ¦   «         }	 |d         }|j                             |¦  «        r|j        }|rB	 |                     ¦   «         }n=# t          j	        t          j
        t          j        f$ r Y nw xY wn# t          $ r Y nw xY w|rE|                     ¦   «         o| }|                     ¦   «         }|j                             ¦   «         }nd}d}d}|                     |||||| j        j        |||¬¦	  «	        \  }}}
}|rŽ	 |j        |j        k    r8|
s6|�4t*                               |g|¦  «        }|                     ||¬¦  «         n|                     ||¬¦  «         |                     ¦   «          n-# |                     ¦   «          w xY w|�t3          d|z  ¦  «        ‚|                     ¦   «         D ]'\  }}|                     ||dk    rdn||||	¬¦  «         Œ(	 |j                             d	¦  «         |�|                     ¦   «         r)|                      ¦   «                              ||¬¦  «         n!# t          j        t          j        f$ r Y nw xY w|S )
a¯  Clone this bzrdir and its contents to transport verbatim.

        :param transport: The transport for the location to produce the clone
            at.  If the target directory does not exist, it will be created.
        :param revision_id: The tip revision-id to use for any branch or
            working tree.  If not None, then the clone operation may tune
            itself to download less data.
        :param force_new_repo: Do not use a shared repository for the target,
                               even if one is available.
        :param preserve_stacking: When cloning a stacked branch, stack the
            new branch on top of the other branch's stacked-on branch.
        :param create_prefix: Create any missing directories leading up to
            to_transport.
        :param use_existing_dir: Use an existing directory if one exists.
        :param no_tree: If set to true prevents creation of a working tree.
        NÚ F©Úuse_existing_dirÚcreate_prefixÚforce_new_repoÚ
stacked_onÚstack_on_pwdÚrepo_format_nameÚmake_working_treesÚshared_repo©Ú
fetch_spec)Úrevision_idzresult_repo not None(%r))rH   Úrepository_policyÚnameÚtag_selectorú.) Úcloning_metadirÚfind_repositoryr   r2   Úget_branchesÚ
repositoryÚhas_same_locationÚget_stacked_on_urlÚ_mod_branchÚUnstackableBranchFormatÚUnstackableRepositoryFormatÚ
NotStackedÚKeyErrorrD   Ú	is_sharedr6   Únetwork_nameÚinitialize_on_transport_exÚroot_transportÚbaseÚuser_urlÚ	vf_searchÚPendingAncestryResultÚfetchÚunlockÚAssertionErrorÚitemsÚcloneÚlocal_abspathr,   r.   r-   )r   r   rH   r@   Úpreserve_stackingrA   r?   r>   Úno_treerK   Úrequire_stackingÚformatÚ
local_repoÚlocal_branchesÚlocal_active_branchrD   Úwant_sharedrC   Úresult_repoÚresultrI   rG   rJ   Úlocal_branchs                           r   Úclone_on_transportzBzrDir.clone_on_transport‘   s  € ð2 '¨dÐ2ÐØ×%Ò%Ð&6Ñ7Ô7ˆð	Ø×-Ò-Ñ/Ô/ˆJˆJøÝÔ)ð 	ð 	ð 	ØˆJˆJˆJð	øøøà×*Ò*Ñ,Ô,ˆð	Ø"0°Ô"4Ðð
 #Ô-×?Ò?À
ÑKÔKð <Ø0Ô;�
Ø ð ðØ!4×!GÒ!GÑ!IÔ!I�J�JøÝ#Ô;ÝÔ:ÝÔ)ð+ð ð ð ð �Dðøøøðøõ ð 	ð 	ð 	ØˆDð	øøøð  ð 	$Ø",×"?Ò"?Ñ"AÔ"Að #.Ø&- +ð à$×.Ò.Ñ0Ô0ˆKØ%Ô7×DÒDÑFÔFÐÐà!&ÐØˆKØ#Ðð ×-Ò-ØÐ,<Ø+¸NØ%°DÔ4GÔ4LØ!1Ø#5À;ð .ñ Pô Pñ 	Aˆ�VÐ-Ð/@ð ð 	Oð%ð  Ô(¨F¬OÒ;Ð;Ø,ð <à'Ð3Ý!*×!@Ò!@Ø$˜ zñ"3ô "3�Jà×%Ò% j¸ZÐ%ÑHÔHÐHÐHà×%Ò% j¸kÐ%ÑJÔJÐJà×"Ò"Ñ$Ô$Ð$Ð$ø�×"Ò"Ñ$Ô$Ð$Ð$øøøàÐ&Ý$Ð%?À+Ñ%MÑNÔNÐNð #1×"6Ò"6Ñ"8Ô"8ð 	6ð 	6ÑˆD�,Ø×ÒØ¨T°RªZ¨Z T T¸[Ø"3Ø¨ð ñ 6ô 6ð 6ð 6ð	ð Ô!×/Ò/°Ñ4Ô4Ð4ØÐ" k×&DÒ&DÑ&FÔ&FÐ"Ø×%Ò%Ñ'Ô'×-Ò-¨fÀ+Ð-ÑNÔNÐNøøÝÔ$¥fÔ&8Ð9ð 	ð 	ð 	ØˆDð	øøøàˆsS   ›0 °AÁAÁC
 ÂB Â&CÃCÃ

CÃCÅAG ÇG!È5AJ ÊJ-Ê,J-c                 óV   — t          j        |¦  «        }|                     ¦   «          d S r   )Ú_mod_transportÚget_transportÚensure_base)r   ÚurlÚts      r   Ú
_make_tailzBzrDir._make_tailÿ   s#   € ÝÔ(¨Ñ-Ô-ˆØ	�Š‰Œˆˆˆr   c                 óê   ‡ ‡— ˆˆ fd„}|sW|€‰                       |¦  «        }|�|S n;	 t          ‰                      ¦   «         ||‰¬¦  «        S # t          j        $ r Y nw xY wt          ‰ ||‰¬¦  «        S )aS  Return an object representing a policy to use.

        This controls whether a new repository is created, and the format of
        that repository, or some existing shared repository used instead.

        If stack_on is supplied, will not seek a containing shared repo.

        :param force_new_repo: If True, require a new repository to be created.
        :param stack_on: If supplied, the location to stack on.  If not
            supplied, a default_stack_on location may be used.
        :param stack_on_pwd: If stack_on is relative, the location it is
            relative to.
        c                 ó|  •— d }d }|                       ¦   «         }d} |j        ¦   «         }|�	| j        }d}	 |                      ¦   «         }| j        ‰j        k    r|                     ¦   «         sd }d}nd}n# t
          j        $ r d }Y nw xY w|sdS |rt          |||‰¬¦  «        dfS t          ‰||‰¬¦  «        dfS )NFT©NF©rh   )	Ú
get_configÚget_default_stack_onr]   r1   rX   r   r2   ÚUseExistingRepositoryÚCreateRepository)Úfound_bzrdirÚstack_onrB   r   ÚstoprP   rh   r   s         €€r   rI   z=BzrDir.determine_repository_policy.<locals>.repository_policy  s+  ø€ ØˆHØˆLØ!×,Ò,Ñ.Ô.ˆFØˆDØ2�vÔ2Ñ4Ô4ˆHØÐ#Ø+Ô4�Ø�ð Ø)×9Ò9Ñ;Ô;�
ð !Ô)¨T¬]Ò:Ð:Ø&×0Ò0Ñ2Ô2ð ;ð "&�JØ�D�Dà�D�Døõ Ô-ð "ð "ð "Ø!�
�
�
ð"øøøð ð #Ø"�{Øð =Ý,Ø ¨,Ø%5ð7ñ 7ô 7à8<ð=ð =õ (Ø˜( LØ%5ð7ñ 7ô 7à8<ð=ð =s   ·A7 Á7BÂ
BNr|   )Ú_find_containingr   r1   r   r2   r€   )r   r@   r‚   rB   rh   rI   Úpolicys   `   `  r   Údetermine_repository_policyz"BzrDir.determine_repository_policy  sÒ   øø€ ð	=ð 	=ð 	=ð 	=ð 	=ð 	=ðB ð 	ØÐØ×.Ò.Ð/@ÑAÔA�ØÐ%Ø!�Mð &ðÝ0Ø×,Ò,Ñ.Ô.°¸,Ø)9ð;ñ ;ô ;ð ;øõ Ô1ð ð ð Ø�Dðøøøå  h°Ø1AðCñ Cô Cð 	Cs   ¨$A ÁAÁAc                 ó`   — |                       |¦  «        }|                     ¦   «         d         S )z<Create a new repository if needed, returning the repository.r   )r†   Úacquire_repository)r   r@   r…   s      r   Ú_find_or_create_repositoryz!BzrDir._find_or_create_repositoryB  s,   € à×1Ò1°.ÑAÔAˆØ×(Ò(Ñ*Ô*¨1Ô-Ð-r   c                 óÌ  — |�0|                      |                     ¦   «         ¦  «         ||j        fS 	 |                      ¦   «         }|j        }|                      |                     ¦   «         ¦  «         nk# t          j        $ rY d}	 |                      ¦   «         }|                      |                     ¦   «         ¦  «         n# t          j        $ r d}Y nw xY wY nw xY w||fS )aB  Find the source branch and repo for a sprout operation.

        This is helper intended for use by _sprout.

        :returns: (source_branch, source_repository).  Either or both may be
            None.  If not None, they will be read-locked (and their unlock(s)
            scheduled via the exit_stack param).
        N)Úenter_contextÚ	lock_readrP   r/   r   r0   r1   r2   )r   Ú
exit_stackÚsource_branchÚsource_repositorys       r   Ú_find_source_repozBzrDir._find_source_repoG  s   € ð Ð$Ø×$Ò$ ]×%<Ò%<Ñ%>Ô%>Ñ?Ô?Ð?Ø  -Ô":Ð:Ð:ð	@Ø ×,Ò,Ñ.Ô.ˆMØ -Ô 8Ðð ×$Ò$ ]×%<Ò%<Ñ%>Ô%>Ñ?Ô?Ð?Ð?øõ Ô$ð 	Hð 	Hð 	HØ ˆMðHØ$(×$8Ò$8Ñ$:Ô$:Ð!ð ×(Ò(Ð):×)DÒ)DÑ)FÔ)FÑGÔGÐGÐGøõ Ô-ð )ð )ð )Ø$(Ð!Ð!Ð!ð)øøøøøð		Høøøð Ð/Ð/Ð/s5   ´A7 Á7CÂ	CÂ(CÃCÃCÃCÃCÃCÚdownc           	      óà	  — t          j        ¦   «         5 }t                               ¦   «         }|�|                     |g¦  «         ||_        |€g }nt          |¦  «        | j        gz   }t          j	        ||¦  «        }| 
                    ¦   «          |                      |¦  «        }	 t          j                             |¦  «        }n*# t          j        $ r |                     |¦  «        }Y nw xY w|                      ||	¦  «        \  }	}|	|_        |r|	�| j        j        }nd}|                     |||¬¦  «        }|                     |¬¦  «        \  }}|                     |                     ¦   «         ¦  «         ||_        ||_        |st7          |j        ¦  «        dk    rt          j        j        }n%|rt          j        j        }nt          j        j         }||_!        |�+| "                    ¦   «         }|                     ||¬¦  «         |	€,| #                    ¦   «         }|�| $                    |¦  «         n|	 %                    ||||¬¦  «        }tM          d '                    |¦  «        ¦  «         |
�r| (                    ¦   «         sótS          |tT          j+        ¦  «        rÙ|�| ,                    ¦   «         rÃ| -                    d|¬	¦  «        j.        |j.        k    rž| /                    |||¬
¦  «        }|                     ¦   «         5  | 0                    d¦  «        sD	 | 1                    | j2         3                    d¦  «        ¦  «         n# t          j4        $ r Y nw xY wddd¦  «         n# 1 swxY w Y   nd}|dk    �rHd}|�>|}| 5                    ¦   «         }|                     | 6                    ¦   «         ¦  «         n1|�| 5                    ¦   «         x}}n|	�|	 5                    ¦   «         x}}|�<|                     | 6                    ¦   «         ¦  «         | 7                    ¦   «         }ng }|D ]’}tp           9                    |tp           :                    |¦  «        ¦  «        }| ;                    |||¬¦  «        }|€ty          d|¦  «         Œ`|j         %                    || =                    |¦  «        |||¬¦  «         Œ“|cddd¦  «         S # 1 swxY w Y   dS )a‚  Create a copy of this controldir prepared for use as a new line of
        development.

        If url's last component does not exist, it will be created.

        Attributes related to the identity of the source branch like
        branch nickname will be cleaned, a working tree is created
        whether one existed before or not; and a local branch is always
        created.

        if revision_id is not None, then the clone operation may tune
            itself to download less data.

        :param accelerator_tree: A tree which can be used for retrieving file
            contents more quickly than the revision tree, i.e. a workingtree.
            The revision tree will be used for cases where accelerator_tree's
            content is different.
        :param hardlink: If true, hard-link files from accelerator_tree,
            where possible.
        :param stacked: If true, create a stacked branch referring to the
            location of this control directory.
        :param create_tree_if_local: If true, a working-tree will be created
            when working locally.
        :return: The created control directory
        Nr|   ©Úpossible_transportsr   rF   )rH   rI   rP   zcreated new branch {!r}r<   )rJ   r”   )Úaccelerator_treeÚhardlinkÚfrom_branchr‘   )Úbranchr”   z1Ignoring nested tree %s, parent location unknown.)r@   ÚrecurseÚstacked)>Ú
contextlibÚ	ExitStackr`   ÚFetchSpecFactoryÚadd_revision_idsÚsource_branch_stop_revision_idÚlistr[   rs   rt   ru   rM   r   Ú
ControlDirÚopen_from_transportr   r0   Úinitialize_on_transportr�   rŽ   r\   r†   rˆ   r‹   Ú
lock_writeÚsource_repoÚtarget_repoÚlenÚ_fallback_repositoriesÚTargetRepoKindsÚSTACKEDÚEMPTYÚPREEXISTINGÚtarget_repo_kindÚmake_fetch_specÚcreate_branchÚgenerate_revision_historyÚsproutr   ri   Úhas_workingtreeÚ
isinstancer   ÚLocalTransportrD   r/   rJ   Úcreate_workingtreeÚis_versionedÚset_root_idr,   Úpath2idr.   Ú
basis_treerŒ   Úiter_referencesÚurlutilsÚjoinÚescapeÚreference_parentr
   Úget_reference_revision) r   rv   rH   r@   r™   r”   r•   r–   rš   rŽ   Úcreate_tree_if_localÚlossyÚstackÚfetch_spec_factoryÚtarget_transportÚcloning_formatro   r�   Ústacked_branch_urlrI   rn   Úis_new_repor­   rG   Úresult_branchÚwtÚtreeÚbasisÚsubtreesÚpathÚtargetÚsublocations                                    r   r±   zBzrDir.sproutb  sC  € õ< Ô!Ñ#Ô#ð k	 uÝ!&×!7Ò!7Ñ!9Ô!9ÐØÐ&Ø"×3Ò3°[°MÑBÔBÐBØDOÐ"ÔAØ"Ð*Ø&(Ð#Ð#å&*Ð+>Ñ&?Ô&?ØÔ'ðC)ñ ')Ð#å-Ô;¸CØ<Oñ Qô  QÐà×(Ò(Ñ*Ô*Ð*Ø!×1Ò1°'Ñ:Ô:ˆNðRÝ#Ô.×BÒBØ$ñ&ô &��øåÔ(ð Rð Rð RØ'×?Ò?Ð@PÑQÔQ���ðRøøøà/3×/EÒ/EØ�}ñ0&ô 0&Ñ,ˆMÐ,à/<ÐÔ,ð ð *˜=Ð4Ø%)Ô%8Ô%=Ð"Ð"à%)Ð"Ø &× BÒ BØÐ 2ÀWð !Cñ !Nô !NÐà'8×'KÒ'KØ$7ð (Lñ (9ô (9Ñ$ˆK˜à×Ò × 6Ò 6Ñ 8Ô 8Ñ9Ô9Ð9Ø->ÐÔ*Ø-8ÐÔ*Øð E�3˜{ÔAÑBÔBÀaÒGÐGÝ#(Ô#8Ô#@Ð Ð Øð EÝ#(Ô#8Ô#>Ð Ð å#(Ô#8Ô#DÐ Ø2BÐÔ/Ø Ð,Ø/×?Ò?ÑAÔA�
Ø×!Ò!Ð"3À
Ð!ÑKÔKÐKàÐ$ð !'× 4Ò 4Ñ 6Ô 6�ØÐ*Ø!×;Ò;¸KÑHÔHÐHøà -× 4Ò 4Ø¨Ø&7ÀKð !5ñ !Qô !Q�õ Ð,×3Ò3°MÑBÔBÑCÔCÐCð %ñ ¨V×-CÒ-CÑ-EÔ-Eð Ý"Ð#3µUÔ5IÑJÔJðà$Ð,°×0NÒ0NÑ0PÔ0PÐ,Ø×*Ò*ØØ,?ð +ñ Aô AäAEÈÔI[ò\ð \ð ×.Ò.Ø%5ÀØ -ð /ñ /ô /�ð —]’]‘_”_ð !ð !ØŸ?š?¨2Ñ.Ô.ð !ð!ØŸNšN¨4Ô+@×+HÒ+HÈÑ+LÔ+LÑMÔMÐMÐMøÝ%Ô3ð !ð !ð !Ø ˜Dð!øøøð	!ð !ð !ñ !ô !ð !ð !ð !ð !ð !ð !øøøð !ð !ð !ð !øð �Ø˜&Ò Ñ Ø�Ø�>Ø�DØ ŸOšOÑ-Ô-�EØ×'Ò'¨¯ªÑ(9Ô(9Ñ:Ô:Ð:Ð:Ø"Ð.Ø#0×#;Ò#;Ñ#=Ô#=Ð=�E˜D˜DØ"Ð.Ø#0×#;Ò#;Ñ#=Ô#=Ð=�E˜DØÐ#Ø×'Ò'¨¯ªÑ(8Ô(8Ñ9Ô9Ð9Ø#×3Ò3Ñ5Ô5�H�Hà!�HØ$ð )ð )�DÝ%Ÿ]š]¨3µ·²ÀÑ0EÔ0EÑFÔF�FØ"&×"7Ò"7Ø ]Ø,?ð #8ñ #Aô #A�Kð #Ð*ÝØOØ ñ"ô "ð "ð !ØÔ*×1Ò1Ø × <Ò <¸TÑ BÔ BØ'5¸wØ 'ð 2ñ )ô )ð )ð )ð ðWk	ð k	ð k	ð k	ñ k	ô k	ð k	ð k	ð k	ð k	ð k	ð k	øøøð k	ð k	ð k	ð k	ð k	ð k	s€   ”BS#Â)C	ÃS#Ã	$C0Ã-S#Ã/C0Ã0H"S#ÌM8Ì)-MÍM8ÍM)Í&M8Í(M)Í)M8Í,S#Í8M<	Í<S#Í?M<	Î ES#Ó#S'Ó*S'c                 óL   — t                                || j        j        ¦  «        S )z…Find a non-existing backup file name based on base.

        See breezy.osutils.available_backup_name about race conditions.
        )ÚosutilsÚavailable_backup_namer[   Úhas)r   r\   s     r   Ú_available_backup_namezBzrDir._available_backup_nameí  s    € õ
 ×,Ò,¨T°4Ô3FÔ3JÑKÔKÐKr   c           
      ó&  — t           j                             ¦   «         5  | j                             d¦  «        }|                      d¦  «        }| j                             |¦  «        }t           j                             t          d¦  «                             t           
                    |d¦  «        t           
                    |d¦  «        ¦  «        ¦  «         | j                             d|¦  «         ||fcddd¦  «         S # 1 swxY w Y   dS )zhBackup this bzr control directory.

        :return: Tuple with old path name and new path name
        ú.bzrz
backup.bzrzmaking backup of {0}
  to {1}úutf-8N)ÚuiÚ
ui_factoryÚnested_progress_barr[   ÚabspathrÔ   r	   Úgettextri   r»   Úunescape_for_displayÚ	copy_tree)r   Úold_pathÚ
backup_dirÚnew_paths       r   Úbackup_bzrdirzBzrDir.backup_bzrdirô  s?  € õ Œ]×.Ò.Ñ0Ô0ð 		(ð 		(ØÔ*×2Ò2°6Ñ:Ô:ˆHØ×4Ò4°\ÑBÔBˆJØÔ*×2Ò2°:Ñ>Ô>ˆHÝŒM×ÒÝÐ8Ñ9Ô9×@Ò@Ý×1Ò1°(¸GÑDÔDÝ×1Ò1°(¸GÑDÔDñFô FñGô Gð Gð Ô×)Ò)¨&°*Ñ=Ô=Ð=Ø˜hÐ'ð		(ð 		(ð 		(ð 		(ñ 		(ô 		(ð 		(ð 		(ð 		(ð 		(ð 		(ð 		(øøøð 		(ð 		(ð 		(ð 		(ð 		(ð 		(s   ŸCDÄD
ÄD
é'  c                 óF  — d}	 	 d|z  }| j                              d|¦  «         t          t          d¦  «                             | j                              d¦  «        |¦  «        ¦  «         dS # t          j        t          t          j	        f$ r |dz  }||k    r‚ Y nw xY wŒŸ)a$  Permanently disable the bzrdir.

        This is done by renaming it to give the user some ability to recover
        if there was a problem.

        This will have horrible consequences if anyone has anything locked or
        in use.
        :param limit: number of times to retry
        r   Tz.bzr.retired.%drÖ   zrenamed {0} to {1}Nr   )
r[   Úrenamer	   rÜ   ri   rÛ   r   ÚTransportErrorÚOSErrorÚ	PathError)r   ÚlimitÚiÚto_paths       r   Úretire_bzrdirzBzrDir.retire_bzrdir  sÊ   € ð ˆð	ðØ+¨aÑ/�ØÔ#×*Ò*¨6°7Ñ;Ô;Ð;Ý•WÐ1Ñ2Ô2×9Ò9ØÔ'×/Ò/°Ñ7Ô7¸ñBô Bñ Cô Cð Cà�øÝÔ)­7µFÔ4DÐEð ð ð Ø�Q‘�Ø�u’9�9Øà�Dðøøøð	s   …A(A/ Á/-BÂBc                 óì   — | }	  ||¦  «        \  }}|r|S |j                              d¦  «        }|j        |j        k    rdS 	 |                      |¦  «        d         }n# t
          j        $ r Y dS w xY wŒr)a×  Find something in a containing control directory.

        This method will scan containing control dirs, until it finds what
        it is looking for, decides that it will never find it, or runs out
        of containing control directories to check.

        It is used to implement find_repository and
        determine_repository_policy.

        :param evaluate: A function returning (value, stop).  If stop is True,
            the value will be returned.
        Tz..Nr   )r[   rd   r]   r\   Úopen_containing_from_transportr   r0   )r   Úevaluater�   ro   rƒ   Únext_transports         r   r„   zBzrDir._find_containing  s«   € ð ˆð	Ø#˜8 LÑ1Ô1‰LˆF�DØð Ø�Ø)Ô8×>Ò>¸tÑDÔDˆNØÔ%¨Ô)<Ò<Ð<à�tðØ#×BÒBØ"ñ $ô  $Ø$%ô '��øåÔ(ð ð ð Ø�t�tðøøøð	s   ÁA ÁA2Á1A2c                 óh   ‡ — ˆ fd„}‰                       |¦  «        }|€t          j        ‰ ¦  «        ‚|S )zÕFind the repository that should be used.

        This does not require a branch as we use it to find the repo for
        new branches as well as to hook existing branches up to their
        repository.
        c                 ó¸   •— 	 |                       ¦   «         }n# t          j        $ r Y dS w xY w| j        ‰j        k    r|dfS |                     ¦   «         r|dfS dS )Nr{   T©NT)r1   r   r2   r]   rX   )r�   rP   r   s     €r   Úusable_repositoryz1BzrDir.find_repository.<locals>.usable_repositoryB  s   ø€ ð#Ø)×9Ò9Ñ;Ô;�
�
øÝÔ-ð #ð #ð #Ø"�{�{ð#øøøàÔ$¨¬Ò5Ð5Ø! 4Ð'Ð'Ø×%Ò%Ñ'Ô'ð "Ø! 4Ð'Ð'à!�zs   ƒ ˜+ª+)r„   r   r2   )r   rô   Ú
found_repos   `  r   rN   zBzrDir.find_repository;  sO   ø€ ð	"ð 	"ð 	"ð 	"ð 	"ð ×*Ò*Ð+<Ñ=Ô=ˆ
ØÐÝÔ,¨TÑ2Ô2Ð2ØÐr   c                 ó"  — | j         rdS d| _         	 | j                             d¦  «        }|j        dz  dk    rd| _        d| _        dS |j        dz  dz  | _        | j        dz  | _        dS # t          j        $ r d| _        d| _        Y dS w xY w)zÄDetermine the appropriate modes for files and directories.

        They're always set to be consistent with the base directory,
        assuming that this transport allows setting modes.
        NTrL   iÿ  r   iÀ  i¶ñÿÿ)Ú_mode_check_doner   ÚstatÚst_modeÚ	_dir_modeÚ
_file_moder   ÚTransportNotPossible)r   Ústs     r   Ú_find_creation_modeszBzrDir._find_creation_modesT  sµ   € ð Ô ð 	ØˆFØ $ˆÔð	;Ø”×$Ò$ SÑ)Ô)ˆBð ”
˜VÑ# uÒ,Ð,à!%�”Ø"&�”��à"$¤*¨vÑ"5¸Ñ!?�”à"&¤.°7Ñ":�”��øõ Ô*ð 	#ð 	#ð 	#Ø!ˆDŒNØ"ˆDŒOˆOˆOˆOð	#øøøs   ’A- Á-BÂBc                 óF   — | j         s|                      ¦   «          | j        S )z;Return Unix mode for newly created files, or None.
        )r÷   rþ   rû   ©r   s    r   Ú_get_file_modezBzrDir._get_file_moder  s)   € ð Ô$ð 	(Ø×%Ò%Ñ'Ô'Ð'ØŒÐr   c                 óF   — | j         s|                      ¦   «          | j        S )zAReturn Unix mode for newly created directories, or None.
        )r÷   rþ   rú   r   s    r   Ú_get_dir_modezBzrDir._get_dir_modey  s)   € ð Ô$ð 	(Ø×%Ò%Ñ'Ô'Ð'ØŒ~Ðr   c                 ó*   — t          j        | ¦  «        S )z"Get configuration for this BzrDir.)r   ÚBzrDirConfigr   s    r   r}   zBzrDir.get_config€  s   € åÔ" 4Ñ(Ô(Ð(r   c                 ó   — dS )z*By default, no configuration is available.Nr%   r   s    r   Ú_get_configzBzrDir._get_config„  ó   € àˆtr   c                 ód   — || _         |                     d¦  «        | _        || _        d| _        dS )a.  Initialize a Bzr control dir object.

        Only really common logic should reside here, concrete classes should be
        made with varying behaviours.

        :param _format: the format that is creating this BzrDir instance.
        :param _transport: the transport this dir is based at.
        rÖ   FN)r7   rd   r   r[   r÷   )r   Ú
_transportr7   s      r   r   zBzrDir.__init__ˆ  s8   € ð ˆŒð $×)Ò)¨&Ñ1Ô1ˆŒØ(ˆÔØ %ˆÔÐÐr   c                 ó   — | j         S r   )r[   r   s    r   Úuser_transportzBzrDir.user_transport˜  s   € àÔ"Ð"r   c                 ó   — | j         S r   ©r   r   s    r   Úcontrol_transportzBzrDir.control_transportœ  s
   € àŒ~Ðr   c                 ób  — | j                              ¦   «         }	 	 |                      d¬¦  «        }|j        }|j         |_        n)# t
          j        $ r |                      ¦   «         }Y nw xY w|j         }t          |t          j
        ¦  «        r |                     ¦   «          |j        j         }||_        n# t
          j        $ r d}Y nw xY w	 |                      d¬¦  «        }|j                              ¦   «         |_        n(# t
          j        t
          j        f$ r
 d|_        Y nw xY w||fS )zwProduce a metadir suitable for cloning with.

        :returns: (destination_bzrdir_format, source_repository)
        T)Úignore_fallbacksNF©Úrecommend_upgrade)r7   Ú	__class__r/   rP   Ú_branch_formatr   r0   r1   r³   ÚremoteÚRemoteRepositoryFormatÚ_ensure_realÚ_real_repositoryr6   r2   r,   Úworkingtree_formatr.   r-   )r   Úresult_formatr˜   r�   Úrepo_formatrÊ   s         r   Ú_cloning_metadirzBzrDir._cloning_metadir   st  € ð
 œ×.Ò.Ñ0Ô0ˆð	:ð;Ø×)Ò)¸4Ð)Ñ@Ô@�Ø$*Ô$5Ð!Ø/5¬~�Ô,Ð,øÝÔ(ð ;ð ;ð ;Ø$(×$8Ò$8Ñ$:Ô$:Ð!Ð!Ð!ð;øøøð ,Ô3ˆKÝ˜+¥vÔ'DÑEÔEð IØ!×.Ò.Ñ0Ô0Ð0Ø/Ô@ÔH�Ø.9ˆMÔ+Ð+øõ Ô)ð 	%ð 	%ð 	%Ø $ÐÐÐð	%øøøð	Hð ×(Ò(¸5Ð(ÑAÔAˆDð 04¬|×/EÒ/EÑ/GÔ/GˆMÔ,Ð,øõ Ô$¥fÔ&8Ð9ð 	4ð 	4ð 	4Ø/3ˆMÔ,Ð,Ð,ð	4øøøð Ð/Ð/Ð/sA   œ)A ÁB8 Á#A,Á)B8 Á+A,Á,B8 Â8CÃCÃD Ä"D*Ä)D*c                 óÊ   — |                       ¦   «         \  }}|j        €.|€|S |j        j        j        }|                     ¦   «         |_        |r|                     ¦   «          |S )a  Produce a metadir suitable for cloning or sprouting with.

        These operations may produce workingtrees (yes, even though they're
        "cloning" something that doesn't have a tree), so a viable workingtree
        format must be selected.

        :require_stacking: If True, non-stackable formats will be upgraded
            to similar stackable formats.
        :returns: a ControlDirFormat with all component formats either set
            appropriately or set to None if that component should not be
            created.
        )r  Ú_workingtree_formatr7   Ú_matchingcontroldirr  r  rh   )r   rh   ri   rP   Útree_formats        r   rM   zBzrDir.cloning_metadirÃ  st   € ð "×2Ò2Ñ4Ô4Ñˆ�
ØÔ%Ð-àÐ!à�ð Ô"Ô6ÔIð à(3×(=Ò(=Ñ(?Ô(?ˆFÔ%Øð 	&Ø×#Ò#Ñ%Ô%Ð%Øˆr   c                 ó*   — t          | j        ¦  «        ‚)aÆ  Get the transport for use by branch format in this BzrDir.

        Note that bzr dirs that do not support format strings will raise
        IncompatibleFormat if the branch format they are given has
        a format string, and vice versa.

        If branch_format is None, the transport is returned with no
        checking. If it is not None, then the returned transport is
        guaranteed to point to an existing directory ready for use.
        )ÚNotImplementedErrorÚget_branch_transport)r   Úbranch_formatrJ   s      r   r$  zBzrDir.get_branch_transportß  s   € õ " $Ô";Ñ<Ô<Ð<r   c                 ó*   — t          | j        ¦  «        ‚)aÒ  Get the transport for use by repository format in this BzrDir.

        Note that bzr dirs that do not support format strings will raise
        IncompatibleFormat if the repository format they are given has
        a format string, and vice versa.

        If repository_format is None, the transport is returned with no
        checking. If it is not None, then the returned transport is
        guaranteed to point to an existing directory ready for use.
        )r#  Úget_repository_transport©r   r6   s     r   r'  zBzrDir.get_repository_transportì  s   € õ " $Ô"?Ñ@Ô@Ð@r   c                 ó*   — t          | j        ¦  «        ‚)aÕ  Get the transport for use by workingtree format in this BzrDir.

        Note that bzr dirs that do not support format strings will raise
        IncompatibleFormat if the workingtree format they are given has a
        format string, and vice versa.

        If workingtree_format is None, the transport is returned with no
        checking. If it is not None, then the returned transport is
        guaranteed to point to an existing directory ready for use.
        )r#  Úget_workingtree_transport)r   r!  s     r   r*  z BzrDir.get_workingtree_transportù  s   € õ " $Ô"@ÑAÔAÐAr   Úreturnc                 óÎ   — | t           urt          d| z  ¦  «        ‚|€t                               ¦   «         }t	          dt
          j                             |||¬¦  «        ¦  «        S )a*  Create a new BzrDir at the url 'base'.

        :param format: If supplied, the format of branch to create.  If not
            supplied, the default is used.
        :param possible_transports: If supplied, a list of transports that
            can be reused to share a remote connection.
        z>BzrDir.create always creates the default format, not one of %rNr*   )ri   r”   )r*   rb   ÚBzrDirFormatÚget_default_formatr   r   r¡   Úcreate)Úclsr\   ri   r”   s       r   r/  zBzrDir.create  s„   € ð •fÐÐÝ ð "AØCFñ"Gñ Hô Hð Hàˆ>Ý!×4Ò4Ñ6Ô6ˆFÝ�H�jÔ3×:Ò:Ø˜Ð5Hð ;ñ Jô Jñ Kô Kð 	Kr   c                 óL   — d                      | j        j        | j        ¦  «        S )Nz<{} at {!r}>)ri   r  r!   r]   r   s    r   Ú__repr__zBzrDir.__repr__  s   € Ø×$Ò$ T¤^Ô%<¸d¼mÑLÔLÐLr   c                 ó@  — | j                              ¦   «          	 | j                             |¦  «         | j                             d| j                             ¦   «         ¦  «         | j                              ¦   «          dS # | j                              ¦   «          w xY w)zÒUpdate the features required by this bzrdir.

        :param updated_flags: Dictionary mapping feature names to necessities
            A necessity can be None to indicate the feature should be removed
        úbranch-formatN)Úcontrol_filesr¤   r7   Ú_update_feature_flagsr   Ú	put_bytesÚ	as_stringra   )r   Úupdated_flagss     r   Úupdate_feature_flagszBzrDir.update_feature_flags  s�   € ð 	Ô×%Ò%Ñ'Ô'Ð'ð	(ØŒL×.Ò.¨}Ñ=Ô=Ð=ØŒN×$Ò$ _°d´l×6LÒ6LÑ6NÔ6NÑOÔOÐOàÔ×%Ò%Ñ'Ô'Ð'Ð'Ð'øˆDÔ×%Ò%Ñ'Ô'Ð'Ð'øøøs   ›AB ÂB)NFFNFTFN)FNNF)
NFr‘   NNFFNTF)rã   ©Fr   )NN)r+  r*   )#r!   r"   r#   Ú__doc__r3   r8   rq   rx   r†   r‰   r�   r±   rÔ   râ   rì   r„   rN   rþ   r  r  r}   r  r   Úpropertyr  r  r  rM   r$  r'  r*  Úclassmethodr/  r2  r:  r%   r   r   r*   r*   `   sh  € € € € € ðð ð %ð %ð %ð(
ð 
ð 
ð 9=ØUYØOTØ(,ðjð jð jð jð\ð ð ð JNØHMð=Cð =Cð =Cð =Cð~.ð .ð .ð
0ð 0ð 0ð6 <AØ37Ø>CØ8<Øð	Ið Ið Ið IðVLð Lð Lð(ð (ð (ð"ð ð ð ð2ð ð ð:ð ð ð2;ð ;ð ;ð<ð ð ðð ð ð)ð )ð )ðð ð ð&ð &ð &ð  ð#ð #ñ „Xð#ð ðð ñ „Xðð!0ð !0ð !0ðFð ð ð ð8=ð =ð =ð =ðAð Að AðBð Bð Bð ðKð Kð Kð Kñ „[ðKð Mð Mð Mð(ð (ð (ð (ð (r   r*   c                   óä   ‡ — e Zd ZdZd„ Zd„ Zd„ Zˆ fd„Zd„ Z	 	 d d„Z	d!d	„Z
d"d„Zd„ Z	 	 d#d„Zd„ Zd„ Zd!d„Zd„ Zd!d„Zd!d„Zd!d„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	 	 d$d„Zd"d„Z	 	 d%d„Zd„ Zˆ xZS )&ÚBzrDirMeta1a  A .bzr meta version 1 control object.

    This is the first control object where the
    individual aspects are really split out: there are separate repository,
    workingtree and branch subdirectories and any subset of the three can be
    present within a BzrDir.
    c                 óx   — |dk    rdS t                                dt                                |¦  «        ¦  «        S )aE  Obtain the branch path to use.

        This uses the API specified branch name first, and then falls back to
        the branch name specified in the URL. If neither of those is specified,
        it uses the default branch.

        :param name: Optional branch name to use
        :return: Relative path to branch
        r<   r˜   Úbranches)r»   r¼   r½   )r   rJ   s     r   Ú_get_branch_pathzBzrDirMeta1._get_branch_path1  s2   € ð �2Š:ˆ:Ø�8Ý�}Š}˜Z­¯ª¸Ñ)>Ô)>Ñ?Ô?Ð?r   c                 óP  — 	 | j                              d¦  «        }n# t          j        $ r g cY S w xY wg }	 |D ]=}|                     |                     d¦  «                             d¦  «        ¦  «         Œ>	 |                     ¦   «          n# |                     ¦   «          w xY w|S )zFRead the branch list.

        :return: List of branch names.
        úbranch-listó   
r×   )r  Úgetrs   Ú
NoSuchFileÚappendÚrstripÚdecodeÚclose)r   ÚfÚretrJ   s       r   Ú_read_branch_listzBzrDirMeta1._read_branch_list?  s½   € ð
	ØÔ&×*Ò*¨=Ñ9Ô9ˆAˆAøÝÔ(ð 	ð 	ð 	ØˆIˆIˆIð	øøøð ˆð	Øð ?ð ?�Ø—
’
˜4Ÿ;š; uÑ-Ô-×4Ò4°WÑ=Ô=Ñ>Ô>Ð>Ð>ð?ð �GŠG‰IŒIˆIˆIøˆA�GŠG‰IŒIˆIˆIøøøØˆ
s   ‚ �1°1·A B ÂB#c                 óv   — | j                              dd                     d„ |D ¦   «         ¦  «        ¦  «         dS )zaWrite out the branch list.

        :param branches: List of utf-8 branch names to write
        rE  r   c                 ó>   — g | ]}|                      d ¦  «        dz   ‘ŒS )r×   rF  )Úencode)Ú.0rJ   s     r   ú
<listcomp>z2BzrDirMeta1._write_branch_list.<locals>.<listcomp>X  s)   € ÐHÐHÐH°t�d—k’k 'Ñ*Ô*¨UÑ2ÐHÐHÐHr   N)r   r7  r¼   )r   rB  s     r   Ú_write_branch_listzBzrDirMeta1._write_branch_listQ  sN   € ð
 	Œ× Ò ØØ�HŠHÐHÐH¸xÐHÑHÔHÑIÔIñ	Kô 	Kð 	Kð 	Kð 	Kr   c                 óÀ   •— t          ¦   «                              ||¦  «         t                               | j        | j        j        | j        j        ¦  «        | _        d S r   )	Úsuperr   Úlockable_filesÚLockableFilesr  r7   Ú_lock_file_nameÚ_lock_classr5  )r   r
  r7   r  s      €r   r   zBzrDirMeta1.__init__Z  sP   ø€ Ý‰Œ×Ò˜ WÑ-Ô-Ð-Ý+×9Ò9ØÔ" D¤LÔ$@ØŒLÔ$ñ&ô &ˆÔÐÐr   c                 ó   — dS )z See BzrDir.can_convert_format().Tr%   r   s    r   Úcan_convert_formatzBzrDirMeta1.can_convert_format`  r  r   Nc                 óŽ   — |€|                       ¦   «         }| j                             ¦   «                              | |||¬¦  «        S )zSee ControlDir.create_branch.N)rJ   rP   Úappend_revisions_only)Ú_get_selected_branchr7   Úget_branch_formatÚ
initialize)r   rJ   rP   r_  s       r   r¯   zBzrDirMeta1.create_branchd  sO   € ð ˆ<Ø×,Ò,Ñ.Ô.ˆDØŒ|×-Ò-Ñ/Ô/×:Ò:Ø�t¨
Ø"7ð ;ñ 9ô 9ð 	9r   c                 óž  — |€|                       ¦   «         }|                      |¦  «        }|dk    r´| j                             ¦   «          	 |                      ¦   «         }	 |                     |¦  «         n"# t          $ r t          j        |¦  «        ‚w xY w|  	                    |¦  «         | j         
                    ¦   «          n# | j         
                    ¦   «          w xY w	 | j                             |¦  «         dS # t          j        $ r: t          j        t                               | j        j        |¦  «        | ¬¦  «        ‚w xY w)zSee ControlDir.destroy_branch.Nr<   )rÍ   r   )r`  rC  r5  r¤   rO  ÚremoveÚ
ValueErrorr   r0   rU  ra   r   Údelete_treers   rH  r»   r¼   r\   )r   rJ   rÍ   rB  s       r   Údestroy_branchzBzrDirMeta1.destroy_branchm  sf  € àˆ<Ø×,Ò,Ñ.Ô.ˆDØ×$Ò$ TÑ*Ô*ˆØ�2Š:ˆ:ØÔ×)Ò)Ñ+Ô+Ð+ð,Ø×1Ò1Ñ3Ô3�ð6Ø—O’O DÑ)Ô)Ð)Ð)øÝ!ð 6ð 6ð 6Ý Ô/°Ñ5Ô5Ð5ð6øøøà×'Ò'¨Ñ1Ô1Ð1àÔ"×)Ò)Ñ+Ô+Ð+Ð+ø�Ô"×)Ò)Ñ+Ô+Ð+Ð+øøøð	PØŒN×&Ò& tÑ,Ô,Ð,Ð,Ð,øÝÔ(ð 	Pð 	Pð 	PÝÔ'Ý—]’] 4¤>Ô#6¸Ñ=Ô=È$ðPñ Pô Pð Pð	Pøøøs1   ÁC Á!A7 Á6C Á7BÂC ÃC#Ã'D ÄA	EFc                 óB   — | j         j                             | |¦  «        S )zSee BzrDir.create_repository.)r7   r6   rb  )r   Úshareds     r   Úcreate_repositoryzBzrDirMeta1.create_repositoryƒ  s   € àŒ|Ô-×8Ò8¸¸vÑFÔFÐFr   c                 óŠ   — 	 | j                              d¦  «         dS # t          j        $ r t	          j        | ¦  «        ‚w xY w)zSee BzrDir.destroy_repository.rP   N)r   rf  rs   rH  r   r2   r   s    r   Údestroy_repositoryzBzrDirMeta1.destroy_repository‡  sR   € ð	3ØŒN×&Ò& |Ñ4Ô4Ð4Ð4Ð4øÝÔ(ð 	3ð 	3ð 	3ÝÔ,¨TÑ2Ô2Ð2ð	3øøøs	   ‚ ž$Ac                 óJ   — | j         j                             | ||||¬¦  «        S )zSee BzrDir.create_workingtree.)r—   r•   r–   )r7   r  rb  )r   rH   r—   r•   r–   s        r   rµ   zBzrDirMeta1.create_workingtreeŽ  s5   € ð Œ|Ô.×9Ò9Ø�+¨;Ø-¸ð :ñ Bô Bð 	Br   c                 óÜ   — |                       d¬¦  «        }|j        j        }|                     t          j        ¦  «        }|                     |¬¦  «         |                      ¦   «          dS )zSee BzrDir.destroy_workingtree.Fr  )Úold_treeN)r,   r˜   rP   Úrevision_treeÚ_mod_revisionÚNULL_REVISIONÚrevertÚdestroy_workingtree_metadata)r   rÉ   rP   Úemptys       r   Údestroy_workingtreezBzrDirMeta1.destroy_workingtree•  sf   € à×"Ò"°UÐ"Ñ;Ô;ˆØ”YÔ)ˆ
Ø×(Ò(­Ô)DÑEÔEˆð 	�	Š	˜5ˆ	Ñ!Ô!Ð!Ø×)Ò)Ñ+Ô+Ð+Ð+Ð+r   c                 ó:   — | j                              d¦  «         d S )NÚcheckout)r   rf  r   s    r   rt  z(BzrDirMeta1.destroy_workingtree_metadata   s   € ØŒ×"Ò" :Ñ.Ô.Ð.Ð.Ð.r   c                 ó<   — ddl m} |                     | |¬¦  «        S )z{Find the branch 'format' for this bzrdir.

        This might be a synthetic object for e.g. RemoteBranch and SVN.
        r   ©ÚBranchFormatMetadir©rJ   )r˜   r{  Úfind_format)r   rJ   r{  s      r   Úfind_branch_formatzBzrDirMeta1.find_branch_format£  s/   € ð
 	0Ð/Ð/Ð/Ð/Ð/Ø"×.Ò.¨t¸$Ð.Ñ?Ô?Ð?r   c                 óf   — t                                | j        dt           j        ¦  «        }|j        S )z9Figure out the mode to use when creating a bzrdir subdir.r<   )rX  rY  r   ÚTransportLockrú   )r   Útemp_controls     r   Ú_get_mkdir_modezBzrDirMeta1._get_mkdir_mode«  s,   € å%×3Ò3ØŒN˜B¥Ô <ñ>ô >ˆàÔ%Ð%r   c                 ój   — ddl m} |                     | |¬¦  «        }|                     | |¬¦  «        S )z"See BzrDir.get_branch_reference().r   rz  r|  )r˜   r{  r}  Úget_reference)r   rJ   r{  ri   s       r   Úget_branch_referencez BzrDirMeta1.get_branch_reference±  sE   € à/Ð/Ð/Ð/Ð/Ð/Ø$×0Ò0°¸DÐ0ÑAÔAˆØ×#Ò# D¨tÐ#Ñ4Ô4Ð4r   c                 óÌ   — t                                ¦   «         }| j        |j        j        k    r||j        k    rt          j        |¦  «        ‚|                     | ||¬¦  «        S )N)Útarget_branchrJ   )Ú_mod_bzrbranchÚBranchReferenceFormatÚcontrol_urlr   rJ   ÚBranchReferenceLooprb  )r   r‡  rJ   ri   s       r   Úset_branch_referencez BzrDirMeta1.set_branch_reference·  sa   € Ý×5Ò5Ñ7Ô7ˆØÔ Ô 8Ô DÒDÐDØ˜MÔ.Ò.Ð.ÝÔ0°Ñ?Ô?Ð?Ø× Ò  °]ÈÐ ÑNÔNÐNr   c                 ó`  ‡— ‰€|                       ¦   «         Š|                      ‰¦  «        }|€| j                             |¦  «        S 	 |                     ¦   «          n(# t
          $ r t          j        || j        ¦  «        ‚w xY w‰dk    �r|  	                    ¦   «         }‰|vrù| j
                             ¦   «          	 |  	                    ¦   «         }t                               ‰¦  «        }|dk    r||v rt          j        ‰¦  «        ‚ˆfd„|D ¦   «         }t          |¦  «        rt          j        ‰¦  «        ‚|                     ‰¦  «         |                      |¦  «         | j
                             ¦   «          n# | j
                             ¦   «          w xY w| j                             |¦  «        }|                      ¦   «         }|                     |¬¦  «         	 | j                             ||¬¦  «         n# t.          j        $ r Y nw xY w| j                             |¦  «        S )z"See BzrDir.get_branch_transport().Nr<   c                 ó@   •— g | ]}|                      ‰d z   ¦  «        ‘ŒS )ú/©Ú
startswith)rS  ÚbrJ   s     €r   rT  z4BzrDirMeta1.get_branch_transport.<locals>.<listcomp>Ô  s<   ø€ ð &Dð &Dð &DØ56˜Ÿš T¨C¡ZÑ0Ô0ð&Dð &Dð &Dr   ©Úmode)r`  rC  r   rd   Úget_format_stringr#  r   ÚIncompatibleFormatr7   rO  r5  r¤   r»   ÚdirnameÚParentBranchExistsÚanyÚAlreadyBranchErrorrI  rU  ra   r‚  r?   Úmkdirrs   Ú
FileExists)	r   r%  rJ   rÍ   rB  r—  Úchild_branchesÚbranch_transportr”  s	     `      r   r$  z BzrDirMeta1.get_branch_transport¾  sc  ø€ àˆ<Ø×,Ò,Ñ.Ô.ˆDØ×$Ò$ TÑ*Ô*ˆð Ð Ø”>×'Ò'¨Ñ-Ô-Ð-ð	IØ×+Ò+Ñ-Ô-Ð-Ð-øÝ"ð 	Ið 	Ið 	IÝÔ+¨M¸4¼<ÑHÔHÐHð	Iøøøà�2Š:‰:Ø×-Ò-Ñ/Ô/ˆHØ˜8Ð#Ð#ØÔ"×-Ò-Ñ/Ô/Ð/ð0Ø#×5Ò5Ñ7Ô7�HÝ&×.Ò.¨tÑ4Ô4�GØ "’}�}¨°HÐ)<Ð)<Ý$Ô7¸Ñ=Ô=Ð=ð&Dð &Dð &Dð &DØ:Bð&Dñ &Dô &D�Nå˜>Ñ*Ô*ð >Ý$Ô7¸Ñ=Ô=Ð=Ø—O’O DÑ)Ô)Ð)Ø×+Ò+¨HÑ5Ô5Ð5àÔ&×-Ò-Ñ/Ô/Ð/Ð/ø�DÔ&×-Ò-Ñ/Ô/Ð/Ð/øøøØœ>×/Ò/°Ñ5Ô5ÐØ×#Ò#Ñ%Ô%ˆØ×&Ò&¨DÐ&Ñ1Ô1Ð1ð	ØŒN× Ò  ¨DÐ Ñ1Ô1Ð1Ð1øÝÔ(ð 	ð 	ð 	ØˆDð	øøøàŒ~×#Ò# DÑ)Ô)Ð)s+   Á
A Á%BÃ B'F ÆFÇ$H ÈHÈHc                 ót  — |€| j                              d¦  «        S 	 |                     ¦   «          n(# t          $ r t	          j        || j        ¦  «        ‚w xY w	 | j                              d|                      ¦   «         ¬¦  «         n# t          j
        $ r Y nw xY w| j                              d¦  «        S )z&See BzrDir.get_repository_transport().NrP   r“  ©r   rd   r•  r#  r   r–  r7   r›  r‚  rs   rœ  r(  s     r   r'  z$BzrDirMeta1.get_repository_transportå  sÖ   € àÐ$Ø”>×'Ò'¨Ñ5Ô5Ð5ð	MØ×/Ò/Ñ1Ô1Ð1Ð1øÝ"ð 	Mð 	Mð 	MÝÔ+Ð,=¸t¼|ÑLÔLÐLð	Møøøð	ØŒN× Ò  °D×4HÒ4HÑ4JÔ4JÐ ÑKÔKÐKÐKøÝÔ(ð 	ð 	ð 	ØˆDð	øøøàŒ~×#Ò# LÑ1Ô1Ð1ó   ž3 ³%AÁ.B ÂBÂBc                 ót  — |€| j                              d¦  «        S 	 |                     ¦   «          n(# t          $ r t	          j        || j        ¦  «        ‚w xY w	 | j                              d|                      ¦   «         ¬¦  «         n# t          j
        $ r Y nw xY w| j                              d¦  «        S )z'See BzrDir.get_workingtree_transport().Nrx  r“  r   )r   r  s     r   r*  z%BzrDirMeta1.get_workingtree_transportó  sÖ   € àÐ%Ø”>×'Ò'¨
Ñ3Ô3Ð3ð	NØ×0Ò0Ñ2Ô2Ð2Ð2øÝ"ð 	Nð 	Nð 	NÝÔ+Ð,>ÀÄÑMÔMÐMð	Nøøøð	ØŒN× Ò  °$×2FÒ2FÑ2HÔ2HÐ ÑIÔIÐIÐIøÝÔ(ð 	ð 	ð 	ØˆDð	øøøàŒ~×#Ò# JÑ/Ô/Ð/r¡  c                 óØ   — g }	 |                       ¦   «          |                     d¦  «         n# t          j        $ r Y nw xY w|                     |                      ¦   «         ¦  «         |S )zSee ControlDir.branch_names.r<   )r…  rI  r   r0   ÚextendrO  )r   rN  s     r   Úbranch_nameszBzrDirMeta1.branch_names  s{   € àˆð	Ø×%Ò%Ñ'Ô'Ð'ð �JŠJ�r‰NŒNˆNˆNøõ Ô$ð 	ð 	ð 	ØˆDð	øøøð 	�
Š
�4×)Ò)Ñ+Ô+Ñ,Ô,Ð,Øˆ
s   „. ®A ¿A c                 óâ   — i }	 |                       d¬¦  «        |d<   n!# t          j        t          j        f$ r Y nw xY w|                      ¦   «         D ]}|                       |¬¦  «        ||<   Œ|S )zSee ControlDir.get_branches.r<   r|  )r/   r   r0   r2   rO  )r   rN  rJ   s      r   rO   zBzrDirMeta1.get_branches  s‘   € àˆð	Ø×&Ò&¨BÐ&Ñ/Ô/ˆC�‰GˆGøÝÔ%¥vÔ'AÐBð 	ð 	ð 	ØˆDð	øøøð ×*Ò*Ñ,Ô,ð 	4ð 	4ˆDØ×(Ò(¨dÐ(Ñ3Ô3ˆC�‰IˆIàˆ
s   „ ž<»<c                 ól   — ddl m} 	 |                     | ¦  «         n# t          j        $ r Y dS w xY wdS )z¶Tell if this bzrdir contains a working tree.

        Note: if you're going to open the working tree, you should just go
        ahead and try, and not ask permission first.
        r   ©ÚWorkingTreeFormatMetaDirFT)Úworkingtreer©  Úfind_format_stringr   r.   )r   r©  s     r   r²   zBzrDirMeta1.has_workingtree  s\   € ð 	:Ð9Ð9Ð9Ð9Ð9ð	Ø$×7Ò7¸Ñ=Ô=Ð=Ð=øÝÔ#ð 	ð 	ð 	Ø�5�5ð	øøøàˆts   ˆ ž1°1c                 óp  — t          | j        |j        ¦  «        r/| j                             ¦   «         |                     ¦   «         k    rdS 	 t          |                      ¦   «         j        |j        j        ¦  «        sdS n# t          j        $ r Y nw xY w|                      ¦   «         D ]1}t          |j        | 	                    ¦   «         j        ¦  «        s dS Œ2	 |  
                    d¬¦  «        }t          |j        |j        j        ¦  «        sdS n!# t          j        t          j        f$ r Y nw xY wdS )z%See BzrDir.needs_format_conversion().TFr  )r³   r7   r  r•  r1   r6   r   r2   Úlist_branchesra  r,   r  r.   r-   )r   ri   r˜   Úmy_wts       r   Úneeds_format_conversionz#BzrDirMeta1.needs_format_conversion'  st  € å˜4œ<¨Ô)9Ñ:Ô:ð 	Ø”<×1Ò1Ñ3Ô3°v×7OÒ7OÑ7QÔ7QÒQÐQà�4ð	Ý˜d×2Ò2Ñ4Ô4Ô<Ø$Ô6Ô@ñBô Bð ð �tðøõ Ô)ð 	ð 	ð 	ØˆDð	øøøà×(Ò(Ñ*Ô*ð 	ð 	ˆFÝ˜fœnØ$×6Ò6Ñ8Ô8ÔBñDô Dð ð �t�tðð	Ø×)Ò)¸EÐ)ÑBÔBˆEÝ˜eœmØ$Ô7ÔAñCô Cð ð �tðøõ Ô$¥fÔ&8Ð9ð 	ð 	ð 	ØˆDð	øøøàˆus$   Á1B ÂBÂBÃ5D ÄD3Ä2D3c                 ó  — |€|                       ¦   «         }|                      |¬¦  «        }|                     |¦  «         |€g }nt          |¦  «        }|                     | j        ¦  «         |                     | |d||¬¦  «        S )zSee ControlDir.open_branch.Nr|  T)rJ   Ú_foundr  r”   )r`  r~  Úcheck_support_statusr    rI  r[   Úopen)r   rJ   Úunsupportedr  r”   ri   s         r   r/   zBzrDirMeta1.open_branchD  s¤   € ð ˆ<Ø×,Ò,Ñ.Ô.ˆDØ×(Ò(¨dÐ(Ñ3Ô3ˆØ×#Ò# KÑ0Ô0Ð0ØÐ&Ø"$ÐÐå"&Ð':Ñ";Ô";ÐØ×"Ò" 4Ô#6Ñ7Ô7Ð7Ø�{Š{˜4 dØ"&Ð9IØ/Bð ñ Dô Dð 	Dr   c                 ó�   — ddl m} |                     | ¦  «        }|                     |¦  «         |                     | d¬¦  «        S )zSee BzrDir.open_repository.r   )ÚRepositoryFormatMetaDirT©r±  )rP   r¶  r}  r²  r³  )r   r´  r¶  ri   s       r   r1   zBzrDirMeta1.open_repositoryT  sQ   € à7Ð7Ð7Ð7Ð7Ð7Ø(×4Ò4°TÑ:Ô:ˆØ×#Ò# KÑ0Ô0Ð0Ø�{Š{˜4¨ˆ{Ñ-Ô-Ð-r   Tc                 óª   — ddl m} |                     | ¦  «        }|                     ||| j        j        ¬¦  «         |                     | d¬¦  «        S )zSee BzrDir.open_workingtree.r   r¨  )ÚbasedirTr·  )rª  r©  r}  r²  r[   r\   r³  )r   r´  r  r©  ri   s        r   r,   zBzrDirMeta1.open_workingtree[  sm   € ð 	:Ð9Ð9Ð9Ð9Ð9Ø)×5Ò5°dÑ;Ô;ˆØ×#Ò# KÐ1BØ,0Ô,?Ô,Dð 	$ñ 	Fô 	Fð 	Fà�{Š{˜4¨ˆ{Ñ-Ô-Ð-r   c                 ó6   — t          j        | j        d¦  «        S )Nzcontrol.conf)r   ÚTransportConfigr   r   s    r   r  zBzrDirMeta1._get_configd  s   € ÝÔ% d¤n°nÑEÔEÐEr   )NNNr   r;  )NNNF)NFFN)FT) r!   r"   r#   r<  rC  rO  rU  r   r]  r¯   rg  rj  rl  rµ   rv  rt  r~  r‚  r…  rŒ  r$  r'  r*  r¥  rO   r²   r¯  r/   r1   r,   r  Ú__classcell__©r  s   @r   r@  r@  (  sG  ø€ € € € € ðð ð@ð @ð @ðð ð ð$Kð Kð Kð&ð &ð &ð &ð &ðð ð ð 37Ø,0ð9ð 9ð 9ð 9ðPð Pð Pð Pð,Gð Gð Gð Gð3ð 3ð 3ð @DØ;@ðBð Bð Bð Bð	,ð 	,ð 	,ð/ð /ð /ð@ð @ð @ð @ð&ð &ð &ð5ð 5ð 5ð 5ðOð Oð Oð Oð%*ð %*ð %*ð %*ðN2ð 2ð 2ð0ð 0ð 0ð
ð 
ð 
ðð ð ðð ð ðð ð ð: 27Ø@DðDð Dð Dð Dð .ð .ð .ð .ð ,1Ø+/ð.ð .ð .ð .ðFð Fð Fð Fð Fð Fð Fr   r@  c                   óÖ   — e Zd ZU dZ e¦   «         Zee         ed<   d„ Z	e
d„ ¦   «         Ze
d„ ¦   «         Z	 	 dd„Ze
d	„ ¦   «         Ze
d
„ ¦   «         Zd„ Ze
d„ ¦   «         Zd„ Zd„ Zd„ ZdS )Ú	BzrFormata^  Base class for all formats of things living in metadirs.

    This class manages the format string that is stored in the 'format'
    or 'branch-format' file.

    All classes for (branch-, repository-, workingtree-) formats that
    live in meta directories and have their own 'format' file
    (i.e. different from .bzr/branch-format) derive from this class,
    as well as the relevant base class for their kind
    (BranchFormat, WorkingTreeFormat, RepositoryFormat).

    Each format is identified by a "format" or "branch-format" file with a
    single line containing the base format name and then an optional list of
    feature flags.

    Feature flags are supported as of bzr 2.5. Setting feature flags on formats
    will render them inaccessible to older versions of bzr.

    :ivar features: Dictionary mapping feature names to their necessity
    Ú_present_featuresc                 ó   — i | _         d S r   )Úfeaturesr   s    r   r   zBzrFormat.__init__€  s   € ØˆŒˆˆr   c                 ó�   — d|v rt          d¦  «        ‚|| j        v rt          |¦  «        ‚| j                             |¦  «         dS )zWRegister a feature as being present.

        :param name: Name of the feature
        ó    z'spaces are not allowed in feature namesN)re  rÀ  r'   Úadd©r0  rJ   s     r   Úregister_featurezBzrFormat.register_featureƒ  sU   € ð �4ˆ<ˆ<ÝÐFÑGÔGÐGØ�3Ô(Ð(Ð(Ý*¨4Ñ0Ô0Ð0ØÔ×!Ò! $Ñ'Ô'Ð'Ð'Ð'r   c                 ó:   — | j                              |¦  «         dS )zUnregister a feature.N)rÀ  rd  rÆ  s     r   Úunregister_featurezBzrFormat.unregister_feature�  s!   € ð 	Ô×$Ò$ TÑ*Ô*Ð*Ð*Ð*r   TNc                 óì   — | j                              ¦   «         D ]Y\  }}|| j        v rŒ|dk    rt          d|¦  «         Œ&|dk    rt	          |¦  «        ‚t          d|¦  «         t	          |¦  «        ‚d S )Ns   optionalz$ignoring optional missing feature %ss   requiredz,treating unknown necessity as require for %s)rÂ  rc   rÀ  r   r   )r   Úallow_unsupportedr  r¹  rJ   Ú	necessitys         r   r²  zBzrFormat.check_support_status”  sœ   € à#œ}×2Ò2Ñ4Ô4ð 	+ð 	+‰OˆD�)Ø�tÔ-Ð-Ð-ØØ˜KÒ'Ð'ÝÐ=¸tÑDÔDÐDØØ˜kÒ)Ð)Ý$ TÑ*Ô*Ð*åÐEØñô ð å$ TÑ*Ô*Ð*ð	+ð 	+r   c                 ó*   — t          | j        ¦  «        ‚)z;Return the ASCII format string that identifies this format.)r#  r•  ©r0  s    r   r•  zBzrFormat.get_format_string£  s   € õ " #Ô"7Ñ8Ô8Ð8r   c                 óÊ  — |                       ¦   «         }|                     |¦  «        s#t          d                     || ¦  «        ¦  «        ‚|t	          |¦  «        d …                              ¦   «         } | ¦   «         }t          |¦  «        D ]S\  }}	 |                     dd¦  «        \  }}n)# t          $ r t          j
        | |dz   ||¬¦  «        ‚w xY w||j        |<   ŒT|S )Nz#Invalid format header {!r} for {!r}rÄ  r   r   )ri   ÚlinenoÚlineÚtext)r•  r‘  rb   ri   r§   Ú
splitlinesÚ	enumerateÚsplitre  r   ÚParseFormatErrorrÂ  )	r0  rÒ  Úformat_stringÚlinesrN  rÐ  rÑ  rÌ  r   s	            r   Úfrom_stringzBzrFormat.from_string¨  s  € à×-Ò-Ñ/Ô/ˆØ�Š˜}Ñ-Ô-ð 	IÝ Ø5×<Ò<¸TÀ3ÑGÔGñIô Ið Ià•S˜Ñ'Ô'Ð(Ð(Ô)×4Ò4Ñ6Ô6ˆØˆc‰eŒeˆÝ% eÑ,Ô,ð 	.ð 	.‰LˆF�DðDØ'+§z¢z°$¸Ñ':Ô':Ñ$�˜G˜GøÝð Dð Dð DÝÔ-°SÀÈ!ÁØ37¸dðDñ Dô Dð DðDøøøð %.ˆCŒL˜Ñ!Ð!Øˆ
s   ÂB/Â/&Cc                 óÜ   — |                       ¦   «         g}|                     d„ t          | j                             ¦   «         ¦  «        D ¦   «         ¦  «         d                     |¦  «        S )z9Return the string representation of this format.
        c                 ó<   — g | ]}|d          dz   |d         z   dz   ‘ŒS )r   rÄ  r   rF  r%   )rS  Úitems     r   rT  z'BzrFormat.as_string.<locals>.<listcomp>½  sD   € ð Að Að AØð ˜A”w ‘~¨¨Q¬Ñ/°%Ñ7ð Að Að Ar   r   )r•  r¤  ÚsortedrÂ  rc   r¼   )r   rØ  s     r   r8  zBzrFormat.as_string¹  sx   € ð ×'Ò'Ñ)Ô)Ð*ˆØ�Šð Að AÝ"(¨¬×)<Ò)<Ñ)>Ô)>Ñ"?Ô"?ðAñ Aô Añ 	Bô 	Bð 	Bà�xŠx˜‰ŒÐr   c                 ó
  — 	 |d |                      d¦  «        dz   …         }n# t          $ r |}Y nw xY w	 |                     |¦  «        }n$# t          $ r t	          j        ||¬¦  «        ‚w xY w|                     |¦  «        S )NrF  r   )ri   Úkind)Úindexre  rG  rW   r   ÚUnknownFormatErrorrÙ  )ÚklassÚregistryrß  r×  Ú
first_liner0  s         r   Ú_find_formatzBzrFormat._find_formatÁ  s°   € ð	'Ø&Ð'F¨×(;Ò(;¸EÑ(BÔ(BÀQÑ(FÐ'FÔGˆJˆJøÝð 	'ð 	'ð 	'Ø&ˆJˆJˆJð	'øøøð	JØ—,’,˜zÑ*Ô*ˆCˆCøÝð 	Jð 	Jð 	JÝÔ+°:ÀDÐIÑIÔIÐIð	Jøøøà�Š˜}Ñ-Ô-Ð-s   ‚ # £2±2¶A Á!A-c                 ó*   — |                       ¦   «         S )z†A simple byte string uniquely identifying this format for RPC calls.

        Metadir branch formats use their format string.
        )r8  r   s    r   rY   zBzrFormat.network_nameÍ  s   € ð
 �~Š~ÑÔÐr   c                 ó>   — | j         |j         u o| j        |j        k    S r   )r  rÂ  ©r   Úothers     r   Ú__eq__zBzrFormat.__eq__Ô  s$   € Ø” %¤/Ð1ð 4Ø”M U¤^Ò3ð	5r   c                 ó†   — |                      ¦   «         D ]+\  }}|€	 | j        |= Œ# t          $ r Y Œw xY w|| j        |<   Œ,dS )zfUpdate the feature flags in this format.

        :param updated_flags: Updated feature flags
        N)rc   rÂ  rW   )r   r9  rJ   rÌ  s       r   r6  zBzrFormat._update_feature_flagsØ  sv   € ð
  -×2Ò2Ñ4Ô4ð 	0ð 	0‰OˆD�)ØÐ ðØœ dÐ+Ð+øÝð ð ð Ø�Dðøøøð '0�”˜dÑ#Ð#ð	0ð 	0s   �&¦
3²3©TN)r!   r"   r#   r<  ÚsetrÀ  r   ÚstrÚ__annotations__r   r>  rÇ  rÉ  r²  r•  rÙ  r8  rå  rY   rê  r6  r%   r   r   r¿  r¿  h  s-  € € € € € € ðð ð* #& #¡%¤%Ð�s˜3”xÐ'Ð'Ñ'ðð ð ð ð	(ð 	(ñ „[ð	(ð ð+ð +ñ „[ð+ð IMØ%)ð+ð +ð +ð +ð ð9ð 9ñ „[ð9ð ðð ñ „[ðð ð ð ð ð	.ð 	.ñ „[ð	.ð ð  ð  ð5ð 5ð 5ð0ð 0ð 0ð 0ð 0r   r¿  c                   ó„   — e Zd ZdZdZd„ Z	 	 	 	 dd„Zd„ Zdd„Zd	„ Z	d
„ Z
d„ Z	 	 dd„Zed„ ¦   «         Zed„ ¦   «         ZdS )r-  a•  ControlDirFormat base class for .bzr/ directories.

    Formats are placed in a dict by their format string for reference
    during bzrdir opening. These should be subclasses of BzrDirFormat
    for consistency.

    Once a format is deprecated, just deprecate the initialize and open
    methods on the format class. Do not deprecate the object, as the
    object will be created every system load.
    zbranch-lockc                 óH  — 	 |                      ¦   «         }t          | t          ¦  «        s|                      |¦  «        S ddlm}  |¦   «         }|                      |¦  «         |                     |¦  «        S # t          j	        $ r |                      |¦  «        cY S w xY w)z=Initialize a new bzrdir in the base directory of a Transport.r   ©ÚRemoteBzrDirFormat)
Úget_smart_mediumr³   ÚBzrDirMetaFormat1Ú_initialize_on_transport_vfsr  ró  Ú_supply_sub_formats_tor£   r   ÚNoSmartMedium)r   r   Úclient_mediumró  Úremote_formats        r   r£   z$BzrDirFormat.initialize_on_transportø  sË   € ð	Dð &×6Ò6Ñ8Ô8ˆMõ ˜dÕ$5Ñ6Ô6ð DØ×8Ò8¸ÑCÔCÐCØ2Ð2Ð2Ð2Ð2Ð2Ø.Ð.Ñ0Ô0ˆMØ×'Ò'¨Ñ6Ô6Ð6Ø ×8Ò8¸ÑCÔCÐCøõ Ô#ð 	@ð 	@ð 	@Ø×4Ò4°YÑ?Ô?Ð?Ð?Ð?ð	@øøøs   ‚A: Á:$B!Â B!FNc                 óX  — |
s†	 |                      ¦   «         }ddlm}  |¦   «         }|                      ¦   «         |_        |                      |¦  «         |                     |||||||||	¬¦	  «	        S # t          j        $ r Y nw xY wd„ }d„ }	 t          |||¦  «        }n?# t          j        $ r |s‚ Y n+t          j        $ r |s‚ |                     ¦   «          Y nw xY w|du}|                      |¦  «        }|r¦	 t          j                             |¦  «        |j        _        n# t(          $ r Y nw xY w|                     ||||¬¦  «        }|                     ||	¦  «        \  }}|s"|j        rd}|j                             ¦   «          |                     ¦   «          nd}d}||||fS )	aé  Create this format on transport.

        The directory to initialize will be created.

        :param force_new_repo: Do not use a shared repository for the target,
                               even if one is available.
        :param create_prefix: Create any missing directories leading up to
            to_transport.
        :param use_existing_dir: Use an existing directory if one exists.
        :param stacked_on: A url to stack any created branch on, None to follow
            any target stacking policy.
        :param stack_on_pwd: If stack_on is relative, the location it is
            relative to.
        :param repo_format_name: If non-None, a repository will be
            made-or-found. Should none be found, or if force_new_repo is True
            the repo_format_name is used to select the format of repository to
            create.
        :param make_working_trees: Control the setting of make_working_trees
            for a new shared repository when one is made. None to use whatever
            default the format has.
        :param shared_repo: Control whether made repositories are shared or
            not.
        :param vfs_only: If True do not attempt to use a smart server
        :return: repo, controldir, require_stacking, repository_policy. repo is
            None if none was created or found, bzrdir is always valid.
            require_stacking is the result of examining the stacked_on
            parameter and any stacking policy found for the target.
        r   rò  r=   c                 ó0   — |                       d¦  «         | S )NrL   )r›  r  s    r   Úmake_directoryz?BzrDirFormat.initialize_on_transport_ex.<locals>.make_directoryB  s   € Ø�OŠO˜CÑ Ô Ð ØÐr   c                 ó`   — t          |¦  «         |                      |j        |j        ¦  «        S r   )r	   Ú_redirected_toÚsourcerÎ   )r   ÚeÚredirection_notices      r   Ú
redirectedz;BzrDirFormat.initialize_on_transport_ex.<locals>.redirectedF  s+   € ÝÐ#Ñ$Ô$Ð$Ø×+Ò+¨A¬H°a´hÑ?Ô?Ð?r   Nr|   T)rô  r  ró  rY   Ú_network_namer÷  rZ   r   rø  r   rs   rœ  rH  r?   r£   rP   Únetwork_format_registryrG  r7   r6   ÚAttributeErrorr†   rˆ   Ú_require_stackingrh   r¤   )r   r   r>   r?   r@   rA   rB   rC   rD   rE   Úvfs_onlyrù  ró  Úremote_dir_formatrý  r  rh   ro   rI   rn   rÇ   s                        r   rZ   z'BzrDirFormat.initialize_on_transport_ex  s�  € ð@ ð 	-ð-Ø )× :Ò :Ñ <Ô <�ð 7Ð6Ð6Ð6Ð6Ð6à$6Ð$6Ñ$8Ô$8Ð!Ø26×2CÒ2CÑ2EÔ2EÐ!Ô/Ø×+Ò+Ð,=Ñ>Ô>Ð>Ø(×CÒCØÐ0@Ø"/ÀØ)¸Ø%5Ø'9Ø +ð Dñ -ô -ð -øõ Ô'ð ð ð Ø�ðøøøð&	ð 	ð 	ð	@ð 	@ð 	@ð		&Ý0°ÀØ1;ñ=ô =ˆIˆIøåÔ(ð 	ð 	ð 	Ø#ð Øðð åÔ(ð 	&ð 	&ð 	&Ø ð ØØ×#Ò#Ñ%Ô%Ð%Ð%Ð%ð	&øøøð
 '¨dÐ2Ðð
 ×-Ò-¨iÑ8Ô8ˆØð 	%ðõ Ô6×:Ò:Ð;KÑLÔLð ”Ô0Ð0øå!ð ð ð à�ðøøøð !'× BÒ BØ 
¨LØ!1ð !Cñ !3ô !3Ðð (9×'KÒ'KØ" Kñ(1ô (1Ñ$ˆK˜à#ð 2Ð(9Ô(Kð 2Ø#'Ð Ø”×/Ò/Ñ1Ô1Ð1Ø×"Ò"Ñ$Ô$Ð$Ð$àˆKØ $ÐØ˜FÐ$4Ð6GÐGÐGs;   „A4 Á4BÂBÂB" Â"CÂ6%CÃCÃ=)D' Ä'
D4Ä3D4c                 ón  — t                                |dt           j        ¦  «        }	 |j                             d|j        ¬¦  «         n,# t          j        $ r t          j	        |j
        ¦  «        ‚w xY wt          j        dk    rGt          |t          j        ¦  «        r-t                                |                     d¦  «        ¦  «         |j        }~|                     d¦  «        }dd|                      ¦   «         fg}t                                || j        | j        ¦  «        }|                     ¦   «          |                     ¦   «          	 |D ]\  }}|                     |||¬¦  «         Œ	 |                     ¦   «          n# |                     ¦   «          w xY w|                      |d¬¦  «        S )	zŽInitialize a new bzrdir using VFS calls.

        :param transport: The transport to create the .bzr directory in.
        :return: A
        r<   rÖ   r“  Úwin32)ÚREADMEs“   This is a Bazaar control directory.
Do not change any files in this directory.
See http://bazaar.canonical.com/ for more information about Bazaar.
r4  Tr·  )rX  rY  r€  r
  r›  rú   rs   rœ  r   ÚAlreadyControlDirErrorr\   ÚsysÚplatformr³   r   r´   Ú
win32utilsÚset_file_attr_hiddenÚ_abspathrû   rd   r8  rZ  r[  Úcreate_lockr¤   r7  ra   r³  )	r   r   r�  Ú	file_modeÚbzrdir_transportÚ
utf8_filesr5  ÚfilenameÚcontents	            r   rö  z)BzrDirFormat._initialize_on_transport_vfsq  së  € õ &×3Ò3°IØ46½Ô8TñVô Vˆð	@ØÔ#×)Ò)¨&ð 0<Ô/Eð *ñ Gô Gð Gð Gøõ Ô(ð 	@ð 	@ð 	@ÝÔ/°	´Ñ?Ô?Ð?ð	@øøøåŒ<˜7Ò"Ð"¥z°)½UÔ=QÑ'RÔ'RÐ"Ý×+Ò+¨I×,>Ò,>¸vÑ,FÔ,FÑGÔGÐGØ Ô+ˆ	ØØ$Ÿ?š?¨6Ñ2Ô2Ððað '¨¯ªÑ(8Ô(8Ð9ð	ˆ
õ '×4Ò4Ð5EØ59Ô5IÈ4ÔK[ñ]ô ]ˆà×!Ò!Ñ#Ô#Ð#Ø× Ò Ñ"Ô"Ð"ð	#Ø'1ð ;ð ;Ñ#�˜7Ø ×*Ò*¨8°WØ09ð +ñ ;ô ;ð ;ð ;ð;ð × Ò Ñ"Ô"Ð"Ð"øˆM× Ò Ñ"Ô"Ð"Ð"øøøØ�yŠy˜¨4ˆyÑ0Ô0Ð0s   ¨!A
 Á
)A3Å F ÆFc                 ó  — |sut           j                             |¦  «        }t          || j        ¦  «        st          | ›d|›d|›�¦  «        ‚|                      |¦  «         |                     |¦  «        S |                      |¦  «        S )z‚Return an instance of this format for the dir transport points at.

        _found is a private parameter, do not use it.
        z was asked to open z, but it seems to need format )r   ÚControlDirFormatr}  r³   r  rb   r÷  Ú_open)r   r   r±  Úfound_formats       r   r³  zBzrDirFormat.openš  sŸ   € ð
 ð 	1Ý%Ô6×BÒBÀ9ÑMÔMˆLÝ˜l¨D¬NÑ;Ô;ð HÝ$à(,¨¨¨i¨i¨i¸¸ð&Gñ Hô Hð Hð ×'Ò'¨Ñ5Ô5Ð5Ø×%Ò% iÑ0Ô0Ð0Ø�zŠz˜)Ñ$Ô$Ð$r   c                 ó*   — t          | j        ¦  «        ‚)z™Template method helper for opening BzrDirectories.

        This performs the actual open and any additional logic or parameter
        passing.
        )r#  r  ©r   r   s     r   r  zBzrDirFormat._openª  s   € õ " $¤*Ñ-Ô-Ð-r   c                 ó8   — t          | j        ¦  «        |_        dS )á’  Give other_format the same values for sub formats as this has.

        This method is expected to be used when parameterising a
        RemoteBzrDirFormat instance with the parameters from a
        BzrDirMetaFormat1 instance.

        :param other_format: other_format is a format which should be
            compatible with whatever sub formats are supported by self.
        :return: None.
        N)ÚdictrÂ  )r   Úother_formats     r   r÷  z#BzrDirFormat._supply_sub_formats_to²  s   € õ !% T¤]Ñ 3Ô 3ˆÔÐÐr   c                 ó   — dS ró   r%   r  s     r   Úsupports_transportzBzrDirFormat.supports_transport¿  r  r   Tc                 óˆ   — t           j                             | |||¬¦  «         t                               | |||¬¦  «         d S )N)rË  r  r¹  )r   r  r²  r¿  )r   rË  r  r¹  s       r   r²  z!BzrDirFormat.check_support_statusÃ  sm   € åÔ#×8Ò8¸ØK\ð  qBØAHð 	9ñ 	Jô 	Jð 	Jõ 	×&Ò& tÐ?PØ9JÐT[ð 	'ñ 	]ô 	]ð 	]ð 	]ð 	]r   c                 ó8   — |dk    p|                      d¦  «        S )ab  True if filename is the name of a path which is reserved for bzrdir's.

        :param filename: A filename within the root transport of this bzrdir.

        This is true IF and ONLY IF the filename is part of the namespace
        reserved for bzr control dirs. Currently this is the '.bzr' directory
        in the root of the root_transport.
        rÖ   z.bzr/r�  )râ  r  s     r   Úis_control_filenamez BzrDirFormat.is_control_filenameË  s"   € ð  ˜6Ò!ÐA X×%8Ò%8¸Ñ%AÔ%AÐAr   c                 óN   — t          j                             d¦  «        ¦   «         S )z"Return the current default format.Úbzr)r   Úformat_registryrG  )râ  s    r   r.  zBzrDirFormat.get_default_formatÝ  s!   € õ Ô)×-Ò-¨eÑ4Ô4Ñ6Ô6Ð6r   )	FFFNNNNFFr;  rì  )r!   r"   r#   r<  rZ  r£   rZ   rö  r³  r  r÷  r$  r²  r>  r'  r.  r%   r   r   r-  r-  ç  s  € € € € € ð	ð 	ð $€Oð
Dð Dð Dð& FKØY]Ø`dØ?DðdHð dHð dHð dHðL'1ð '1ð '1ðR%ð %ð %ð %ð .ð .ð .ð4ð 4ð 4ðð ð ð IMØ%)ð]ð ]ð ]ð ]ð ðBð Bñ „[ðBð" ð7ð 7ñ „[ð7ð 7ð 7r   r-  c                   óÚ   ‡ — e Zd ZdZej        ZdZdZd„ Z	d„ Z
d„ Zd„ Zd„ Z	 	 dd
„Zdd„Zed„ ¦   «         Zd„ Zd„ Zd„ Zd„ Z eee¦  «        Zˆ fd„Zd„ Zd„ Zd„ Z eee¦  «        Zˆ xZS )rõ  a  Bzr meta control format 1

    This is the first format with split out working tree, branch and repository
    disk storage.

    It has:

    - Format 3 working trees [optional]
    - Format 5 branches [optional]
    - Format 7 repositories [optional]
    FTc                 ód   — t                                | ¦  «         d | _        d | _        d | _        d S r   )r-  r   r  r  Ú_repository_formatr   s    r   r   zBzrDirMetaFormat1.__init__ö  s4   € Ý×Ò˜dÑ#Ô#Ð#Ø#'ˆÔ Ø"ˆÔØ"&ˆÔÐÐr   c                 ó’   — |j         | j         urdS |j        | j        k    rdS |j        | j        k    rdS |j        | j        k    rdS dS )NFT)r  r6   r  rÂ  rè  s     r   rê  zBzrDirMetaFormat1.__eq__ü  s[   € ØŒ? $¤.Ð0Ð0Ø�5ØÔ" dÔ&<Ò<Ð<Ø�5ØÔ# tÔ'>Ò>Ð>Ø�5ØŒ>˜Tœ]Ò*Ð*Ø�5Øˆtr   c                 ó   — | |k     S r   r%   rè  s     r   Ú__ne__zBzrDirMetaFormat1.__ne__  s   € Ø˜5’=Ð Ð r   c                 ó\   — | j         €ddlm} |                     ¦   «         | _         | j         S ©Nr   ©r*  )r  r˜   r*  Úget_default)r   Úbranch_format_registrys     r   ra  z#BzrDirMetaFormat1.get_branch_format
  s:   € ØÔÐ&ØIÐIÐIÐIÐIÐIØ"8×"DÒ"DÑ"FÔ"FˆDÔØÔ"Ð"r   c                 ó   — || _         d S r   )r  ©r   ri   s     r   Úset_branch_formatz#BzrDirMetaFormat1.set_branch_format  s   € Ø$ˆÔÐÐr   Nc                 óä  ‡‡‡— d}d}g d¢Šˆˆˆfd„}|s«| j         j        sŸ |¦   «         \  }}}	|€B|	r?| j         j        rt                               ¦   «         }n/t                               ¦   «         }n|j        j        }|j        sd}|�6|| _         t          t          d¦  «        | 
                    ¦   «         ¦  «         |                      ¦   «                              ¦   «         sˆ |¦   «         \  }}}	|€|	rddlm}
  |
¦   «         }n|j        }|                     ¦   «         sd}|�H|                      |¦  «         t          t          d¦  «        | 
                    ¦   «         ¦  «         dS dS dS )a  We have a request to stack, try to ensure the formats support it.

        :param stack_on: If supplied, it is the URL to a branch that we want to
            stack on. Check to see if that format supports stacking before
            forcing an upgrade.
        N©NFNc                  óh  •— ‰d         r‰S ‰€g d¢‰d d …<   ‰S 	 t                                ‰‰¬¦  «        } n;# t          j        $ r g d¢‰d d …<   ‰cY S t          j        $ r g d¢‰d d …<   ‰cY S w xY w	 |                      ¦   «         }n # t          j        $ r g d¢‰d d …<   ‰cY S w xY w|ddg‰d d …<   ‰S )Nr   )NTTr“   )NTFTF)r*   r³  r   r0   Ú	JailBreakr/   )Ú
target_dirr‡  r”   r‚   rÎ   s     €€€r   Úget_target_branchz=BzrDirMetaFormat1.require_stacking.<locals>.get_target_branch%  s0  ø€ Ø�aŒyð à�ØÐà.Ð.Ð.��q�q�q‘	Ø�ð
Ý#Ÿ[š[¨Ø=Pð )ñ Rô R�
�
øåÔ(ð ð ð à/Ð/Ð/��q�q�q‘	Ø���ÝÔ#ð ð ð à.Ð.Ð.��q�q�q‘	Ø���ðøøøðØ *× 6Ò 6Ñ 8Ô 8��øÝÔ(ð ð ð à/Ð/Ð/��q�q�q‘	Ø���ðøøøð '¨¨eÐ4ˆF�1�1�1‰IØˆMs'   š7 ·A/ÁA/Á.A/Á3B ÂB%Â$B%zFSource repository format does not support stacking, using format:
  %sr   )ÚBzrBranchFormat7zBSource branch format does not support stacking, using format:
  %s)r6   Úsupports_external_lookupsÚrich_root_dataÚknitpack_repoÚ!RepositoryFormatKnitPack5RichRootÚRepositoryFormatKnitPack5rP   r7   r	   rÜ   Úget_format_descriptionra  Úsupports_stackingr˜   r?  r8  )r   r‚   r”   Ú
_skip_repoÚnew_repo_formatÚnew_branch_formatr>  r‡  Ú_Ú
do_upgrader?  rÎ   s    ``        @r   rh   z"BzrDirMetaFormat1.require_stacking  s  øøø€ ð ˆØ Ðð %Ð$Ð$ˆð	ð 	ð 	ð 	ð 	ð 	ð 	ð8 ð 	?ØÔ.ÔHð	?ð ,=Ð+<Ñ+>Ô+>Ñ(ˆM˜1˜jØÐ$àð Tð Ô-Ô<ð TÝ*7×*YÒ*YÑ*[Ô*[˜˜å*7×*QÒ*QÑ*SÔ*S˜øð
 #0Ô":Ô"B�Ø&Ô@ð +ð '+�OØÐ*Ø)8�Ô&Ý•Wð 4ñ 5ô 5à$×;Ò;Ñ=Ô=ñ?ô ?ð ?ð ×%Ò%Ñ'Ô'×9Ò9Ñ;Ô;ð 	Að ,=Ð+<Ñ+>Ô+>Ñ(ˆM˜1˜jØÐ$Øð ;à8Ð8Ð8Ð8Ð8Ð8Ø(8Ð(8Ñ(:Ô(:Ð%øà$1Ô$9Ð!Ø(×:Ò:Ñ<Ô<ð -Ø(,Ð%Ø Ð,à×&Ò&Ð'8Ñ9Ô9Ð9Ý•Wð 4ñ 5ô 5à&×=Ò=Ñ?Ô?ñAô Að Að Að Að!	Að 	Að -Ð,r   c                 óŒ  — |€t                                ¦   «         }t          | t          ¦  «        r$t          |t          ¦  «        rt          |¦  «        S t          | t          ¦  «        r$t          |t          ¦  «        rt          |¦  «        S t          | |j        ¦  «        st          | j        ¦  «        ‚t          |¦  «        S )z!See BzrDirFormat.get_converter().)
r-  r.  r³   rõ  ÚBzrDirMetaFormat1ColoÚConvertMetaToColor  r#  Úget_converterÚConvertMetaToMetar7  s     r   rO  zBzrDirMetaFormat1.get_converterq  s´   € àˆ>Ý!×4Ò4Ñ6Ô6ˆFÝ�tÕ.Ñ/Ô/ð 	-Ý˜vÕ'<Ñ=Ô=ð	-å$ VÑ,Ô,Ð,Ý�tÕ2Ñ3Ô3ð 	-Ý˜vÕ'8Ñ9Ô9ð	-å$ VÑ,Ô,Ð,Ý˜$ Ô 0Ñ1Ô1ð 	:å% dÔ&8Ñ9Ô9Ð9Ý  Ñ(Ô(Ð(r   c                 ó   — dS )ú%See BzrDirFormat.get_format_string().s#   Bazaar-NG meta directory, format 1
r%   rÎ  s    r   r•  z#BzrDirMetaFormat1.get_format_string€  s
   € ð 7Ð6r   c                 ó   — dS )ú*See BzrDirFormat.get_format_description().zMeta directory format 1r%   r   s    r   rE  z(BzrDirMetaFormat1.get_format_description…  s   € à(Ð(r   c                 óh   — t          ¦   «         }|                      |¦  «         t          ||¦  «        S ©zSee BzrDirFormat._open.)rõ  r÷  r@  ©r   r   ri   s      r   r  zBzrDirMetaFormat1._open‰  s3   € õ
 #Ñ$Ô$ˆØ×#Ò# FÑ+Ô+Ð+Ý˜9 fÑ-Ô-Ð-r   c                 óR   — | j         r| j         S ddlm} |                     ¦   «         S )zCircular import protection.r   r3  )r-  rP   r*  r4  )r   r*  s     r   Ú__return_repository_formatz,BzrDirMetaFormat1.__return_repository_format’  s:   € àÔ"ð 	+ØÔ*Ð*Ø/Ð/Ð/Ð/Ð/Ð/Ø×*Ò*Ñ,Ô,Ð,r   c                 ó   — || _         dS )z9Allow changing the repository format for metadir formats.N)r-  )r   Úvalues     r   Ú_set_repository_formatz(BzrDirMetaFormat1._set_repository_format™  s   € à"'ˆÔÐÐr   c                 óÔ   •— t          ¦   «                              |¦  «         t          | dd¦  «        �| j        |_        | j        �| j        |_        | j        �| j        |_        dS dS )r   r-  N)rW  r÷  Úgetattrr6   r  r  r  )r   r"  r  s     €r   r÷  z(BzrDirMetaFormat1._supply_sub_formats_to   sq   ø€ õ 	‰Œ×&Ò& |Ñ4Ô4Ð4Ý�4Ð-¨tÑ4Ô4Ð@Ø-1Ô-CˆLÔ*ØÔÐ*Ø*.Ô*=ˆLÔ'ØÔ#Ð/Ø.2Ô.EˆLÔ+Ð+Ð+ð 0Ð/r   c                 ó\   — | j         €ddlm} |                     ¦   «         | _         | j         S r2  )r  rª  r*  r4  )r   Úwt_format_registrys     r   Ú__get_workingtree_formatz*BzrDirMetaFormat1.__get_workingtree_format³  sH   € ØÔ#Ð+ðð ð ð ð ð ð (:×'EÒ'EÑ'GÔ'GˆDÔ$ØÔ'Ð'r   c                 ó   — || _         d S r   )r  )r   Ú	wt_formats     r   Ú__set_workingtree_formatz*BzrDirMetaFormat1.__set_workingtree_format»  s   € Ø#,ˆÔ Ð Ð r   c                 ó@   — d                      | j        j        ¦  «        S )Nz<{!r}>)ri   r  r!   r   s    r   r2  zBzrDirMetaFormat1.__repr__¾  s   € Ø�Š˜tœ~Ô6Ñ7Ô7Ð7r   ©NNFr   )r!   r"   r#   r<  r   ÚLockDirr[  Úfixed_componentsÚcolocated_branchesr   rê  r0  ra  r8  rh   rO  r>  r•  rE  r  Ú,_BzrDirMetaFormat1__return_repository_formatr\  r=  r6   r÷  Ú*_BzrDirMetaFormat1__get_workingtree_formatÚ*_BzrDirMetaFormat1__set_workingtree_formatr2  r  r¼  r½  s   @r   rõ  rõ  ã  s’  ø€ € € € € ð
ð 
ð ”/€KàÐàÐð'ð 'ð 'ð	ð 	ð 	ð!ð !ð !ð#ð #ð #ð%ð %ð %ð CGØ$)ð\Að \Að \Að \Að|)ð )ð )ð )ð ð7ð 7ñ „[ð7ð)ð )ð )ð.ð .ð .ð-ð -ð -ð(ð (ð (ð !˜Ð!;Ø!7ñ9ô 9ÐðFð Fð Fð Fð Fð&(ð (ð (ð-ð -ð -ð8ð 8ð 8ð "˜Ð":Ø":ñ<ô <ÐÐÐÐÐr   rõ  c                   ó8   — e Zd ZdZdZed„ ¦   «         Zd„ Zd„ ZdS )rM  z7BzrDirMeta1 format with support for colocated branches.Tc                 ó   — dS )rR  s:   Bazaar meta directory, format 1 (with colocated branches)
r%   rÎ  s    r   r•  z'BzrDirMetaFormat1Colo.get_format_stringÊ  s   € ð NÐMr   c                 ó   — dS )rT  z;Meta directory format 1 with support for colocated branchesr%   r   s    r   rE  z,BzrDirMetaFormat1Colo.get_format_descriptionÏ  s   € àLÐLr   c                 óh   — t          ¦   «         }|                      |¦  «         t          ||¦  «        S rV  )rM  r÷  r@  rW  s      r   r  zBzrDirMetaFormat1Colo._openÓ  s3   € õ
 'Ñ(Ô(ˆØ×#Ò# FÑ+Ô+Ð+Ý˜9 fÑ-Ô-Ð-r   N)	r!   r"   r#   r<  ri  r>  r•  rE  r  r%   r   r   rM  rM  Å  s]   € € € € € ØAÐAàÐàðNð Nñ „[ðNðMð Mð Mð.ð .ð .ð .ð .r   rM  c                   ó   — e Zd ZdZd„ Zd„ ZdS )rP  z$Converts the components of metadirs.c                 ó   — || _         dS )zxCreate a metadir to metadir converter.

        :param target_format: The final metadir format that is desired.
        N©r9   ©r   r9   s     r   r   zConvertMetaToMeta.__init__à  ó   € ð
 +ˆÔÐÐr   c                 óâ  — || _         t          j                             ¦   «         5 | _        d| _        d| _        |                      d¦  «         	 | j                              ¦   «         }| j	        j
        }t          |j        |j        ¦  «        ssddlm} t          j                             t#          d¦  «        ¦  «         |j        st'          d¦  «        ‚ || j	        j
        ¦  «        }|                     ||¦  «         n# t*          j        $ r Y nw xY w| j                              ¦   «         D �][}|j        j        }| j	                             ¦   «         j        }	||	k    �r'|t2          j        k    r?|	t6          j        t6          j        t6          j        fv rt6                               ¦   «         }
n—|t6          j        k    r4|	t6          j        t6          j        fv rt6                                ¦   «         }
nS|t6          j        k    r(|	t6          j        u rt6           !                    ¦   «         }
nt+          j"        d|	|j        ¦  «        ‚|
                     |¦  «         | j          #                    ¦   «         }|j        j        }||	k    �°'�Œ]	 | j          $                    d	¬
¦  «        }t          |tJ          j&        ¦  «        rjt          |tN          j(        ¦  «        sPt          | j	        j)        tN          j*        ¦  «        r,tN           +                    ¦   «                              |¦  «         t          |tN          j(        ¦  «        rjt          |tN          j,        ¦  «        sPt          | j	        j)        tN          j-        ¦  «        r,tN           .                    ¦   «                              |¦  «         t          |tN          j(        ¦  «        rjt          |tN          j/        ¦  «        sPt          | j	        j)        tN          j0        ¦  «        r,tN           1                    ¦   «                              |¦  «         n!# t*          j2        t*          j3        f$ r Y nw xY wddd¦  «         n# 1 swxY w Y   |S )úSee Converter.convert().r   r   zchecking repository formatr   )ÚCopyConverterzstarting repository conversionz;Repository in metadir does not support overriding transportzNo converterFr  N)4r   rØ   rÙ   rÚ   ÚpbÚcountÚtotalÚstepr1   r9   r6   r³   r7   r  rP   rx  r	   rÜ   Úsupports_overriding_transportrb   Úconvertr   r2   r­  ra  ÚfullhistorybranchÚBzrBranchFormat5rˆ  ÚBzrBranchFormat6r?  ÚBzrBranchFormat8ÚConverter5to6ÚConverter6to7ÚConverter7to8ÚBadConversionTargetr/   r,   Úworkingtree_3ÚWorkingTree3Úworkingtree_4ÚDirStateWorkingTreer  ÚDirStateWorkingTreeFormatÚConverter3to4ÚWorkingTree5ÚWorkingTreeFormat5ÚConverter4to5ÚWorkingTree6ÚWorkingTreeFormat6ÚConverter4or5to6r.   r-   )r   Ú
to_convertry  ÚrepoÚrepo_fmtrx  Ú	converterr˜   ÚoldÚnewÚbranch_converterrÊ   s               r   r~  zConvertMetaToMeta.convertç  s¨  € à$ˆŒÝŒ]×.Ò.Ñ0Ô0ð A	C°D´GØˆDŒJØˆDŒJØ�IŠIÐ2Ñ3Ô3Ð3ð0Ø”×6Ò6Ñ8Ô8�ð  Ô-Ô?�Ý! $¤,°Ô0BÑCÔCð 0Ø:Ð:Ð:Ð:Ð:Ð:Ý”M×&Ò&¥wÐ/OÑ'PÔ'PÑQÔQÐQØ#ÔAð 4Ý,ð3ñ4ô 4ð 4ð !. ¨dÔ.@Ô.RÑ SÔ S�IØ×%Ò% d¨BÑ/Ô/Ð/øøõ Ô-ð ð ð Ø�ðøøøð œ/×7Ò7Ñ9Ô9ð 3ñ 3�ð ”nÔ.�ØÔ(×:Ò:Ñ<Ô<ÔF�Ø˜S’j‘jØÕ0ÔAÒAÐAØ¥NÔ$CÝ$2Ô$CÝ$2Ô$Cð$Eð Eð Eõ ,:×+GÒ+GÑ+IÔ+IÐ(Ð(Ø¥Ô!@Ò@Ð@Ø!¥nÔ&EÝ&4Ô&Eð&Gð Gð Gå+9×+GÒ+GÑ+IÔ+IÐ(Ð(Ø¥Ô!@Ò@Ð@Ø!¥^Ô%DÐDÐDÝ+9×+GÒ+GÑ+IÔ+IÐ(Ð(å$Ô8¸ÈØ9?¼ñIô Ið Ià$×,Ò,¨VÑ4Ô4Ð4Ø!œ_×8Ò8Ñ:Ô:�FØ œ.Ô2�Cð% ˜S’j‘jùð&CØ”×7Ò7È%Ð7ÑPÔP�õ ˜t¥]Ô%?Ñ@Ô@ð @Ý& t­]Ô-NÑOÔOð@å" 4Ô#5Ô#HÝ#0Ô#JñLô Lð@õ "×/Ò/Ñ1Ô1×9Ò9¸$Ñ?Ô?Ð?Ý˜t¥]Ô%FÑGÔGð @Ý& t­]Ô-GÑHÔHð@å" 4Ô#5Ô#HÝ#0Ô#CñEô Eð@õ "×/Ò/Ñ1Ô1×9Ò9¸$Ñ?Ô?Ð?Ý˜t¥]Ô%FÑGÔGð CÝ& t­]Ô-GÑHÔHðCå" 4Ô#5Ô#HÝ#0Ô#CñEô EðCõ "×2Ò2Ñ4Ô4×<Ò<¸TÑBÔBÐBøøõ' Ô(­&Ô*<Ð=ð ð ð Ø�ðøøøð]A	Cð A	Cð A	Cñ A	Cô A	Cð A	Cð A	Cð A	Cð A	Cð A	Cð A	Cøøøð A	Cð A	Cð A	Cð A	CðD Ðs\   ¦)Q$ÁDÁ)BQ$ÄDÄQ$ÄDÄE9Q$ÊP7Ê*FQ$Ð7QÑQ$ÑQÑQ$Ñ$Q(Ñ+Q(N©r!   r"   r#   r<  r   r~  r%   r   r   rP  rP  Ý  s=   € € € € € Ø.Ð.ð+ð +ð +ðEð Eð Eð Eð Er   rP  c                   ó   — e Zd ZdZd„ Zd„ ZdS )rN  zAdd colocated branch support.c                 ó   — || _         dS )z�Create a converter.that upgrades a metadir to the colo format.

        :param target_format: The final metadir format that is desired.
        Nrs  rt  s     r   r   zConvertMetaToColo.__init__2  ru  r   c                 ó¤   — |j                              d| j                             ¦   «         ¦  «         t                               |j        ¦  «        S )rw  r4  )r   r7  r9   r8  r*   r¢   r[   )r   r“  ry  s      r   r~  zConvertMetaToColo.convert9  sK   € àÔ×&Ò& Ø'+Ô'9×'CÒ'CÑ'EÔ'Eñ	Gô 	Gð 	Gå×)Ò)¨*Ô*CÑDÔDÐDr   Nrš  r%   r   r   rN  rN  /  s=   € € € € € Ø'Ð'ð+ð +ð +ðEð Eð Eð Eð Er   rN  c                   ó4   ‡ — e Zd ZdZ	 	 dˆ fd„	Z	 	 dd„Zˆ xZS )r€   z%A policy of creating a new repositoryNFc                 ó\   •— t          ¦   «                              |||¦  «         || _        dS )zïConstructor.

        :param controldir: The controldir to create the repository on.
        :param stack_on: A location to stack on
        :param stack_on_pwd: If stack_on is relative, the location it is
            relative to.
        N)rW  r   Ú_controldir)r   r   r‚   rB   rh   r  s        €r   r   zCreateRepository.__init__C  ó7   ø€ õ 	‰Œ×ÒØ�lÐ$4ñ	6ô 	6ð 	6à%ˆÔÐÐr   c                 óö  — |€g }nt          |¦  «        }|                     | j        j        ¦  «         |                      ¦   «         }|rd| j        j        }|                     ||¬¦  «         | j        s:t          t          d¦  «         
                    | j        | j        ¦  «        ¦  «         | j                             |¬¦  «        }|                      ||¬¦  «         |�|                     |¦  «         |dfS )z”Implementation of RepositoryAcquisitionPolicy.acquire_repository

        Creates the desired repository in the controldir we already have.
        N)r‚   r”   z(Using default stacking branch {0} at {1})ri  r“   T)r    rI  r   r[   Ú_get_full_stack_onr7   rh   r  r	   rÜ   ri   Ú	_stack_onÚ_stack_on_pwdrj  Ú_add_fallbackÚset_make_working_trees)r   rD   ri  r”   r‚   ri   rP   s          r   rˆ   z#CreateRepository.acquire_repositoryP  s+  € ð Ð&Ø"$ÐÐå"&Ð':Ñ";Ô";ÐØ×"Ò" 4Ô#3Ô#BÑCÔCÐCØ×*Ò*Ñ,Ô,ˆØð 	9ØÔ%Ô-ˆFØ×#Ò#¨XØ8Kð $ñ Mô Mð MàÔ)ð 9å•WÐGÑHÔH×OÒOØ”N DÔ$6ñ8ô 8ñ 9ô 9ð 9àÔ%×7Ò7¸vÐ7ÑFÔFˆ
Ø×Ò˜:Ø/Bð 	ñ 	Dô 	Dð 	DàÐ)Ø×-Ò-Ð.@ÑAÔAÐAØ˜4ÐÐr   rf  r:  ©r!   r"   r#   r<  r   rˆ   r¼  r½  s   @r   r€   r€   @  sg   ø€ € € € € Ø/Ð/à?CØ"'ð&ð &ð &ð &ð &ð &ð BGØ/3ð ð  ð  ð  ð  ð  ð  ð  r   r€   c                   ó4   ‡ — e Zd ZdZ	 	 dˆ fd„	Z	 	 dd„Zˆ xZS )r   z*A policy of reusing an existing repositoryNFc                 ó\   •— t          ¦   «                              |||¦  «         || _        dS )zÚConstructor.

        :param repository: The repository to use.
        :param stack_on: A location to stack on
        :param stack_on_pwd: If stack_on is relative, the location it is
            relative to.
        N)rW  r   Ú_repository)r   rP   r‚   rB   rh   r  s        €r   r   zUseExistingRepository.__init__o  r¡  r   c                 ó¼   — |€g }nt          |¦  «        }|                     | j        j        j        ¦  «         |                      | j        |¬¦  «         | j        dfS )zyImplementation of RepositoryAcquisitionPolicy.acquire_repository

        Returns an existing repository to use.
        Nr“   F)r    rI  r«  r   r   r¦  )r   rD   ri  r”   s       r   rˆ   z(UseExistingRepository.acquire_repository|  su   € ð Ð&Ø"$ÐÐå"&Ð':Ñ";Ô";ÐØ×"Ò" 4Ô#3Ô#>Ô#HÑIÔIÐIØ×Ò˜4Ô+Ø/Bð 	ñ 	Dô 	Dð 	DàÔ Ð&Ð&r   rf  r:  r¨  r½  s   @r   r   r   l  sg   ø€ € € € € Ø4Ð4à?CØ"'ð&ð &ð &ð &ð &ð &ð BGØ/3ð'ð 'ð 'ð 'ð 'ð 'ð 'ð 'r   r   )*r<  r›   r  Útypingr   r   r   r   ÚglobalsÚtracer   r	   r
   r<   r   r   r   r   r   rs   r   r   r˜   r   ÚBzrErrorr   r'   r¡   r*   r@  r¿  r  r-  rõ  rM  Ú	ConverterrP  rN  ÚRepositoryAcquisitionPolicyr€   r   Ú_default_formatr%   r   r   ú<module>r´     s§  ðð"	ð 	ð Ð Ð Ð Ø 
€
€
€
Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +à %Ð %Ð %Ð %Ð %Ð %Ø €ˆGˆG‰IŒIð ñ ô ð ð0ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð
 ð "Ø!Ð!Ð!Ð!Ð!Ð!ðð ð ð ð �V”_ñ ô ð ðð ð ð ð ˜vœñ ô ð ðE(ð E(ð E(ð E(ð E(ˆZÔ"ñ E(ô E(ð E(ðP}Fð }Fð }Fð }Fð }F�&ñ }Fô }Fð }Fð@
|0ð |0ð |0ð |0ð |0ñ |0ô |0ð |0ð~y7ð y7ð y7ð y7ð y7�9˜jÔ9ñ y7ô y7ð y7ðx_<ð _<ð _<ð _<ð _<˜ñ _<ô _<ð _<ðD.ð .ð .ð .ð .Ð-ñ .ô .ð .ð0Oð Oð Oð Oð O˜
Ô,ñ Oô Oð OðdEð Eð Eð Eð E˜
Ô,ñ Eô Eð Eð") ð ) ð ) ð ) ð ) �zÔ=ñ ) ô ) ð ) ðX'ð 'ð 'ð 'ð '˜JÔBñ 'ô 'ð 'ð@ /@Ð.?Ñ.AÔ.A€
Ô Ô +Ð +Ð +r   