§
    cÌc&  ã                   ó|   — d Z ddlmZ  G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ d¦  «        Zd	S )
z—TreeBuilder helper class.

TreeBuilders are used to build trees of various shapes or properties. This
can be extremely useful in testing for instance.
é   )Úerrorsc                   ó   — e Zd ZdZdS )ÚAlreadyBuildingz,The tree builder is already building a tree.N©Ú__name__Ú
__module__Ú__qualname__Ú_fmt© ó    ú4/usr/lib/python3/dist-packages/breezy/treebuilder.pyr   r      s   € € € € € à9€D€D€Dr   r   c                   ó   — e Zd ZdZdS )ÚNotBuildingzNot currently building a tree.Nr   r   r   r   r   r      s   € € € € € à+€D€D€Dr   r   c                   ó0   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚTreeBuilderzUA TreeBuilder allows the creation of specific content in one tree at a
    time.
    c                 ó"   — d| _         d| _        dS )zConstruct a TreeBuilder.NF)Ú_treeÚ
_root_done©Úselfs    r   Ú__init__zTreeBuilder.__init__)   s   € àˆŒ
ØˆŒˆˆr   c                 ó¢  — |                       ¦   «          | j        s$| j                             ddd¬¦  «         d| _        |D ]Œ}|                     d¦  «        r#| j                             |dd…         ¦  «         Œ:d	}d
|                     d¦  «        |fz  }| j                             |d¦  «         | j                             ||¦  «         Œ�dS )a  Build recipe into the current tree.

        :param recipe: A sequence of paths. For each path, the corresponding
            path in the current tree is created and added. If the path ends in
            '/' then a directory is added, otherwise a regular file is added.
        Ú Ú	directorys   root-id)ÚidsTú/Néÿÿÿÿó   
s   contents of %s%szutf-8Úfile)Ú_ensure_buildingr   r   ÚaddÚendswithÚmkdirÚencodeÚput_file_bytes_non_atomic)r   ÚrecipeÚnameÚendÚcontents        r   ÚbuildzTreeBuilder.build.   så   € ð 	×ÒÑÔÐØŒð 	#ØŒJ�NŠN˜2˜{°
ˆNÑ;Ô;Ð;Ø"ˆDŒOØð 	Dð 	DˆDØ�}Š}˜SÑ!Ô!ð DØ”
× Ò   c r c¤Ñ+Ô+Ð+Ð+à�Ø-°·²¸WÑ1EÔ1EÀsÐ0KÑK�Ø”
—’˜t VÑ,Ô,Ð,Ø”
×4Ò4°T¸7ÑCÔCÐCÐCð	Dð 	Dr   c                 ó"   — | j         €t          ‚dS )z:Raise NotBuilding if there is no current tree being built.N)r   r   r   s    r   r    zTreeBuilder._ensure_buildingB   s   € àŒ:ÐÝÐð Ðr   c                 ór   — |                       ¦   «          | j        }d| _        |                     ¦   «          dS )z!Finish building the current tree.N)r    r   Úunlock©r   Útrees     r   Úfinish_treezTreeBuilder.finish_treeG   s3   € à×ÒÑÔÐØŒzˆØˆŒ
Ø�Š‰Œˆˆˆr   c                 ób   — | j         �t          ‚|| _         | j                              ¦   «          dS )zŠStart building on tree.

        :param tree: A tree to start building on. It must provide the
            MutableTree interface.
        N)r   r   Úlock_tree_writer.   s     r   Ú
start_treezTreeBuilder.start_treeN   s3   € ð Œ:Ð!Ý!Ð!ØˆŒ
ØŒ
×"Ò"Ñ$Ô$Ð$Ð$Ð$r   N)	r   r   r	   Ú__doc__r   r*   r    r0   r3   r   r   r   r   r   $   sl   € € € € € ðð ð ð  ð  ð
Dð Dð Dð(ð ð ð
ð ð ð	%ð 	%ð 	%ð 	%ð 	%r   r   N)r4   r   r   ÚBzrErrorr   r   r   r   r   r   ú<module>r6      s­   ðð"ð ð Ð Ð Ð Ð Ð ð:ð :ð :ð :ð :�f”oñ :ô :ð :ð
,ð ,ð ,ð ,ð ,�&”/ñ ,ô ,ð ,ð
3%ð 3%ð 3%ð 3%ð 3%ñ 3%ô 3%ð 3%ð 3%ð 3%r   