§
    cÌcá& ã                   ó´  — d dl Z d dlZd dlZd dlmZmZ d dlZd dlZddlm	Z	m
Z
mZmZ ddlmZmZmZmZ ddlmZ ddlmZmZmZmZmZmZmZmZmZmZ dd	l m!Z! dd
l"m#Z# ddlm$Z$m%Z% ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2 d dl3m4Z4m5Z5 d dl6m7Z7  G d„ de(¦  «        Z8 G d„ de8¦  «        Z9 G d„ de9¦  «        Z: G d„ de:¦  «        Z; G d„ de'e¦  «        Z<dS )é    N)ÚS_IEXECÚS_ISREGé   )Úencode_git_pathÚ	mode_kindÚmode_is_executableÚobject_mode)ÚGitTreeÚGitTreeDirectoryÚGitTreeSymlinkÚGitTreeFile)Údecode_git_pathé   )
ÚannotateÚ	conflictsÚerrorsÚmultiparentÚosutilsÚrevisionÚtraceÚ	transportÚuiÚurlutils)Úgettext)ÚMutableTree)Ú	InterTreeÚ
TreeChange)ÚPreviewTreeÚTreeTransformÚ_TransformResultsÚ
_FileMoverÚ
FinalPathsÚjoinpathÚ
unique_addÚTransformRenameFailedÚImmortalLimboÚROOT_PARENTÚReusingTransformÚMalformedTransform)Úcommit_treeÚblob_from_path_and_stat)ÚBlobc                   óR  ‡ — e Zd ZdZd1ˆ fd„	Zed„ ¦   «         Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd2d„Zd„ Zd3d„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	 	 d4d„Zd2d„Zd2d„Zd „ Z d!„ Z!d"„ Z"d3d#„Z#d$„ Z$	 	 	 d5d%„Z%d&„ Z&d'„ Z'd(„ Z(d6d)„Z)d*„ Z*d+„ Z+d,„ Z,d-„ Z-d.„ Z.d7d/„Z/d0„ Z0ˆ xZ1S )8ÚTreeTransformBasez-The base class for TreeTransform and its kin.NTc                 óÒ   •— t          ¦   «                              ||¬¦  «         i | _        t          ¦   «         | _        |                      d¦  «        | _        || _        i | _        dS )a  Constructor.

        :param tree: The tree that will be transformed, but not necessarily
            the output tree.
        :param pb: ignored
        :param case_sensitive: If True, the target of the transform is
            case sensitive, not just case preserving.
        )ÚpbÚ N)	ÚsuperÚ__init__Ú_observed_sha1sÚsetÚ
_versionedÚtrans_id_tree_pathÚrootÚ_case_sensitive_targetÚ_symlink_target)ÚselfÚtreer0   Úcase_sensitiveÚ	__class__s       €ú6/usr/lib/python3/dist-packages/breezy/git/transform.pyr3   zTreeTransformBase.__init__B   s`   ø€ õ 	‰Œ×Ò˜ "ÐÑ%Ô%Ð%à!ˆÔå™%œ%ˆŒà×+Ò+¨BÑ/Ô/ˆŒ	à&4ˆÔ#Ø!ˆÔÐÐó    c                 ó   — | j         j        S ©N)Ú_treeÚmapping©r;   s    r?   rD   zTreeTransformBase.mappingV   s   € àŒzÔ!Ð!r@   c                 ó¤   — | j         €dS t          j        d         D ]} || j         | ¦  «         Œ| j                              ¦   «          d| _         dS )z–Release the working tree lock, if held.

        This is required if apply has not been invoked, but can be invoked
        even after apply.
        NÚpost_transform)rC   r   ÚhooksÚunlock)r;   Úhooks     r?   ÚfinalizezTreeTransformBase.finalizeZ   s_   € ð Œ:ÐØˆFÝÔ%Ð&6Ô7ð 	#ð 	#ˆDØˆD�”˜TÑ"Ô"Ð"Ð"ØŒ
×ÒÑÔÐØˆŒ
ˆ
ˆ
r@   c                 ó†   — |                       ¦   «         }t          | j        ||¦  «         t          | j        ||¦  «         |S )z%Assign a transaction id to a new path)Ú	assign_idr$   Ú	_new_nameÚ_new_parent)r;   ÚnameÚparentÚtrans_ids       r?   Úcreate_pathzTreeTransformBase.create_pathg   s?   € à—>’>Ñ#Ô#ˆÝ�4”> 8¨TÑ2Ô2Ð2Ý�4Ô# X¨vÑ6Ô6Ð6Øˆr@   c                 ó   — dS )zAEmulate moving the root by moving all children, instead.
        N© )r;   rP   rQ   s      r?   Úadjust_root_pathz"TreeTransformBase.adjust_root_pathn   s   € € € r@   c                 ó  — d„ | j                              ¦   «         D ¦   «         }t          |¦  «        dk     rdS t          |¦  «        dk    rt          d¦  «        ‚|d         }|| j        v r|                      |¦  «         n|                      |¦  «         t          |                      |¦  «        ¦  «         |  	                    ¦   «          
                    |g ¦  «        D ]1}|                      |                      |¦  «        | j        |¦  «         Œ2|| j        v r|                      |¦  «         n|                      |¦  «         | j        | j        v r|                      | j        ¦  «         | j         |= | j        |= dS )a   Reinterpret requests to change the root directory

        Instead of creating a root directory, or moving an existing directory,
        all the attributes and children of the new root are applied to the
        existing root directory.

        This means that the old root trans-id becomes obsolete, so it is
        recommended only to invoke this after the root trans-id has become
        irrelevant.

        c                 ó.   — g | ]\  }}|t           k    ¯|‘ŒS rU   )r'   )Ú.0ÚkÚvs      r?   ú
<listcomp>z5TreeTransformBase.fixup_new_roots.<locals>.<listcomp>~   s0   € ð *ð *ð *™4˜1˜aØ�[Ò(Ð(ð Ø(Ð(Ð(r@   r   NzA tree cannot have two roots!r   )rO   ÚitemsÚlenÚ
ValueErrorr6   Úcancel_versioningÚunversion_fileÚlistÚiter_tree_childrenÚ	by_parentÚgetÚadjust_pathÚ
final_namer8   Ú_new_contentsÚcancel_creationÚdelete_contentsÚ_removed_contentsÚcancel_deletionrN   )r;   Ú	new_rootsÚold_new_rootÚchilds       r?   Úfixup_new_rootsz!TreeTransformBase.fixup_new_rootsr   s—  € ð*ð * 4Ô#3×#9Ò#9Ñ#;Ô#;ð *ñ *ô *ˆ	åˆy‰>Œ>˜AÒÐØˆFÝˆy‰>Œ>˜QÒÐÝÐ<Ñ=Ô=Ð=Ø  ”|ˆà˜4œ?Ð*Ð*Ø×"Ò" <Ñ0Ô0Ð0Ð0à×Ò Ñ-Ô-Ð-õ
 	ˆT×$Ò$ \Ñ2Ô2Ñ3Ô3Ð3à—^’^Ñ%Ô%×)Ò)¨,¸Ñ;Ô;ð 	Gð 	GˆEØ×Ò˜TŸ_š_¨UÑ3Ô3°T´YÀÑFÔFÐFÐFð ˜4Ô-Ð-Ð-Ø× Ò  Ñ.Ô.Ð.Ð.à× Ò  Ñ.Ô.Ð.ð Œ9˜Ô.Ð.Ð.Ø× Ò  ¤Ñ+Ô+Ð+ð Ô˜\Ð*ØŒN˜<Ð(Ð(Ð(r@   c                 ó‚   — |€t          d¦  «        ‚| j                             |¦  «        }|                      |¦  «        S )a$  Determine or set the transaction id associated with a file ID.
        A new id is only created for file_ids that were never present.  If
        a transaction has been unversioned, it is deliberately still returned.
        (this will likely lead to an unversioned parent conflict.)
        NzNone is not a valid file id)r_   rD   Úparse_file_idr7   )r;   Úfile_idÚpaths      r?   Útrans_id_file_idz"TreeTransformBase.trans_id_file_id¡   sA   € ð ˆ?ÝÐ:Ñ;Ô;Ð;ØŒ|×)Ò)¨'Ñ2Ô2ˆØ×&Ò& tÑ,Ô,Ð,r@   c                 óv   — || j         v rt          j        |¬¦  «        ‚| j                              |¦  «         dS )z$Schedule a file to become versioned.©ÚkeyN)r6   r   ÚDuplicateKeyÚadd)r;   rR   rs   s      r?   Úversion_filezTreeTransformBase.version_file¬   s?   € à�t”Ð&Ð&ÝÔ%¨(Ð3Ñ3Ô3Ð3ØŒ×Ò˜HÑ%Ô%Ð%Ð%Ð%r@   c                 ó*   — t          | j        ¦  «        ‚)ú$Undo a previous versioning of a file)ÚNotImplementedErrorr`   ©r;   rR   s     r?   r`   z#TreeTransformBase.cancel_versioning²   s   € å! $Ô"8Ñ9Ô9Ð9r@   Fc                 ó  — t          ¦   «         }|r‘| j                             | j        ¦  «        }|                     | j        ¦  «         |                     | j        ¦  «         |                     | j        ¦  «         | j                             |¦  «        }|| j        f}n | j        | j        | j        | j        | j        f}|D ]}| 	                    |¦  «         Œt          t          | ¦  «                             |¦  «        ¦  «        S )z½Determine the paths of all new and changed files.

        :param filesystem_only: if True, only calculate values for files
            that require renames or execute bit changes.
        )r5   Ú_needs_renameÚ
differencerN   Údifference_updaterO   rh   r6   Ú_new_executabilityÚupdateÚsortedr"   Ú	get_paths)r;   Úfilesystem_onlyÚnew_idsÚ	stale_idsÚneeds_renameÚid_setsÚid_sets          r?   Ú	new_pathszTreeTransformBase.new_paths¶   s   € õ ‘%”%ˆØð 		AØÔ*×5Ò5°d´nÑEÔEˆIØ×'Ò'¨Ô(8Ñ9Ô9Ð9Ø×'Ò'¨Ô(:Ñ;Ô;Ð;Ø×'Ò'¨¬Ñ8Ô8Ð8ØÔ-×8Ò8¸ÑCÔCˆLØ# TÔ%<Ð=ˆGˆGà”~ tÔ'7¸Ô9KØ”¨Ô(?ðAˆGàð 	#ð 	#ˆFØ�NŠN˜6Ñ"Ô"Ð"Ð"Ý•j Ñ&Ô&×0Ò0°Ñ9Ô9Ñ:Ô:Ð:r@   c                 ó”   — || j         v rdS || j        v rdS |                      |¦  «        }|€dS | j                             |¦  «        S )NTF)r6   Ú_removed_idÚ	tree_pathrC   Úis_versioned)r;   rR   Ú	orig_paths      r?   Úfinal_is_versionedz$TreeTransformBase.final_is_versionedË   sY   € Ø�t”Ð&Ð&Ø�4Ø�tÔ'Ð'Ð'Ø�5Ø—N’N 8Ñ,Ô,ˆ	ØÐØ�5ØŒz×&Ò& yÑ1Ô1Ð1r@   c                 ó$  — | j         du rt          ¦   «         ‚g }|                      ¦   «          |                      ¦   «         } |j        |                      ¦   «         ¦  «          |j        |                      |¦  «        ¦  «          |j        |                      |¦  «        ¦  «          |j        |                      ¦   «         ¦  «          |j        |  	                    ¦   «         ¦  «          |j        |  
                    ¦   «         ¦  «         |S )z9Find any violations of inventory or filesystem invariantsT)Ú_doner(   Ú_add_tree_childrenrd   ÚextendÚ_parent_loopsÚ_duplicate_entriesÚ_parent_type_conflictsÚ_improper_versioningÚ_executability_conflictsÚ_overwrite_conflicts)r;   r   rd   s      r?   Úfind_raw_conflictsz$TreeTransformBase.find_raw_conflictsÕ   s  € àŒ:˜ÐÐÝ"Ñ$Ô$Ð$Øˆ	ð 	×ÒÑ!Ô!Ð!Ø—N’NÑ$Ô$ˆ	Øˆ	Ô˜×+Ò+Ñ-Ô-Ñ.Ô.Ð.Øˆ	Ô˜×0Ò0°Ñ;Ô;Ñ<Ô<Ð<Øˆ	Ô˜×4Ò4°YÑ?Ô?Ñ@Ô@Ð@Øˆ	Ô˜×2Ò2Ñ4Ô4Ñ5Ô5Ð5Øˆ	Ô˜×6Ò6Ñ8Ô8Ñ9Ô9Ð9Øˆ	Ô˜×2Ò2Ñ4Ô4Ñ5Ô5Ð5ØÐr@   c                 ót   — |                       ¦   «         }t          |¦  «        dk    rt          |¬¦  «        ‚d S )Nr   )r   )rŸ   r^   r)   )r;   r   s     r?   Ú_check_malformedz"TreeTransformBase._check_malformedæ   s=   € Ø×+Ò+Ñ-Ô-ˆ	Ýˆy‰>Œ>˜QÒÐÝ$¨yÐ9Ñ9Ô9Ð9ð Ðr@   c                 ó  ‡ — t          ‰                      ¦   «         ¦  «        }|                     ˆ fd„‰ j        D ¦   «         ¦  «         ‰ j        D ]‘}‰                      |¦  «        }|�J	 ‰ j                             |¦  «        dk    r|                     |¦  «         ŒN# t          j
        $ r Y Œ_w xY w‰                      |¦  «        dk    r|                     |¦  «         Œ’|D ]$}t          ‰                      |¦  «        ¦  «         Œ%dS )zÛAdd all the children of all active parents to the known paths.

        Active parents are those which gain children, and those which are
        removed.  This is a necessary first step in detecting conflicts.
        c                 óF   •— g | ]}‰                      |¦  «        d k    ¯|‘ŒS )Ú	directory)Ú	tree_kind©rY   Útr;   s     €r?   r\   z8TreeTransformBase._add_tree_children.<locals>.<listcomp>ò   s9   ø€ ð :ð :ð :˜aØŸš qÑ)Ô)¨[Ò8Ð8ð Ø8Ð8Ð8r@   Nr¤   )rb   rd   r˜   rk   r�   r‘   rC   Ústored_kindÚappendÚ_mod_transportÚ
NoSuchFiler¥   rc   )r;   ÚparentsrR   rt   Ú	parent_ids   `    r?   r—   z$TreeTransformBase._add_tree_childrenë   s;  ø€ õ �t—~’~Ñ'Ô'Ñ(Ô(ˆØ�Šð :ð :ð :ð : 4Ô#9ð :ñ :ô :ñ 	;ô 	;ð 	;àÔ(ð 		)ð 		)ˆHØ—>’> (Ñ+Ô+ˆDØÐðØ”z×-Ò-¨dÑ3Ô3°{ÒBÐBØŸš xÑ0Ô0Ð0øøÝ%Ô0ð ð ð Ø�Dðøøøà—’ Ñ)Ô)¨[Ò8Ð8Ø—’˜xÑ(Ô(Ð(øà ð 	5ð 	5ˆIå�×(Ò(¨Ñ3Ô3Ñ4Ô4Ð4Ð4ð	5ð 	5s   Á*3BÂB0Â/B0c                 ó¸  — |€(|                       ¦   «                              |g ¦  «        }|D ]}|                      |¦  «        |k    r dS Œ| j                             |d¦  «        }|€dS t	          ||¦  «        }| j                             |d¦  «        }|€,t          j        | j         	                    |¦  «        ¦  «        S t          d|›d|›d|›�¦  «        ‚)ab  Does a parent already have a name child.

        :param name: The searched for name.

        :param parent_id: The parent for which the check is made.

        :param known_children: The already known children. This should have
            been recently obtained from `self.by_parent.get(parent_id)`
            (or will be if None is passed).
        NTFzchild_id is missing: z, )rd   re   rg   Ú_tree_id_pathsr#   Ú_tree_path_idsr   ÚlexistsrC   ÚabspathÚAssertionError)r;   rP   r­   Úknown_childrenro   Úparent_pathÚ
child_pathÚchild_ids           r?   Ú_has_named_childz"TreeTransformBase._has_named_child  sø   € ð Ð!Ø!Ÿ^š^Ñ-Ô-×1Ò1°)¸RÑ@Ô@ˆNØ#ð 	ð 	ˆEØ�Š˜uÑ%Ô%¨Ò-Ð-Ø�t�tð .àÔ)×-Ò-¨i¸Ñ>Ô>ˆØÐà�5Ý˜k¨4Ñ0Ô0ˆ
ØÔ&×*Ò*¨:°tÑ<Ô<ˆØÐå”? 4¤:×#5Ò#5°jÑ#AÔ#AÑBÔBÐBå �.Ø$( D D¨)¨)¨)°X°Xð"?ñ @ô @ð @r@   c                 óŒ   ‡ ‡‡— ‰                       ¦   «                              ‰g ¦  «        Št          j        |ˆˆ ˆfd„¦  «        S )z¸Find an available backup name.

        :param name: The basename of the file.

        :param target_id: The directory trans_id where the backup should
            be placed.
        c                 ó2   •— ‰                      | ‰‰¦  «        S rB   )r¸   )Úbaser´   r;   Ú	target_ids    €€€r?   ú<lambda>z:TreeTransformBase._available_backup_name.<locals>.<lambda>+  s   ø€ ˜×.Ò.Ø�i ñ1ô 1€ r@   )rd   re   r   Úavailable_backup_name)r;   rP   r¼   r´   s   ` `@r?   Ú_available_backup_namez(TreeTransformBase._available_backup_name   s\   øøø€ ð ŸšÑ)Ô)×-Ò-¨i¸Ñ<Ô<ˆÝÔ,Øð1ð 1ð 1ð 1ð 1ð 1ñ2ô 2ð 	2r@   c              #   ó  K  — | j         D ]u}t          ¦   «         }|}|t          k    rX|                     |¦  «         	 |                      |¦  «        }n# t
          $ r Y n w xY w||k    rd|fV — ||v rn|t          k    °XŒvdS )z#No entry should be its own ancestorúparent loopN)rO   r5   r'   rz   Úfinal_parentÚKeyError)r;   rR   Úseenr­   s       r?   r™   zTreeTransformBase._parent_loops.  s¿   è è € àÔ(ð 	ð 	ˆHÝ‘5”5ˆDØ ˆIØ�{Ò*Ð*Ø—’˜Ñ#Ô#Ð#ðØ $× 1Ò 1°)Ñ <Ô <�I�IøÝð ð ð Ø�Eðøøøà Ò(Ð(Ø(¨(Ð3Ð3Ð3Ð3Ø Ð$Ð$Øð �{Ò*Ð*øð	ð 	s   ½AÁ
A ÁA c              #   óÜ   K  — | j         D ]a}|                      |¦  «        }|dk    r| j                             ¦   «         sŒ7|€d|fV — Œ@| j                             |¦  «        sd||fV — ŒbdS )z}Cannot version a file with no contents, or a bad type.

        However, existing entries with no contents are okay.
        ÚsymlinkNzversioning no contentszversioning bad kind)r6   Ú
final_kindrC   Úsupports_symlinksÚversionable_kind)r;   rR   Úkinds      r?   rœ   z&TreeTransformBase._improper_versioning>  sš   è è € ð
 œð 		>ð 		>ˆHØ—?’? 8Ñ,Ô,ˆDØ�yÒ Ð ¨¬×)EÒ)EÑ)GÔ)GÐ àØˆ|Ø/°Ð:Ð:Ð:Ð:ØØ”:×.Ò.¨tÑ4Ô4ð >Ø,¨h¸Ð=Ð=Ð=Ð=øð		>ð 		>r@   c              #   ó”   K  — | j         D ]=}|                      |¦  «        sd|fV — Œ|                      |¦  «        dk    rd|fV — Œ>dS )a2  Check for bad executability changes.

        Only versioned files may have their executability set, because
        1. only versioned entries can have executability under windows
        2. only files can be executable.  (The execute bit on a directory
           does not indicate searchability)
        zunversioned executabilityÚfileznon-file executabilityN)r„   r”   rÇ   r   s     r?   r�   z*TreeTransformBase._executability_conflictsN  sw   è è € ð Ô/ð 	?ð 	?ˆHØ×*Ò*¨8Ñ4Ô4ð ?Ø2°HÐ=Ð=Ð=Ð=Ð=à—?’? 8Ñ,Ô,°Ò6Ð6Ø3°XÐ>Ð>Ð>Ð>øð	?ð 	?r@   c              #   ó�   K  — | j         D ];}|                      |¦  «        €Œ|| j        vrd||                      |¦  «        fV — Œ<dS )z-Check for overwrites (not permitted on Win32)NÚ	overwrite)rh   r¥   rk   rg   r   s     r?   rž   z&TreeTransformBase._overwrite_conflicts]  si   è è € àÔ*ð 	Ið 	IˆHØ�~Š~˜hÑ'Ô'Ð/ØØ˜tÔ5Ð5Ð5Ø" H¨d¯oªo¸hÑ.GÔ.GÐHÐHÐHÐHøð		Ið 	Ir@   c              #   óÂ  K  — | j         | j        fi i fk    rdS |                     ¦   «         D ]±}g }|D ]K}|                      |¦  «        }|�2| j        s|                     ¦   «         }|                     ||f¦  «         ŒL|                     ¦   «          d}d}|D ]D\  }}|                      |¦  «        }	|	€|  	                    |¦  «        sŒ2||k    rd|||fV — |}|}ŒEŒ²dS )z5No directory may have two entries with the same name.NÚ	duplicate)
rN   rO   Úvaluesrg   r9   Úlowerr©   ÚsortrÇ   r”   )
r;   rd   ÚchildrenÚname_idsÚ	child_tidrP   Ú	last_nameÚlast_trans_idrR   rÊ   s
             r?   rš   z$TreeTransformBase._duplicate_entriese  s*  è è € àŒN˜DÔ,Ð-°"°b°Ò9Ð9ØˆFØ!×(Ò(Ñ*Ô*ð 	)ð 	)ˆHØˆHØ%ð 7ð 7�	Ø—’ yÑ1Ô1�ØÐ#àÔ6ð ,Ø#Ÿzšz™|œ|˜Ø—O’O T¨9Ð$5Ñ6Ô6Ð6øØ�MŠM‰OŒOˆOØˆIØ ˆMØ"*ð )ð )‘��hØ—’ xÑ0Ô0�Ø�<¨×(?Ò(?ÀÑ(IÔ(I�<ØØ˜9Ò$Ð$Ø&¨°xÀÐFÐFÐFÐFØ �	Ø (��ð)ð	)ð 	)r@   c              #   óð   K  — |                      ¦   «         D ]^\  }}|t          k    rŒd}|D ]}|                      |¦  «        �d} nŒ|rŒ4|                      |¦  «        }|€d|fV — ŒR|dk    rd|fV — Œ_dS )z%Children must have a directory parentTNFúmissing parentr¤   únon-directory parent)r]   r'   rÇ   )r;   rd   r­   rÔ   Úno_childrenr·   rÊ   s          r?   r›   z(TreeTransformBase._parent_type_conflicts~  sÇ   è è € à#,§?¢?Ñ#4Ô#4ð 	:ð 	:ÑˆI�xØ�KÒ'Ð'ØØˆKØ$ð ð �Ø—?’? 8Ñ,Ô,Ð8Ø"'�KØ�Eð 9ð ð Øð —?’? 9Ñ-Ô-ˆDØˆ|à'¨Ð3Ð3Ð3Ð3Ð3Ø˜Ò$Ð$à-¨yÐ9Ð9Ð9Ð9øð%	:ð 	:r@   c                 ó�  — | j                              ¦   «         r¬| j        |         }| j                              |¦  «        }t	          j        |¦  «        j        }|rNt	          j        d¦  «        }t	          j        |¦  «         |d| z  z  }|dz  r	|d| z  z  }|dz  r	|d| z  z  }n|dz  }t          j	        ||¦  «         dS dS )	z)Set the executability of versioned files r   é@   é   r   é    é   i¶ÿÿÿN)
rC   Ú_supports_executabler„   r²   ÚosÚstatÚst_modeÚumaskr   Úchmod_if_possible)r;   rt   rR   Únew_executabilityr²   Úcurrent_moderæ   Úto_modes           r?   Ú_set_executabilityz$TreeTransformBase._set_executability”  sç   € àŒ:×*Ò*Ñ,Ô,ð 	8Ø $Ô 7¸Ô AÐØ”j×(Ò(¨Ñ.Ô.ˆGÝœ7 7Ñ+Ô+Ô3ˆLØ ð 
0Ýœ ™œ�Ý”˜‘”�Ø&¨%°5°&©.Ñ9�à %Ñ'ð .Ø˜u¨ v™~Ñ-�GØ %Ñ'ð .Ø˜u¨ v™~Ñ-�Gøà&¨Ñ/�ÝÔ% g¨wÑ7Ô7Ð7Ð7Ð7ð	8ð 	8r@   c                 ód   — |                       ||¦  «        }|�|                      ||¬¦  «         |S )z1Helper function to create a new filesystem entry.N)rs   )rS   r{   ©r;   rP   r­   rs   rR   s        r?   Ú
_new_entryzTreeTransformBase._new_entry§  s;   € à×#Ò# D¨)Ñ4Ô4ˆØÐØ×Ò˜h°ÐÑ8Ô8Ð8Øˆr@   c                 ó”   — |                       |||¦  «        }|                      |||¬¦  «         |�|                      ||¦  «         |S )a¢  Convenience method to create files.

        name is the name of the file to create.
        parent_id is the transaction id of the parent directory of the file.
        contents is an iterator of bytestrings, which will be used to produce
        the file.
        :param file_id: The inventory ID of the file, if it is to be versioned.
        :param executable: Only valid when a file_id has been supplied.
        )Úsha1)rî   Úcreate_fileÚset_executability)r;   rP   r­   Úcontentsrs   Ú
executablerð   rR   s           r?   Únew_filezTreeTransformBase.new_file®  sW   € ð —?’? 4¨°GÑ<Ô<ˆð 	×Ò˜ 8°$ÐÑ7Ô7Ð7ØÐ!Ø×"Ò" :¨xÑ8Ô8Ð8Øˆr@   c                 ó^   — |                       |||¦  «        }|                      |¦  «         |S )a  Convenience method to create directories.

        name is the name of the directory to create.
        parent_id is the transaction id of the parent directory of the
        directory.
        file_id is the inventory ID of the directory, if it is to be versioned.
        )rî   Úcreate_directoryrí   s        r?   Únew_directoryzTreeTransformBase.new_directoryÁ  s2   € ð —?’? 4¨°GÑ<Ô<ˆØ×Ò˜hÑ'Ô'Ð'Øˆr@   c                 ó`   — |                       |||¦  «        }|                      ||¦  «         |S )a@  Convenience method to create symbolic link.

        name is the name of the symlink to create.
        parent_id is the transaction id of the parent directory of the symlink.
        target is a bytestring of the target of the symlink.
        file_id is the inventory ID of the file, if it is to be versioned.
        )rî   Úcreate_symlink)r;   rP   r­   Útargetrs   rR   s         r?   Únew_symlinkzTreeTransformBase.new_symlinkÍ  s4   € ð —?’? 4¨°GÑ<Ô<ˆØ×Ò˜F HÑ-Ô-Ð-Øˆr@   c                 ó*   — t          | j        ¦  «        ‚)a?  Schedule an item to be orphaned.

        When a directory is about to be removed, its children, if they are not
        versioned are moved out of the way: they don't have a parent anymore.

        :param trans_id: The trans_id of the existing item.
        :param parent_id: The parent trans_id of the item.
        ©r~   Ú
new_orphan©r;   rR   r­   s      r?   rÿ   zTreeTransformBase.new_orphanÙ  s   € õ " $¤/Ñ2Ô2Ð2r@   c                 ó²   — g }|                       ¦   «         |         D ]9}|| j        v rŒ|                      |¦  «        s|                     |¦  «         Œ7d} |S )aõ  Find the potential orphans in a directory.

        A directory can't be safely deleted if there are versioned files in it.
        If all the contained files are unversioned then they can be orphaned.

        The 'None' return value means that the directory contains at least one
        versioned file and should not be deleted.

        :param dir_id: The directory trans id.

        :return: A list of the orphan trans ids or None if at least one
             versioned file is present.
        N)rd   rk   r”   r©   )r;   Údir_idÚorphansrÖ   s       r?   Ú_get_potential_orphansz(TreeTransformBase._get_potential_orphansä  st   € ð ˆàŸšÑ)Ô)¨&Ô1ð 	ð 	ˆIØ˜DÔ2Ð2Ð2ð Ø×*Ò*¨9Ñ5Ô5ð à—’˜yÑ)Ô)Ð)Ð)ð �ØØˆr@   c                 óf  — t          | j        ¦  «        }|                     | j        ¦  «         |                     | j        ¦  «         |                     | j        ¦  «         |                     | j        ¦  «         |                     | j        ¦  «         |                     | j        ¦  «         |S )z9Return the set of transform ids affected by the transform)	r5   r�   r…   r6   rk   rh   r„   rN   rO   )r;   Ú	trans_idss     r?   Ú_affected_idszTreeTransformBase._affected_ids  s    € å˜Ô(Ñ)Ô)ˆ	Ø×Ò˜œÑ)Ô)Ð)Ø×Ò˜Ô/Ñ0Ô0Ð0Ø×Ò˜Ô+Ñ,Ô,Ð,Ø×Ò˜Ô0Ñ1Ô1Ð1Ø×Ò˜œÑ(Ô(Ð(Ø×Ò˜Ô)Ñ*Ô*Ð*ØÐr@   c                 óð  — t          | ¦  «        }|                      ¦   «         }g }|D �]­}|                      |¦  «        }d}|€d}n| j                             |¦  «        }|s|sd}|                     |¦  «        }	|	€d}
n|                      |¦  «        }
|s|
sd}	|r7t          | j                             |g¬¦  «        ¦  «        d         }|j	        }n&d}|€d}nt          j                             |¦  «        }|� | j                             ||¦  «        \  }}}nd}d}|                      |¦  «        }|                      |¦  «        }|| j        v r| j        |         }n|}|r	||k    rd}n|dv r|| j        v rd}|s||
k    r||	k    r||k    r||k    r�Œr||	fdk    r�Œ||                     t'          ||	f|||
f||f||f||f¦  «        ¦  «         �Œ¯d„ }t)          t+          ||¬	¦  «        ¦  «        S )
zãProduce output in the same format as Tree.iter_changes.

        Will produce nonsensical results if invoked while inventory/filesystem
        conflicts (as reported by TreeTransform.find_raw_conflicts()) are present.
        FN©Úspecific_filesr   T)rÌ   rÆ   ©NNc                 ó>   — | j         d         pd| j         d         pdfS )Nr   r1   r   )rt   )Úcs    r?   Úpath_keyz0TreeTransformBase.iter_changes.<locals>.path_keyZ  s!   € Ø”F˜1”I�O  Q¤V¨A¤Y _°"Ð5Ð5r@   rw   )r"   r  r‘   rC   r’   Úget_pathr”   ÚnextÚiter_entries_by_dirrP   rã   rt   ÚbasenameÚ_comparison_datarg   rÇ   r„   rh   r©   r   Úiterr†   )r;   Úwant_unversionedÚfinal_pathsr  ÚresultsrR   Ú	from_pathÚmodifiedÚfrom_versionedÚto_pathÚto_versionedÚ
from_entryÚ	from_nameÚ	from_kindÚfrom_executableÚ
from_statsÚto_nameÚto_kindÚto_executabler  s                       r?   Úiter_changeszTreeTransformBase.iter_changes  s¯  € õ ! Ñ&Ô&ˆØ×&Ò&Ñ(Ô(ˆ	Øˆà!ð @	7ñ @	7ˆHØŸš xÑ0Ô0ˆIØˆHàÐ Ø!&��à!%¤×!8Ò!8¸Ñ!CÔ!C�Ø#ð !¨Nð !Ø �	Ø!×*Ò*¨8Ñ4Ô4ˆGØˆØ$��à#×6Ò6°xÑ@Ô@�Ø#ð ¨Lð Ø�àð <å! $¤*×"@Ò"@Ø$- ;ð #Añ #0ô #0ñ 1ô 1Ø12ô4�
à&œO�	�	à!�
ØÐ$à $�I�Iõ !#¤× 0Ò 0°Ñ ;Ô ;�IØÐ$à”J×/Ò/°
¸IÑFÔFñ 7�	˜?¨J¨Jð !�	Ø"'�à—o’o hÑ/Ô/ˆGØ—o’o hÑ/Ô/ˆGØ˜4Ô2Ð2Ð2Ø $Ô 7¸Ô A��à /�àð   )¨wÒ"6Ð"6Ø��ØÐ/Ð/Ð/Ø Ô 2Ð2Ð2Ø�Øð  °<Ò!?Ð!?Ø Ò(Ð(Ø Ò(Ð(Ø'¨=Ò8Ð8ÙØ˜7Ð# |Ò3Ð3ÙØ�NŠNÝØ Ð(¨(Ø# \Ð2Ø Ð(Ø Ð(Ø$ mÐ4ñ6ô 6ñ7ô 7ð 7ñ 7ð	6ð 	6ð 	6å•F˜7¨Ð1Ñ1Ô1Ñ2Ô2Ð2r@   c                 ó    — t          | ¦  «        S )zœReturn a tree representing the result of the transform.

        The tree is a snapshot, and altering the TreeTransform will invalidate
        it.
        )ÚGitPreviewTreerE   s    r?   Úget_preview_treez"TreeTransformBase.get_preview_tree^  s   € õ ˜dÑ#Ô#Ð#r@   c                 óì  — |                       ¦   «          |rft          | j        ¦  «                             t          | j        ¦  «        ¦  «        }|D ]*}|                      |¦  «        st          j        ¦   «         ‚Œ+|                     ¦   «         \  }}|t          j
        k    r|�t          d¦  «        ‚g }n|g}|�|                     |¦  «         | j                             ¦   «         |k    r<t          d| j                             ¦   «                              d¦  «        z  ¦  «        ‚ddlm} |j                             |	||¦  «        }	|                     |||||	|
¬¦  «        }|                      ¦   «         }t-          |                     |||                      ¦   «         ¦  «        ¦  «         |                     ¦   «          |                     |¦  «        }
|                     |dz   |
¦  «         |
S )	a  Commit the result of this TreeTransform to a branch.

        :param branch: The branch to commit to.
        :param message: The message to attach to the commit.
        :param merge_parents: Additional parent revision-ids specified by
            pending merges.
        :param strict: If True, abort the commit if there are unversioned
            files.
        :param timestamp: if not None, seconds-since-epoch for the time and
            date.  (May be a float.)
        :param timezone: Optional timezone for timestamp, as an offset in
            seconds.
        :param committer: Optional committer in email-id format.
            (e.g. "J Random Hacker <jrandom@example.com>")
        :param authors: Optional list of authors in email-id format.
        :param revprops: Optional dictionary of revision properties.
        :param revision_id: Optional revision id.  (Specifying a revision-id
            may reduce performance for some non-native formats.)
        :return: The revision_id of the revision committed.
        Nz-Cannot supply merge parents for first commit.z+TreeTransform not based on branch basis: %súutf-8r   )Úcommit)Ú	timestampÚtimezoneÚ	committerÚrevpropsÚrevision_idr   )r¡   r5   rh   r‚   r6   r”   r   ÚStrictCommitFailedÚlast_revision_infoÚ_mod_revisionÚNULL_REVISIONr_   r˜   rC   Úget_revision_idÚdecoder1   r+  ÚCommitÚupdate_revpropsÚget_commit_builderr(  rb   Úrecord_iter_changesr%  Úfinish_inventoryÚset_last_revision_info)r;   ÚbranchÚmessageÚmerge_parentsÚstrictr,  r-  r.  Úauthorsr/  r0  ÚunversionedrR   ÚrevnoÚlast_rev_idÚ
parent_idsr+  ÚbuilderÚpreviews                      r?   r+  zTreeTransformBase.commitf  s%  € ð. 	×ÒÑÔÐØð 	6Ý˜dÔ0Ñ1Ô1×<Ò<½SÀÄÑ=QÔ=QÑRÔRˆKØ'ð 6ð 6�Ø×.Ò.¨xÑ8Ô8ð 6Ý Ô3Ñ5Ô5Ð5ð6ð $×6Ò6Ñ8Ô8Ñˆˆ{Ø�-Ô5Ò5Ð5ØÐ(Ý ð ",ñ -ô -ð -àˆJˆJà%˜ˆJØÐ(Ø×!Ò! -Ñ0Ô0Ð0ØŒ:×%Ò%Ñ'Ô'¨;Ò6Ð6ÝÐJØ!œZ×7Ò7Ñ9Ô9×@Ò@ÀÑIÔIñJñ Kô Kð KàÐÐÐÐÐØ”=×0Ò0°¸6À7ÑKÔKˆØ×+Ò+¨JØ6?Ø5=Ø6?Ø5=Ø8Cð ,ñ Eô Eˆð ×'Ò'Ñ)Ô)ˆÝˆW×(Ò(¨°+Ø)-×):Ò):Ñ)<Ô)<ñ>ô >ñ 	?ô 	?ð 	?à× Ò Ñ"Ô"Ð"Ø—n’n WÑ-Ô-ˆØ×%Ò% e¨a¡i°Ñ=Ô=Ð=ØÐr@   c                 ó¤   — |                       |¦  «        }	 |�| j                             |¦  «        dk    rd S n# t          j        $ r Y d S w xY w|S )NrÌ   )r‘   rC   rÊ   rª   r«   ©r;   rR   rt   s      r?   Ú_text_parentzTreeTransformBase._text_parent¡  si   € Ø�~Š~˜hÑ'Ô'ˆð	Øˆ|˜tœzŸš¨tÑ4Ô4¸Ò>Ð>Ø�tð  ?øåÔ(ð 	ð 	ð 	Ø�4�4ð	øøøàˆs   — : ºAÁAc                 ój   — |                       |¦  «        }|€dS | j                             |¦  «        fS )z/Get texts for compression parents of this file.NrU   )rJ  rC   Úget_file_textrI  s      r?   Ú_get_parents_textsz$TreeTransformBase._get_parents_textsª  s8   € à× Ò  Ñ*Ô*ˆØˆ<Ø�2Ø”
×(Ò(¨Ñ.Ô.Ð0Ð0r@   c                 ój   — |                       |¦  «        }|€dS | j                             |¦  «        fS )z/Get lines for compression parents of this file.NrU   )rJ  rC   Úget_file_linesrI  s      r?   Ú_get_parents_linesz$TreeTransformBase._get_parents_lines±  s8   € à× Ò  Ñ*Ô*ˆØˆ<Ø�2Ø”
×)Ò)¨$Ñ/Ô/Ð1Ð1r@   c                 ó*   — t          | j        ¦  «        ‚)áP  Schedule creation of a new file.

        :seealso: new_file.

        :param contents: an iterator of strings, all of which will be written
            to the target destination.
        :param trans_id: TreeTransform handle
        :param mode_id: If not None, force the mode of the target file to match
            the mode of the object referenced by mode_id.
            Otherwise, we will try to preserve mode bits of an existing file.
        :param sha1: If the sha1 of this content is already known, pass it in.
            We can use it to prevent future sha1 computations.
        )r~   rñ   )r;   ró   rR   Úmode_idrð   s        r?   rñ   zTreeTransformBase.create_file¸  s   € õ " $Ô"2Ñ3Ô3Ð3r@   c                 ó*   — t          | j        ¦  «        ‚)úOSchedule creation of a new directory.

        See also new_directory.
        )r~   r÷   r   s     r?   r÷   z"TreeTransformBase.create_directoryÈ  s   € õ
 " $Ô"7Ñ8Ô8Ð8r@   c                 ó*   — t          | j        ¦  «        ‚)úqSchedule creation of a new symbolic link.

        target is a bytestring.
        See also new_symlink.
        )r~   rú   ©r;   rû   rR   s      r?   rú   z TreeTransformBase.create_symlinkÏ  s   € õ " $Ô"5Ñ6Ô6Ð6r@   c                 ó*   — t          | j        ¦  «        ‚rB   )r~   Úcreate_tree_referencerX  s      r?   rZ  z'TreeTransformBase.create_tree_reference×  s   € Ý! $Ô"<Ñ=Ô=Ð=r@   c                 ó*   — t          | j        ¦  «        ‚)ú Schedule creation of a hard link)r~   Úcreate_hardlink)r;   rt   rR   s      r?   r]  z!TreeTransformBase.create_hardlinkÚ  ó   € å! $Ô"6Ñ7Ô7Ð7r@   c                 ó*   — t          | j        ¦  «        ‚)ú)Cancel the creation of new file contents.)r~   ri   r   s     r?   ri   z!TreeTransformBase.cancel_creationÞ  r^  r@   c                 ó*   — t          | j        ¦  «        ‚)á�  Apply all changes to the inventory and filesystem.

        If filesystem or inventory conflicts are present, MalformedTransform
        will be thrown.

        If apply succeeds, finalize is not necessary.

        :param no_conflicts: if True, the caller guarantees there are no
            conflicts, so no check is made.
        :param _mover: Supply an alternate FileMover, for testing
        )r~   Úapply)r;   Úno_conflictsÚ_movers      r?   rc  zTreeTransformBase.applyâ  s   € õ " $¤*Ñ-Ô-Ð-r@   c              #   óº  K  — |sdS t          | ¦  «        }ddlm} |D �]»}|d         dk    r' ||                     |d         ¦  «        ¦  «        V — Œ6|d         dk    r' ||                     |d         ¦  «        ¦  «        V — Œi|d         dk    r- ||                     |d         d         ¦  «        ¦  «        V — Œ¢|d         d	k    r' ||                     |d         ¦  «        ¦  «        V — ŒÕ|d         d
k    r( ||                     |d         ¦  «        ¦  «        V — �Œ	|d         dk    r( ||                     |d         ¦  «        ¦  «        V — �Œ=|d         dk    r( ||                     |d         ¦  «        ¦  «        V — �Œq|d         dk    r( ||                     |d         ¦  «        ¦  «        V — �Œ¥t	          d|d         z  ¦  «        ‚dS )z8Generate a list of cooked conflicts, sorted by file pathNr   )ÚTextConflictr   ztext conflictrÐ   r   zcontents conflictrÚ   rÛ   zdeleting parentrÁ   zpath conflictzunknown conflict %s)r"   Úworkingtreerg  r  r³   )r;   Úraw_conflictsÚfprg  r  s        r?   Úcook_conflictsz TreeTransformBase.cook_conflictsð  s/  è è € àð 	ØˆFÝ˜ÑÔˆØ-Ð-Ð-Ð-Ð-Ð-Øð 	Cñ 	CˆAØ�Œt�Ò&Ð&Ø"�l 2§;¢;¨q°¬tÑ#4Ô#4Ñ5Ô5Ð5Ð5Ð5Ð5Ø�1”˜Ò$Ð$Ø"�l 2§;¢;¨q°¬tÑ#4Ô#4Ñ5Ô5Ð5Ð5Ð5Ð5Ø�1”Ð,Ò,Ð,Ø"�l 2§;¢;¨q°¬t°A¬wÑ#7Ô#7Ñ8Ô8Ð8Ð8Ð8Ð8Ø�1”Ð)Ò)Ð)à"�l 2§;¢;¨q°¬tÑ#4Ô#4Ñ5Ô5Ð5Ð5Ð5Ð5Ø�1”Ð/Ò/Ð/Ø"�l 2§;¢;¨q°¬tÑ#4Ô#4Ñ5Ô5Ð5Ð5Ð5Ñ5Ø�1”Ð*Ò*Ð*à"�l 2§;¢;¨q°¬tÑ#4Ô#4Ñ5Ô5Ð5Ð5Ð5Ñ5Ø�1”˜Ò&Ð&à"�l 2§;¢;¨q°¬tÑ#4Ô#4Ñ5Ô5Ð5Ð5Ð5Ñ5Ø�1”˜Ò(Ð(Ø"�l 2§;¢;¨q°¬tÑ#4Ô#4Ñ5Ô5Ð5Ð5Ð5Ñ5å$Ð%:¸Q¸q¼TÑ%AÑBÔBÐBð+	Cð 	Cr@   ©NTrB   ©F)NNN)NFNNNNNNr  ©FN)2Ú__name__Ú
__module__Ú__qualname__Ú__doc__r3   ÚpropertyrD   rK   rS   rV   rp   ru   r{   r`   rŽ   r”   rŸ   r¡   r—   r¸   r¿   r™   rœ   r�   rž   rš   r›   rë   rî   rõ   rø   rü   rÿ   r  r  r%  r(  r+  rJ  rM  rP  rñ   r÷   rú   rZ  r]  ri   rc  rk  Ú__classcell__©r>   s   @r?   r.   r.   ?   s*  ø€ € € € € Ø7Ð7ð"ð "ð "ð "ð "ð "ð( ð"ð "ñ „Xð"ðð ð ðð ð ðð ð ð-)ð -)ð -)ð^	-ð 	-ð 	-ð&ð &ð &ð &ð:ð :ð :ð;ð ;ð ;ð ;ð*2ð 2ð 2ðð ð ð":ð :ð :ð
5ð 5ð 5ð0@ð @ð @ð:2ð 2ð 2ðð ð ð >ð >ð >ð ?ð ?ð ?ðIð Ið Ið)ð )ð )ð2:ð :ð :ð,8ð 8ð 8ð&ð ð ð ;?Ø'+ðð ð ð ð&
ð 
ð 
ð 
ð
ð 
ð 
ð 
ð	3ð 	3ð 	3ðð ð ð>	ð 	ð 	ðN3ð N3ð N3ð N3ð`$ð $ð $ð BGØFJØ*.ð9ð 9ð 9ð 9ðvð ð ð1ð 1ð 1ð2ð 2ð 2ð4ð 4ð 4ð 4ð 9ð 9ð 9ð7ð 7ð 7ð>ð >ð >ð8ð 8ð 8ð8ð 8ð 8ð.ð .ð .ð .ðCð Cð Cð Cð Cð Cð Cr@   r.   c                   ó˜   ‡ — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ Zˆ fd	„Z	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d„ Zd„ Zˆ xZS )ÚDiskTreeTransformz,Tree transform storing its contents on disk.NTc                 ó  — t                                | |||¦  «         || _        d| _        i | _        t          ¦   «         | _        i | _        i | _        t          ¦   «         | _	        d| _
        t          j        | j        ¦  «        | _        dS )a•  Constructor.
        :param tree: The tree that will be transformed, but not necessarily
            the output tree.
        :param limbodir: A directory where new files can be stored until
            they are installed in their proper places
        :param pb: ignored
        :param case_sensitive: If True, the target of the transform is
            case sensitive, not just case preserving.
        N)r.   r3   Ú	_limbodirÚ_deletiondirÚ_limbo_filesr5   Ú_possibly_stale_limbo_filesÚ_limbo_childrenÚ_limbo_children_namesr�   Ú_creation_mtimer   rÈ   Ú_create_symlinks)r;   r<   Úlimbodirr0   r=   s        r?   r3   zDiskTreeTransform.__init__  s‚   € õ 	×"Ò" 4¨¨r°>ÑBÔBÐBØ!ˆŒØ ˆÔàˆÔÝ+.©5¬5ˆÔ(ð  "ˆÔà%'ˆÔ"å ™UœUˆÔØ#ˆÔÝ 'Ô 9¸$¼.Ñ IÔ IˆÔÐÐr@   c                 óÒ  — | j         €dS 	 t          | j                             ¦   «         ¦  «        }|                     | j        ¦  «         |                     d¬¦  «         |D ]D}	 t          j        |¦  «         Œ# t          $ r }|j
        t          j        k    r‚ Y d}~Œ=d}~ww xY w	 t          j        | j        ¦  «         n"# t          $ r t          | j        ¦  «        ‚w xY w	 | j        �t          j        | j        ¦  «         n'# t          $ r t          j        | j        ¦  «        ‚w xY wt"                               | ¦  «         dS # t"                               | ¦  «         w xY w)zªRelease the working tree lock, if held, clean up limbo dir.

        This is required if apply has not been invoked, but can be invoked
        even after apply.
        NT©Úreverse)rC   rb   r{  rÑ   r˜   r|  rÓ   r   Ú
delete_anyÚOSErrorÚerrnoÚENOENTry  r&   rz  r   ÚImmortalPendingDeletionr.   rK   )r;   Úlimbo_pathsrt   Úes       r?   rK   zDiskTreeTransform.finalize+  sž  € ð Œ:ÐØˆFð	-Ý˜tÔ0×7Ò7Ñ9Ô9Ñ:Ô:ˆKØ×Ò˜tÔ?Ñ@Ô@Ð@Ø×Ò TÐÑ*Ô*Ð*Ø#ð ð �ðÝÔ& tÑ,Ô,Ð,Ð,øÝð ð ð Ø”w¥%¤,Ò.Ð.Øð /Ð.Ð.Ð.Ð.øøøøðøøøð4ÝÔ" 4¤>Ñ2Ô2Ð2Ð2øÝð 4ð 4ð 4å# D¤NÑ3Ô3Ð3ð4øøøðHØÔ$Ð0ÝÔ& tÔ'8Ñ9Ô9Ð9øøÝð Hð Hð HÝÔ4°TÔ5FÑGÔGÐGðHøøøõ ×&Ò& tÑ,Ô,Ð,Ð,Ð,øÕ×&Ò& tÑ,Ô,Ð,Ð,øøøsf   ‹AE
 Á&A;Á:E
 Á;
B%ÂB ÂE
 Â B%Â%E
 Â)C ÃE
 ÃC"Ã"E
 Ã& D ÄE
 Ä$D+Ä+E
 Å
E&c                 ó4   — t          j        | j        ¦  «        S )z4Check if the limbo path supports the executable bit.)r   Úsupports_executablery  rE   s    r?   Ú_limbo_supports_executablez,DiskTreeTransform._limbo_supports_executableM  s   € åÔ*¨4¬>Ñ:Ô:Ð:r@   c                 ó|   — | j                              |¦  «        }|€|                      |¦  «        }|| j         |<   |S )z!Generate the limbo name of a file)r{  re   Ú_generate_limbo_path)r;   rR   Ú
limbo_names      r?   Ú_limbo_namezDiskTreeTransform._limbo_nameQ  sD   € àÔ&×*Ò*¨8Ñ4Ô4ˆ
ØÐØ×2Ò2°8Ñ<Ô<ˆJØ*4ˆDÔ˜hÑ'ØÐr@   c                 ój   — | j                              |¦  «         t          j        | j        |¦  «        S )zÔGenerate a limbo path using the trans_id as the relative path.

        This is suitable as a fallback, and when the transform should not be
        sensitive to the path encoding of the limbo directory.
        )r�   rz   r   Úpathjoinry  r   s     r?   r�  z&DiskTreeTransform._generate_limbo_pathY  s0   € ð 	Ô×Ò˜xÑ(Ô(Ð(ÝÔ ¤°Ñ9Ô9Ð9r@   c                 ó’  •— | j                              |¦  «        }| j                             |¦  «        }t          ¦   «                              |||¦  «         || j        v ra|| j        vrZ|                      |g¦  «         ||k    r | j        |          	                    |¦  «         ||k    s||k    r| j
        |         |= d S d S d S d S rB   )rO   re   rN   r2   rf   r{  r�   Ú_rename_in_limbor}  Úremover~  )r;   rP   rQ   rR   Úprevious_parentÚprevious_namer>   s         €r?   rf   zDiskTreeTransform.adjust_pathb  så   ø€ ØÔ*×.Ò.¨xÑ8Ô8ˆØœ×*Ò*¨8Ñ4Ô4ˆÝ‰Œ×Ò˜D &¨(Ñ3Ô3Ð3Ø˜Ô)Ð)Ð)Ø DÔ$6Ð6Ð6Ø×!Ò! 8 *Ñ-Ô-Ð-Ø &Ò(Ð(ØÔ$ _Ô5×<Ò<¸XÑFÔFÐFØ &Ò(Ð(¨M¸TÒ,AÐ,AØÔ.¨Ô?ÀÐNÐNÐNð *Ð)Ø6Ð6ð -BÐ,Ar@   c                 óœ  — |D ]È}| j         |         }| j                             |¦  «         | j         |= || j        vrŒ;|                      |¦  «        }t          j        ||¦  «         | j                             |¦  «         |                      |¦  «        D ]3}| j         |         }||t          |¦  «        d…         z   }|| j         |<   Œ4ŒÉdS )a×  Fix limbo names so that the right final path is produced.

        This means we outsmarted ourselves-- we tried to avoid renaming
        these files later by creating them with their final names in their
        final parents.  But now the previous name or parent is no longer
        suitable, so we have to rename them.

        Even for trans_ids that have no new contents, we must remove their
        entries from _limbo_files, because they are now stale.
        N)
r{  r|  rz   rh   r’  rã   Úrenamer—  Ú_limbo_descendantsr^   )r;   r  rR   Úold_pathÚnew_pathÚ
descendantÚ	desc_paths          r?   r–  z"DiskTreeTransform._rename_in_limbon  sñ   € ð "ð 	:ð 	:ˆHØÔ(¨Ô2ˆHØÔ,×0Ò0°Ñ:Ô:Ð:ØÔ! (Ð+Ø˜tÔ1Ð1Ð1ØØ×'Ò'¨Ñ1Ô1ˆHÝŒI�h Ñ)Ô)Ð)ØÔ,×3Ò3°HÑ=Ô=Ð=Ø"×5Ò5°hÑ?Ô?ð :ð :�
Ø Ô-¨jÔ9�	Ø$ yµ°X±´°°Ô'@Ñ@�	Ø09�Ô! *Ñ-Ð-ð:ð	:ð 	:r@   c                 óÊ   — t          | j                             |g ¦  «        ¦  «        }t          |¦  «        D ]*}|                     |                      |¦  «        ¦  «         Œ+|S )z@Return the set of trans_ids whose limbo paths descend from this.)r5   r}  re   rb   r…   rœ  )r;   rR   ÚdescendantsrŸ  s       r?   rœ  z$DiskTreeTransform._limbo_descendants‡  sf   € å˜$Ô.×2Ò2°8¸RÑ@Ô@ÑAÔAˆÝ˜{Ñ+Ô+ð 	Dð 	DˆJØ×Ò˜t×6Ò6°zÑBÔBÑCÔCÐCÐCØÐr@   c                 ó*   — t          | j        ¦  «        ‚rB   )r~   Ú	_set_mode©r;   rR   rS  Útypefuncs       r?   r¤  zDiskTreeTransform._set_modeŽ  s   € Ý! $¤.Ñ1Ô1Ð1r@   c                 ó|  — |                       |¦  «        }t          |d¦  «        5 }t          | j        |d¦  «         |                     |¦  «         ddd¦  «         n# 1 swxY w Y   |                      |¦  «         |                      ||t          ¦  «         |� |t          j	        |¦  «        f| j
        |<   dS dS )rR  ÚwbrÌ   N)r’  Úopenr$   rh   Ú
writelinesÚ
_set_mtimer¤  r   r   Úlstatr4   )r;   ró   rR   rS  rð   rP   Úfs          r?   rñ   zDiskTreeTransform.create_file‘  sü   € ð ×Ò Ñ)Ô)ˆÝ�$˜ÑÔð 	# Ý�tÔ)¨8°VÑ<Ô<Ð<Ø�LŠL˜Ñ"Ô"Ð"ð	#ð 	#ð 	#ñ 	#ô 	#ð 	#ð 	#ð 	#ð 	#ð 	#ð 	#øøøð 	#ð 	#ð 	#ð 	#ð 	�Š˜ÑÔÐØ�Š�x ­'Ñ2Ô2Ð2ð ÐØ.2µG´MÀ$Ñ4GÔ4GÐ-HˆDÔ  Ñ*Ð*Ð*ð Ðs   ¦,AÁA"Á%A"c                 óP   — t          j        |                      |¦  «        ¦  «        S rB   )rã   Úreadlinkr’  r   s     r?   Ú_read_symlink_targetz&DiskTreeTransform._read_symlink_target«  s    € ÝŒ{˜4×+Ò+¨HÑ5Ô5Ñ6Ô6Ð6r@   c                 ó†   — | j         €t          j        ¦   «         | _         t          j        || j         | j         f¦  «         dS )ztAll files that are created get the same mtime.

        This time is set by the first object to be created.
        N)r  Útimerã   Úutime©r;   rt   s     r?   r«  zDiskTreeTransform._set_mtime®  s>   € ð
 ÔÐ'Ý#'¤9¡;¤;ˆDÔ Ý
Œ�˜Ô,¨dÔ.BÐCÑDÔDÐDÐDÐDr@   c                 óJ  — |                       |¦  «        }	 t          j        ||¦  «         n<# t          $ r/}|j        t          j        k    r‚ t          j        |¦  «        ‚d}~ww xY w	 t          | j	        |d¦  «         dS # t          $ r t          j        |¦  «         ‚ w xY w)r\  NrÌ   )r’  rã   Úlinkr†  r‡  ÚEPERMr   ÚHardLinkNotSupportedr$   rh   ÚBaseExceptionÚunlink)r;   rt   rR   rP   r‹  s        r?   r]  z!DiskTreeTransform.create_hardlink·  s¾   € à×Ò Ñ)Ô)ˆð	4ÝŒG�D˜$ÑÔÐÐøÝð 	4ð 	4ð 	4ØŒw�%œ+Ò%Ð%ØÝÔ-¨dÑ3Ô3Ð3øøøøð	4øøøð	Ý�tÔ)¨8°VÑ<Ô<Ð<Ð<Ð<øÝð 	ð 	ð 	õ ŒI�d‰OŒOˆOØð		øøøs    —- ­
A&·*A!Á!A&Á*B Â B"c                 ó€   — t          j        |                      |¦  «        ¦  «         t          | j        |d¦  «         dS )rU  r¤   N)rã   Úmkdirr’  r$   rh   r   s     r?   r÷   z"DiskTreeTransform.create_directoryÈ  s=   € õ
 	Œ�×!Ò! (Ñ+Ô+Ñ,Ô,Ð,Ý�4Ô% x°Ñ=Ô=Ð=Ð=Ð=r@   c                 ó`  — | j         r)t          j        ||                      |¦  «        ¦  «         ng	 t	          | ¦  «                             |¦  «        }n# t          $ r d}Y nw xY wt          j        d 	                    |¦  «        ¦  «         || j
        |<   t          | j        |d¦  «         dS )rW  Nz1Unable to create symlink "{}" on this filesystem.rÆ   )r€  rã   rÆ   r’  r"   r  rÃ   r   ÚwarningÚformatr:   r$   rh   )r;   rû   rR   rt   s       r?   rú   z DiskTreeTransform.create_symlinkÐ  sÊ   € ð Ô ð 		4ÝŒJ�v˜t×/Ò/°Ñ9Ô9Ñ:Ô:Ð:Ð:ðÝ! $Ñ'Ô'×0Ò0°Ñ:Ô:��øÝð ð ð Ø���ðøøøåŒMØC×JÒJÈ4ÑPÔPñRô Rð Rà-3ˆDÔ  Ñ*õ 	�4Ô% x°Ñ;Ô;Ð;Ð;Ð;s   ²"A ÁA$Á#A$c                 ó¬   — t          j        |                      |¦  «        ¦  «         t          | j        ||¦  «         t          | j        |d¦  «         dS )rW  útree-referenceN)rã   r¼  r’  r$   Ú_new_reference_revisionrh   )r;   Úreference_revisionrR   s      r?   rZ  z'DiskTreeTransform.create_tree_referenceå  sT   € õ 	Œ�×!Ò! (Ñ+Ô+Ñ,Ô,Ð,Ý�4Ô/°Ð;MÑNÔNÐNÝ�4Ô% xÐ1AÑBÔBÐBÐBÐBr@   c                 ó  — | j         |= || j        v r| j        |= | j                             |¦  «        }|�%|                      |¦  «         | j        |= | j        |= t          j        |                      |¦  «        ¦  «         dS )r`  N)	rh   r4   r}  re   r–  r~  r   r…  r’  )r;   rR   rÔ   s      r?   ri   z!DiskTreeTransform.cancel_creationï  s“   € àÔ˜xÐ(Ø�tÔ+Ð+Ð+ØÔ$ XÐ.ØÔ'×+Ò+¨HÑ5Ô5ˆð ÐØ×!Ò! (Ñ+Ô+Ð+ØÔ$ XÐ.ØÔ*¨8Ð4ÝÔ˜4×+Ò+¨HÑ5Ô5Ñ6Ô6Ð6Ð6Ð6r@   c                 ó|   — | j                              ¦   «         }|                     d¦  «        } || ||¦  «         d S )Nztransform.orphan_policy)rC   Úget_config_stackre   )r;   rR   r­   ÚconfÚhandle_orphans        r?   rÿ   zDiskTreeTransform.new_orphaný  sA   € ØŒz×*Ò*Ñ,Ô,ˆØŸšÐ!:Ñ;Ô;ˆØˆ�d˜H iÑ0Ô0Ð0Ð0Ð0r@   c           
      ó4  — |                       |¦  «        }t          | ¦  «        }|                     |¦  «        }|| j        v �rŠ|                      |¦  «        }t          j        |¦  «        }t          |j        ¦  «        }|  	                    |¦  «        }| j
        j                             |¦  «        }	| j
        j                             t
          j                             |¦  «        ¦  «        }
|dk    r't          |	|  	                    |¦  «        |
¬¦  «        |fS t!          |j        ¦  «        }t#          ||¦  «        }t%          t'          |¦  «        |¦  «        }|dk    r&t)          |	||
t+          |j        ¦  «        ¦  «        |fS |dk    r.t/          |	|||
|j        t3          |j        ¦  «        ¬¦  «        |fS t5          |¦  «        ‚|| j        v rdS |                      |¦  «        }|€dS | j
        j                             |¦  «        }	|dk    rd }
n<| j
        j                             t
          j                             |¦  «        ¦  «        }
	 t;          | j
                             |g¬¦  «        ¦  «        d	         }|	|_        |
|_         ||fS # tB          $ ru 	 |  "                    |¦  «        dk    r)t          |	|  	                    |¦  «        |
¬¦  «        |fcY S n-# tF          $ r }|j$        tH          j%        k    r‚ Y d }~nd }~ww xY wY dS w xY w)
Nr¤   )r­   rÆ   rÌ   )rô   r­   Úgit_sha1Ú	text_sizer  r1   r	  r   )&r”   r"   r  rh   r’  rã   r¬  r   rå   rg   rC   rD   Úgenerate_file_idrt   Údirnamer   r   r	   r+   r   r   r   Údatar   Úidr^   r³   rk   r‘   r  r  rs   r­   ÚStopIterationr¥   r†  r‡  ÚENOTDIR)r;   rR   r’   rj  r‘   rt   ÚstrÊ   rP   rs   r­   rô   ÚmodeÚblobr“   Úier‹  s                    r?   Úfinal_entryzDiskTreeTransform.final_entry  sc  € Ø×.Ò.¨xÑ8Ô8ˆÝ˜ÑÔˆØ—K’K Ñ)Ô)ˆ	Ø�tÔ)Ð)Ñ)Ø×#Ò# HÑ-Ô-ˆDÝ”˜$‘”ˆBÝ˜RœZÑ(Ô(ˆDØ—?’? 8Ñ,Ô,ˆDØ”jÔ(×9Ò9¸)ÑDÔDˆGØœ
Ô*×;Ò;½B¼G¿OºOÈIÑ<VÔ<VÑWÔWˆIØ�{Ò"Ð"Ý'Ø˜TŸ_š_¨XÑ6Ô6À)ðMñ Mô MØNZð[ð [å+¨B¬JÑ7Ô7ˆJÝ˜t ZÑ0Ô0ˆDÝ*­?¸4Ñ+@Ô+@À"ÑEÔEˆDØ�yÒ Ð Ý%Ø˜T 9Ý# D¤IÑ.Ô.ñ0ô 0à1=ð>ð >ð ˜’�Ý"Ø˜T¨jÀIØ!œWµ°D´I±´ð@ñ @ô @àAMðNð Nõ % TÑ*Ô*Ð*Ø˜Ô/Ð/Ð/Ø�:àŸš xÑ0Ô0ˆIØÐ Ø!�zØ”jÔ(×9Ò9¸)ÑDÔDˆGØ˜BŠˆØ �	�	à œJÔ.×?Ò?ÅÄÇÂÐPYÑ@ZÔ@ZÑ[Ô[�	ð"Ý˜$œ*×8Ò8Ø$- ;ð 9ñ 0ô 0ñ 1ô 1Ø12ô4�à$�”
Ø(�”Ø˜<Ð'Ð'øÝ ð "ð "ð "ðØ—~’~ hÑ/Ô/°;Ò>Ð>Ý/Ø# T§_¢_°XÑ%>Ô%>È)ð Uñ  Uô  UØVbð cð cð cð cð ?øõ ð ð ð Ø”w¥%¤-Ò/Ð/Øð 0Ð/Ð/Ð/Ð/øøøøðøøøð "�z�zð"øøøsC   ÉA J Ê
LÊ#?K&Ë"LË%LË&
LË0LÌLÌLÌLÌLc                 óÌ  — || j         v r‡|                      |¦  «        }t          j        |¦  «        }t	          |j        ¦  «        }|dk    rdS t          |j        ¦  «        }t          ||¦  «        }t          t          |¦  «        |¦  «        }nÑ|| j
        v rdS |                      |¦  «        }| j                             |¦  «        }| j                             |¦  «        }t          ||¦  «        }|dk    r| j                             |¦  «        }	n8|dk    r| j                             |¦  «        }	n|dk    rdS t#          |¦  «        ‚t%          j        |	¦  «        }||fS )Nr¤   r  rÆ   rÌ   )rh   r’  rã   r¬  r   rå   r   r	   r+   r   rk   r‘   rC   rÊ   Úis_executableÚget_symlink_targetrL  r³   r,   Úfrom_string)
r;   rR   rt   rÒ  rÊ   rô   rÓ  rÔ  r“   ró   s
             r?   Úfinal_git_entryz!DiskTreeTransform.final_git_entry8  s[  € Ø�tÔ)Ð)Ð)Ø×#Ò# HÑ-Ô-ˆDÝ”˜$‘”ˆBÝ˜RœZÑ(Ô(ˆDØ�{Ò"Ð"Ø!�zÝ+¨B¬JÑ7Ô7ˆJÝ˜t ZÑ0Ô0ˆDÝ*­?¸4Ñ+@Ô+@À"ÑEÔEˆDˆDØ˜Ô/Ð/Ð/Ø�:àŸš xÑ0Ô0ˆIØ”:—?’? 9Ñ-Ô-ˆDØœ×1Ò1°)Ñ<Ô<ˆJÝ˜t ZÑ0Ô0ˆDØ�yÒ Ð Øœ:×8Ò8¸ÑCÔC��Ø˜’�Øœ:×3Ò3°IÑ>Ô>��Ø˜Ò$Ð$Ø!�zå$ TÑ*Ô*Ð*ÝÔ# HÑ-Ô-ˆDØ�TˆzÐr@   rl  r  )ro  rp  rq  rr  r3   rK   rŽ  r’  r�  rf   r–  rœ  r¤  rñ   r°  r«  r]  r÷   rú   rZ  ri   rÿ   rÖ  rÛ  rt  ru  s   @r?   rw  rw    sz  ø€ € € € € Ø6Ð6ðJð Jð Jð Jð4 -ð  -ð  -ðD;ð ;ð ;ðð ð ð:ð :ð :ð
Oð 
Oð 
Oð 
Oð 
Oð:ð :ð :ð2ð ð ð2ð 2ð 2ðIð Ið Ið Ið47ð 7ð 7ðEð Eð Eðð ð ð">ð >ð >ð<ð <ð <ð*Cð Cð Cð7ð 7ð 7ð1ð 1ð 1ð
4"ð 4"ð 4"ðlð ð ð ð ð ð r@   rw  c                   óX   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
dd„Zd„ Zd„ Zd„ ZdS )ÚGitTreeTransforma
  Represent a tree transformation.

    This object is designed to support incremental generation of the transform,
    in any order.

    However, it gives optimum performance when parent directories are created
    before their contents.  The transform is then able to put child files
    directly in their parent directory, avoiding later renames.

    It is easy to produce malformed transforms, but they are generally
    harmless.  Attempting to apply a malformed transform will cause an
    exception to be raised before any modifications are made to the tree.

    Many kinds of malformed transforms can be corrected with the
    resolve_conflicts function.  The remaining ones indicate programming error,
    such as trying to create a file with no path.

    Two sets of file creation methods are supplied.  Convenience methods are:
     * new_file
     * new_directory
     * new_symlink

    These are composed of the low-level methods:
     * create_path
     * create_file or create_directory or create_symlink
     * version_file
     * set_executability

    Transform/Transaction ids
    -------------------------
    trans_ids are temporary ids assigned to all files involved in a transform.
    It's possible, even common, that not all files in the Tree have trans_ids.

    trans_ids are used because filenames and file_ids are not good enough
    identifiers; filenames change.

    trans_ids are only valid for the TreeTransform that generated them.

    Limbo
    -----
    Limbo is a temporary directory use to hold new versions of files.
    Files are added to limbo by create_file, create_directory, create_symlink,
    and their convenience variants (new_*).  Files may be removed from limbo
    using cancel_creation.  Files are renamed from limbo into their final
    location as part of TreeTransform.apply

    Limbo must be cleaned up, by either calling TreeTransform.apply or
    calling TreeTransform.finalize.

    Files are placed into limbo inside their parent directories, where
    possible.  This reduces subsequent renames, and makes operations involving
    lots of files faster.  This optimization is only possible if the parent
    directory is created *before* creating any of its children, so avoid
    creating children before parents, where possible.

    Pending-deletion
    ----------------
    This temporary directory is used by _FileMover for storing files that are
    about to be deleted.  In case of rollback, the files will be restored.
    FileMover does not delete files until it is sure that a rollback will not
    happen.
    Nc                 ó  — |                      ¦   «          	 t          j        |j                             d¦  «        ¦  «        }t          j        |t          j        ¦  «         t          j        |j                             d¦  «        ¦  «        }t          j        |t          j	        ¦  «         n## t          $ r |                     ¦   «          ‚ w xY wi | _        i | _        t                               | ||||j        ¦  «         || _        dS )zªNote: a tree_write lock is taken on the tree.

        Use TreeTransform.finalize() to release the lock (can be omitted if
        TreeTransform.apply() called).
        Úlimbozpending-deletionN)Úlock_tree_writer   Úlocal_path_from_urlÚ
_transportr²   r   Úensure_empty_directory_existsr   ÚExistingLimboÚExistingPendingDeletionr¹  rI   Ú
_realpathsÚ	_relpathsrw  r3   r=   rz  )r;   r<   r0   r�  Údeletiondirs        r?   r3   zGitTreeTransform.__init__•  s  € ð 	×ÒÑÔÐð	ÝÔ3Ø”×'Ò'¨Ñ0Ô0ñ2ô 2ˆHåÔ1ØÝÔ$ñ&ô &ð &õ #Ô6Ø”×'Ò'Ð(:Ñ;Ô;ñ=ô =ˆKåÔ1ØÝÔ.ñ0ô 0ð 0ð 0øõ ð 	ð 	ð 	Ø�KŠK‰MŒMˆMØð	øøøð
 ˆŒàˆŒÝ×"Ò" 4¨¨x¸Ø#'Ô#6ñ	8ô 	8ð 	8à'ˆÔÐÐs   –BB- Â- Cc                 ó  — | j                              |¦  «        }|| j        v r| j        |         S t          j                             |¦  «        \  }}|| j        vr't          j                             |¦  «        | j        |<   | j        |         }t          j	        ||¦  «        }|| j        v r6t          j	        | j        |         |¦  «        }| 
                    d¦  «        }n| j                              |¦  «        }|| j        |<   |S )z$Get the canonical tree-relative pathz/\)rC   r²   rç  rã   rt   Úsplitræ  Úrealpathr   r”  ÚrstripÚrelpath)r;   rt   ÚabsrÍ  r  rí  s         r?   Úcanonical_pathzGitTreeTransform.canonical_path³  sñ   € ð Œj× Ò  Ñ&Ô&ˆØ�$”.Ð Ð Ø”> #Ô&Ð&ÝœGŸMšM¨#Ñ.Ô.Ñˆ�Ø˜$œ/Ð)Ð)Ý')¤w×'7Ò'7¸Ñ'@Ô'@ˆDŒO˜GÑ$Ø”/ 'Ô*ˆÝÔ˜w¨Ñ1Ô1ˆØ�d”nÐ$Ð$ÝÔ& t¤~°gÔ'>ÀÑIÔIˆGØ—n’n UÑ+Ô+ˆGˆGà”j×(Ò(¨Ñ-Ô-ˆGØ%ˆŒ�sÑØˆr@   c                 óÄ   — | j                              |¦  «        }|€dS 	 t          j        | j                             |¦  «        ¦  «        S # t          j        $ r Y dS w xY w)zyDetermine the file kind in the working tree.

        :returns: The file kind or None if the file does not exist
        N)r¯   re   r   Ú	file_kindrC   r²   rª   r«   rI  s      r?   r¥   zGitTreeTransform.tree_kindÆ  so   € ð
 Ô"×&Ò& xÑ0Ô0ˆØˆ<Ø�4ð	ÝÔ$ T¤Z×%7Ò%7¸Ñ%=Ô%=Ñ>Ô>Ð>øÝÔ(ð 	ð 	ð 	Ø�4�4ð	øøøs    +A ÁAÁAc                 óŽ  — |€|}	 | j         |         }n# t          $ r Y dS w xY w	 t          j        | j                             |¦  «        ¦  «        j        }n8# t          $ r+}|j        t          j	        t          j
        fv rY d}~dS ‚ d}~ww xY w ||¦  «        r*t          j        |                      |¦  «        |¦  «         dS dS ©zçSet the mode of new file contents.
        The mode_id is the existing file to get the mode from (often the same
        as trans_id).  The operation is only performed if there's a mode match
        according to typefunc.
        N)r¯   rÃ   rã   rä   rC   r²   rå   r†  r‡  rˆ  rÑ  r   rç   r’  )r;   rR   rS  r¦  r�  rÓ  r‹  s          r?   r¤  zGitTreeTransform._set_modeÓ  sú   € ð ˆ?ØˆGð	ØÔ*¨7Ô3ˆHˆHøÝð 	ð 	ð 	ØˆFˆFð	øøøð
	Ý”7˜4œ:×-Ò-¨hÑ7Ô7Ñ8Ô8Ô@ˆDˆDøÝð 	ð 	ð 	ØŒw�5œ<­¬Ð7Ð7Ð7ð
 �����àøøøøð	øøøð ˆ8�D‰>Œ>ð 	HÝÔ% d×&6Ò&6°xÑ&@Ô&@À$ÑGÔGÐGÐGÐGð	Hð 	Hs)   † ”
"¡"¦1A Á
BÁ"BÂBÂBc              #   ód  K  — 	 | j         |         }n# t          $ r Y dS w xY w	 t          j        | j                             |¦  «        ¦  «        }n# t          t          f$ r Y dS w xY w|D ]D}t          ||¦  «        }| j         	                    |¦  «        rŒ-|  
                    |¦  «        V — ŒEdS ©z1Iterate through the entry's tree children, if anyN)r¯   rÃ   rã   ÚlistdirrC   r²   ÚNotADirectoryErrorÚFileNotFoundErrorr#   Úis_control_filenamer7   )r;   r­   rt   rÔ   ro   Ú	childpaths         r?   rc   z#GitTreeTransform.iter_tree_childrení  sì   è è € ð	ØÔ& yÔ1ˆDˆDøÝð 	ð 	ð 	ØˆFˆFð	øøøð	Ý”z $¤*×"4Ò"4°TÑ":Ô":Ñ;Ô;ˆHˆHøÝ"Õ$5Ð6ð 	ð 	ð 	ØˆFˆFð	øøøð ð 	5ð 	5ˆEÝ   uÑ-Ô-ˆIØŒz×-Ò-¨iÑ8Ô8ð ØØ×)Ò)¨)Ñ4Ô4Ð4Ð4Ð4Ð4ð		5ð 	5s   „ ’
 Ÿ ¤,A ÁA&Á%A&c                 óô  — | j                              |¦  «        }d}| j                             |¦  «        dk    rÐ| j                             |¦  «        }|�´|| j        vr#t          ¦   «         | j        |<   i | j        |<   d}nˆ| j        r'| j        |                              |¦  «        |dfv rd}nZ| j        |                              ¦   «         D ]8\  }}||k    rŒ| 	                    ¦   «         | 	                    ¦   «         k    r nŒ9d}|st                               | |¦  «        S t          j        | j        |         |¦  «        }| j        |                              |¦  «         || j        |         |<   |S )ap  Generate a limbo path using the final path if possible.

        This optimizes the performance of applying the tree transform by
        avoiding renames.  These renames can be avoided only when the parent
        directory is already scheduled for creation.

        If the final path cannot be used, falls back to using the trans_id as
        the relpath.
        Fr¤   NT)rO   re   rh   rN   r}  r5   r~  r9   r]   rÒ   rw  r�  r   r”  r{  rz   )r;   rR   rQ   Úuse_direct_pathÚfilenameÚ
l_filenameÚ
l_trans_idr‘  s           r?   r�  z%GitTreeTransform._generate_limbo_pathþ  s¡  € ð Ô!×%Ò% hÑ/Ô/ˆð  ˆØÔ×!Ò! &Ñ)Ô)¨[Ò8Ð8Ø”~×)Ò)¨(Ñ3Ô3ˆHØÐ#Ø Ô!5Ð5Ð5Ý36±5´5�DÔ(¨Ñ0Ø9;�DÔ.¨vÑ6Ø&*�O�Oð Ô0ð /ØÔ2°6Ô:×>Ò>¸xÑHÔHØ (¨$Ð/ð0ð 0à*.˜øð !Ô6°vÔ>×DÒDÑFÔFð/ð /Ñ.˜
 Jà%¨Ò1Ð1Ø$Ø%×+Ò+Ñ-Ô-°·²Ñ1AÔ1AÒAÐAØ!˜Eð Bð +/˜àð 	JÝ$×9Ò9¸$ÀÑIÔIÐIåÔ% dÔ&7¸Ô&?ÀÑJÔJˆ
ØÔ˜VÔ$×(Ò(¨Ñ2Ô2Ð2Ø7?ˆÔ" 6Ô*¨8Ñ4ØÐr@   c                 ó:   — | j                              |¦  «         dS )r}   N)r6   r—  r   s     r?   r`   z"GitTreeTransform.cancel_versioning-  s   € àŒ×Ò˜xÑ(Ô(Ð(Ð(Ð(r@   Fc                 ó’  — t           j        d         D ]} || j        | ¦  «         Œ|s|                      ¦   «          d| _        t
          j                             ¦   «         5 }|                     t          d¦  «        dd¦  «         |  
                    ¦   «         }d}|€t          ¦   «         }n|}	 |                     t          d¦  «        d|z   d|z   ¦  «         |                      |¦  «         |                     t          d¦  «        d|z   d|z   ¦  «         |                      |¦  «        }|                     ¦   «          n## t          $ r |                     ¦   «          ‚ w xY w	 ddd¦  «         n# 1 swxY w Y   | j                             |¦  «         d| _        |                      ¦   «          t)          || j        ¦  «        S )rb  Úpre_transformr   zApply phaser   r   NT)r   rH   rC   r¡   Úrename_countr   Ú
ui_factoryÚnested_progress_barr…   r   Ú_generate_index_changesr!   Ú_apply_removalsÚ_apply_insertionsÚapply_deletionsr¹  ÚrollbackÚ_apply_index_changesr–   rK   r    )	r;   rd  re  rJ   Úchild_pbÚindex_changesÚoffsetÚmoverÚmodified_pathss	            r?   rc  zGitTreeTransform.apply1  s  € õ  Ô% oÔ6ð 	#ð 	#ˆDØˆD�”˜TÑ"Ô"Ð"Ð"Øð 	$Ø×!Ò!Ñ#Ô#Ð#ØˆÔÝŒ]×.Ò.Ñ0Ô0ð 	(°HØ�OŠO�G MÑ2Ô2°A°qÑ9Ô9Ð9Ø ×8Ò8Ñ:Ô:ˆMØˆFØˆ~Ý"™œ��à�ð	(Ø—’¥¨Ñ 6Ô 6¸¸F¹
ÀAÈÁJÑOÔOÐOØ×$Ò$ UÑ+Ô+Ð+Ø—’¥¨Ñ 6Ô 6¸¸F¹
ÀAÈÁJÑOÔOÐOØ!%×!7Ò!7¸Ñ!>Ô!>�ð
 ×%Ò%Ñ'Ô'Ð'Ð'øõ	 !ð ð ð Ø—’Ñ Ô Ð Øðøøøð (ð#	(ð 	(ð 	(ñ 	(ô 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(øøøð 	(ð 	(ð 	(ð 	(ð$ 	Œ
×'Ò'¨Ñ6Ô6Ð6ØˆŒ
Ø�Š‰ŒˆÝ  °Ô1BÑCÔCÐCs,   Á"AE4Â1A>EÄ/E4Å E$Å$E4Å4E8Å;E8c           	      ó  — t          | j                             ¦   «         d¬¦  «        }t          j                             ¦   «         5 }t          |¦  «        D �]\  }\  }}|dk    rŒ|                     t          d¦  «        |t          |¦  «        ¦  «         | j
                             |¦  «        }|| j        v r<t          j                             | j        |¦  «        }|                     ||¦  «         Œ || j        v s	|| j        v ri	 |                     ||                      |¦  «        ¦  «         | xj        dz  c_        Œí# t.          $ r!}	|	j        t0          j        k    r‚ Y d}	~	�Œd}	~	ww xY w�Œ	 ddd¦  «         dS # 1 swxY w Y   dS )aD  Perform tree operations that remove directory/inventory names.

        That is, delete files that are to be deleted, and put any files that
        need renaming into limbo.  This must be done in strict child-to-parent
        order.

        If inventory_delta is None, no inventory delta generation is performed.
        Trƒ  r1   úremoving filer   N)r†   r°   r]   r   r  r  Ú	enumerater…   r   r^   rC   r²   rk   rã   rt   Újoinrz  Ú
pre_deleterN   rO   r›  r’  r  r%   r‡  rˆ  )
r;   r  Ú
tree_pathsr  Únumrt   rR   Ú	full_pathÚdelete_pathr‹  s
             r?   r  z GitTreeTransform._apply_removalsY  sè  € õ ˜DÔ/×5Ò5Ñ7Ô7ÀÐFÑFÔFˆ
ÝŒ]×.Ò.Ñ0Ô0ð 	/°HÝ)2°:Ñ)>Ô)>ð /ñ /Ñ%�Ñ%�d˜Hà˜2’:�:ØØ—’¥¨Ñ 8Ô 8¸#½sÀ:¹¼ÑOÔOÐOØ œJ×.Ò.¨tÑ4Ô4�	Ø˜tÔ5Ð5Ð5Ý"$¤'§,¢,¨tÔ/@À(Ñ"KÔ"K�KØ×$Ò$ Y°Ñ<Ô<Ð<Ð<Ø $¤.Ð0Ð0Ø $Ô"2Ð2Ð2ð/ØŸš Y°×0@Ò0@ÀÑ0JÔ0JÑKÔKÐKð
 Ð)Ô)¨QÑ.Ð)Ô)Ð)øõ	 1ð "ð "ð "Øœ7¥e¤lÒ2Ð2Ø!ð 3Ð2Ð2Ð2Ñ2øøøøð"øøøñ 3ð/ð	/ð 	/ð 	/ñ 	/ô 	/ð 	/ð 	/ð 	/ð 	/ð 	/ð 	/ð 	/øøøð 	/ð 	/ð 	/ð 	/ð 	/ð 	/s=   ÁCFÄ
)EÄ3FÅ
E/ÅE*Å$FÅ*E/Å/FÆFÆ	Fc           
      óÔ  — |                       d¬¦  «        }g }t          j                             ¦   «         5 }t	          |¦  «        D �]Õ\  }\  }}|dz  dk    r1|                     t          d¦  «        |t          |¦  «        ¦  «         | j         	                    |¦  «        }|| j
        v rh	 |                     |                      |¦  «        |¦  «         | xj        dz  c_        n-# t          $ r }	|	j        t          j        k    r‚ Y d}	~	nd}	~	ww xY w|| j        v s|                      |¦  «        r|| j        v r|                     |¦  «         || j        v r|                      ||¦  «         || j        v r0| j        |         \  }
}t/          j        |¦  «        }|
|f| j        |<   || j        v �ri| j                             ¦   «         D ]\  }}}t7          |¦  «        |k    r nŒt9          j        d|¦  «         �Œ¸| j        j        j                              tB          j"         #                    d	| $                    d
¦  «        ¦  «        ¦  «        }| %                    ¦   «          ddl&m'}  |¦   «          (                    |¦  «         tS          tB          j"         #                    |d¦  «        d¦  «        5 }| *                    d¦  «        }| +                    dtB          j"         ,                    ||¦  «        z  ¦  «         ddd¦  «         n# 1 swxY w Y   �Œ×	 ddd¦  «         n# 1 swxY w Y   |D ]\  }}|| j-        v r| j-        |= Œ| j         .                    ¦   «          |S )ax  Perform tree operations that insert directory/inventory names.

        That is, create any files that need to be created, and restore from
        limbo any files that needed renaming.  This must be done in strict
        parent-to-child order.

        If inventory_delta is None, no inventory delta is calculated, and
        no list of modified paths is returned.
        T)rˆ   é
   r   úadding filer   Nz$unable to find submodule for path %sÚmodulesr*  )ÚBareLocalGitControlDirFormatz.gitÚwú.zgitdir: %s
)/rŽ   r   r  r  r  r…   r   r^   rC   r²   r�   r›  r’  r  r%   r‡  rˆ  rh   Úpath_changedr©   r„   rë   r4   r   r¬  rÂ  Ú_submodule_configr   r   r¾  Ú
controldirÚcontrol_transportÚclonerã   rt   r  r6  Úcreate_prefixÚdirr  Úinitialize_on_transportr©  Úlocal_abspathÚwriterí  r{  Úclear)r;   r  rŽ   r  r  r  rt   rR   r  r‹  Úo_sha1Úo_st_valrÒ  Úsubmodule_pathÚsubmodule_urlÚsubmodule_nameÚsubmodule_transportr  r­  Úsubmodule_abspaths                       r?   r  z"GitTreeTransform._apply_insertionsw  sH  € ð —N’N°4�NÑ8Ô8ˆ	ØˆÝŒ]×.Ò.Ñ0Ô0ð +	`°HÝ)2°9Ñ)=Ô)=ð *`ñ *`Ñ%�Ñ%�d˜HØ˜"‘H ’?�?Ø—O’O¥G¨MÑ$:Ô$:Ø$'­¨Y©¬ñ9ô 9ð 9à œJ×.Ò.¨tÑ4Ô4�	Ø˜tÔ1Ð1Ð1ð/ØŸš T×%5Ò%5°hÑ%?Ô%?ÀÑKÔKÐKð Ð)Ô)¨QÑ.Ð)Ô)Ð)øõ 1ð "ð "ð "àœ7¥e¤lÒ2Ð2Ø!ð 3Ð2Ð2Ð2Ð2øøøøð"øøøð  Ô 2Ð2Ð2Ø×,Ò,¨XÑ6Ô6ð 3à 4Ô#5Ð5Ð5Ø&×-Ò-¨iÑ8Ô8Ð8Ø˜tÔ6Ð6Ð6Ø×+Ò+¨D°(Ñ;Ô;Ð;Ø˜tÔ3Ð3Ð3Ø'+Ô';¸HÔ'EÑ$�F˜HÝ œ yÑ1Ô1�BØ6<¸b°\�DÔ(¨Ñ2Ø˜tÔ;Ð;Ñ;ØKOÌ:×KgÒKgÑKiÔKið !ð !ÑG˜¨¸Ý*¨>Ñ:Ô:¸dÒBÐBØ!˜Eð Cõ œØBÀDñJô Jð Já Ø*.¬*Ô*?Ô*Q×*WÒ*WÝœŸš Y°×0EÒ0EÀgÑ0NÔ0NÑOÔOñ+Qô +QÐ'à'×5Ò5Ñ7Ô7Ð7ØAÐAÐAÐAÐAÐAØ0Ð0Ñ2Ô2×JÒJÐK^Ñ_Ô_Ð_Ý�bœgŸlšl¨9°fÑ=Ô=¸sÑCÔCð `ÀqØ,?×,MÒ,MÈcÑ,RÔ,RÐ)ØŸš µ´·²ÐARÐT]Ñ1^Ô1^Ñ ^Ñ_Ô_Ð_ð`ð `ð `ñ `ô `ð `ð `ð `ð `ð `ð `øøøð `ð `ð `ð `ùðQ*`ð+	`ð +	`ð +	`ñ +	`ô +	`ð +	`ð +	`ð +	`ð +	`ð +	`ð +	`øøøð +	`ð +	`ð +	`ð +	`ðX (ð 	0ð 	0‰NˆD�(ð ˜4Ô,Ð,Ð,ØÔ% hÐ/øØÔ× Ò Ñ"Ô"Ð"ØÐsb   ·A6L+Â.)C(ÃL+Ã(
DÃ2DÄL+ÄDÄF'L+Ê9ALÌL+ÌLÌL+ÌLÌL+Ì+L/Ì2L/c           	      ó"  ‡ — t          ‰ j        ¦  «        }|                     ‰ j        ¦  «         i }t          ¦   «         }‰ j        ‰ j        ‰ j        ‰ j        fD ]}|                     |¦  «         Œ‰ j        ‰ j        fD ]}|                     |¦  «         Œt          ‰ j        ¦  «        }|                     |¦  «         ˆ fd„|D ¦   «         }|                     |¦  «         |D ]E}‰  	                    |¦  «        dk    r*| 
                    |¦  «         |                     |¦  «         ŒFt          t          ‰ ¦  «                             |¦  «        ¦  «        }t          |¦  «        t          |¦  «        z   }t           j                             ¦   «         5 }	t'          |¦  «        D ]V\  }
}|
dz  dk    r$|	                     t)          d¦  «        |
|¦  «         	 ‰ j        |         }n# t,          $ r Y ŒMw xY wd||<   ŒWt'          |¦  «        D ]Ì\  }
\  }}|
dz  dk    r4|	                     t)          d¦  «        |
t          |¦  «        z   |¦  «         ‰  	                    |¦  «        }|€Œ]‰                      |¦  «        }|sŒu‰ j                             |¦  «        }‰ j                             |¦  «        }‰ j                             |¦  «        }||||f||<   ŒÍ	 ddd¦  «         n# 1 swxY w Y   d	„ |                     ¦   «         D ¦   «         S )
z6Generate an inventory delta for the current transform.c              3   ót   •K  — | ]2}‰                      |¦  «        ‰                     |¦  «        k    ¯.|V — Œ3d S rB   )r¥   rÇ   r¦   s     €r?   ú	<genexpr>z;GitTreeTransform._generate_index_changes.<locals>.<genexpr>Ç  sU   øè è € ð Dð D˜aØŸ>š>¨!Ñ,Ô,°·²ÀÑ0BÔ0BÒBÐBð ØBÐBÐBÐBðDð Dr@   r¤   r  r   r  )NNNNr  Nc                 ó,   — g | ]\  }\  }}}}|||||f‘ŒS rU   rU   )rY   ÚprZ   r‹  ÚrrrÒ  s         r?   r\   z<GitTreeTransform._generate_index_changes.<locals>.<listcomp>ê  s0   € ÐMÐMÐMÑ&9 q©.¨1¨a°°R��A�q˜"˜bÐ!ÐMÐMÐMr@   )r5   r�   r…   rk   rN   rO   r„   rh   rƒ   rÇ   rz   r—  r†   r"   r‡   r^   r   r  r  r  r   r¯   rÃ   r”   re   rÂ  r:   r]   )r;   Ú
removed_idÚchangesÚchanged_idsr�   Úchanged_kindr§   rŽ   Útotal_entriesr  r  rR   rt   rÊ   Ú	versionedÚexecutabilityrÃ  Úsymlink_targets   `                 r?   r  z(GitTreeTransform._generate_index_changes·  s°  ø€ å˜Ô)Ñ*Ô*ˆ
Ø×Ò˜$Ô0Ñ1Ô1Ð1ØˆÝ‘e”eˆØ”~ tÔ'7ØÔ.°Ô0BðDð 	'ð 	'ˆFà×Ò˜vÑ&Ô&Ð&Ð&Ø”~ tÔ'7Ð8ð 	&ð 	&ˆFØ×Ò˜fÑ%Ô%Ð%Ð%å˜4Ô-Ñ.Ô.ˆà×&Ò& {Ñ3Ô3Ð3ðDð Dð Dð D <ð Dñ Dô Dˆà×Ò˜<Ñ(Ô(Ð(Øð 	&ð 	&ˆAØ�Š˜qÑ!Ô! [Ò0Ð0Ø—’˜qÑ!Ô!Ð!Ø×"Ò" 1Ñ%Ô%Ð%øÝ�: dÑ+Ô+×5Ò5°kÑBÔBÑCÔCˆ	Ý˜I™œ­¨Z©¬Ñ8ˆÝŒ]×.Ò.Ñ0Ô0ð 	M°HÝ!*¨:Ñ!6Ô!6ð 9ð 9‘��XØ˜"‘H ’?�?Ø—O’O¥G¨OÑ$<Ô$<Ø$'¨ñ8ô 8ð 8ðØÔ.¨xÔ8�D�DøÝð ð ð Ø�Hðøøøà 8�˜‘�Ý)2°9Ñ)=Ô)=ð Mð MÑ%�Ñ%�d˜HØ˜"‘H ’?�?Ø—O’O¥G¨MÑ$:Ô$:Ø$'­#¨j©/¬/Ñ$9¸=ñJô Jð Jð —’ xÑ0Ô0�Ø�<ØØ ×3Ò3°HÑ=Ô=�	Ø ð ØØ $Ô 7× ;Ò ;¸HÑ EÔ E�Ø%)Ô%A×%EÒ%EÀhÑ%OÔ%OÐ"Ø!%Ô!5×!9Ò!9¸(Ñ!CÔ!C�à˜-Ð);¸^ð!M�˜‘�ðMð	Mð 	Mð 	Mñ 	Mô 	Mð 	Mð 	Mð 	Mð 	Mð 	Mð 	Møøøð 	Mð 	Mð 	Mð 	Mð4 NÐM¸W¿]º]¹_¼_ÐMÑMÔMÐMs8   ÆAK(ÇG)Ç(K(Ç)
G6Ç3K(Ç5G6Ç6C%K(Ë(K,Ë/K,rB   rn  )ro  rp  rq  rr  r3   rï  r¥   r¤  rc   r�  r`   rc  r  r  r  rU   r@   r?   rÝ  rÝ  U  sÝ   € € € € € ð=ð =ð~(ð (ð (ð (ð<ð ð ð&ð ð ðHð Hð Hð45ð 5ð 5ð"-ð -ð -ð^)ð )ð )ð&Dð &Dð &Dð &DðP/ð /ð /ð<>ð >ð >ð@3Nð 3Nð 3Nð 3Nð 3Nr@   rÝ  c                   ó8   — e Zd ZdZd
d„Zd„ Zd„ Zd„ Zd„ Zd	„ Z	dS )ÚGitTransformPreviewzðA TreeTransform for generating preview trees.

    Unlike TreeTransform, this version works when the input tree is a
    RevisionTree, rather than a WorkingTree.  As a result, it tends to ignore
    unversioned files in the input tree.
    NTc                 ó”   — |                      ¦   «          t          j        d¬¦  «        }t                               | ||||¦  «         d S )Nz
git-limbo-)Úprefix)Ú	lock_readÚtempfileÚmkdtemprw  r3   )r;   r<   r0   r=   r�  s        r?   r3   zGitTransformPreview.__init__õ  sG   € Ø�ŠÑÔÐÝÔ#¨<Ð8Ñ8Ô8ˆÝ×"Ò" 4¨¨x¸¸^ÑLÔLÐLÐLÐLr@   c                 ó   — |S rB   rU   r´  s     r?   rï  z"GitTransformPreview.canonical_pathú  s   € Øˆr@   c                 óˆ   — |                       |¦  «        }|€d S | j                             |¦  «        d         }|dk    rd }|S )Nr   Úmissing)r‘   rC   Úpath_content_summary)r;   rR   rt   rÊ   s       r?   r¥   zGitTransformPreview.tree_kindý  sL   € Ø�~Š~˜hÑ'Ô'ˆØˆ<Ø�4ØŒz×.Ò.¨tÑ4Ô4°QÔ7ˆØ�9ÒÐØˆDØˆr@   c                 ó   — dS ró  rU   r¥  s       r?   r¤  zGitTransformPreview._set_mode  s	   € ð 	ˆr@   c              #   ó
  K  — 	 | j         |         }n# t          $ r Y dS w xY w	 | j                             |¦  «        D ].}t	          ||j        ¦  «        }|                      |¦  «        V — Œ/dS # t          j        $ r Y dS w xY wrõ  )	r¯   rÃ   rC   Úiter_child_entriesr#   rP   r7   rª   r«   )r;   r­   rt   ro   rú  s        r?   rc   z&GitTransformPreview.iter_tree_children  s¿   è è € ð	ØÔ& yÔ1ˆDˆDøÝð 	ð 	ð 	ØˆFˆFð	øøøð	Øœ×6Ò6°tÑ<Ô<ð 9ð 9�Ý$ T¨5¬:Ñ6Ô6�	Ø×-Ò-¨iÑ8Ô8Ð8Ð8Ð8Ð8ð9ð 9øõ Ô(ð 	ð 	ð 	ØˆFˆFð	øøøs   „ ’
 Ÿ ¤A	A/ Á/BÂBc                 ó*   — t          | j        ¦  «        ‚rB   rþ   r   s      r?   rÿ   zGitTransformPreview.new_orphan  s   € Ý! $¤/Ñ2Ô2Ð2r@   rl  )
ro  rp  rq  rr  r3   rï  r¥   r¤  rc   rÿ   rU   r@   r?   rB  rB  í  s�   € € € € € ðð ðMð Mð Mð Mð
ð ð ðð ð ðð ð ðð ð ð3ð 3ð 3ð 3ð 3r@   rB  c                   ó¶   — e Zd ZdZdZd„ Zd„ Zd„ Zd„ Zdd„Z		 	 	 dd„Z
d„ Zd„ Zej        fd„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ Zdd„Zd„ Zd	S ) r'  z9Partial implementation of Tree to support show_diff_treesFc                 óœ   — t          j        | |¦  «         |j        j        | _        |j        j        | _        t          |¦  «        | _        d S rB   )r   r3   rC   ÚstorerD   r"   Ú_final_paths)r;   Ú	transforms     r?   r3   zGitPreviewTree.__init__%  sC   € ÝÔ˜T 9Ñ-Ô-Ð-Ø”_Ô*ˆŒ
Ø ”Ô.ˆŒÝ& yÑ1Ô1ˆÔÐÐr@   c                 ó   — dS ©NFrU   rE   s    r?   Úsupports_setting_file_idsz(GitPreviewTree.supports_setting_file_ids+  s   € Øˆur@   c                 ó   — | j         j        S rB   )Ú
_transformr€  rE   s    r?   rÈ   z GitPreviewTree.supports_symlinks.  s   € ØŒÔ/Ð/r@   c                 ó4   — | j                              ¦   «         S rB   )rY  rŽ  rE   s    r?   râ   z#GitPreviewTree._supports_executable1  s   € ØŒ×9Ò9Ñ;Ô;Ð;r@   r1   c              #   óD  K  — | j         j        g}t          |¦  «        dk    �r||                     ¦   «         }g }g }|                     d¦  «        }| j                             |¦  «        }|                      |¦  «        D ]«}| j                             |¦  «        }| j                              |¦  «        }	| j          	                    |¦  «        }
|
�|
}n!d}
| j         j
                             |¦  «        }|dk    r|                     |¦  «         |                     ||	|
d |f¦  «         Œ¬|                     ¦   «          |                     |¦  «        r||fV — |                     t!          || j        j        d¬¦  «        ¦  «         t          |¦  «        dk    �°zd S d S )Nr   ú/Úunknownr¤   T)rx   r„  )rY  r8   r^   Úpoprì  rS  r  Ú_all_childrenrg   rÇ   rC   r¨   r©   rÓ   Ú
startswithr˜   r†   )r;   rD  Úpendingr­   rÔ   Úsubdirsrµ   r·   Úpath_from_rootr  rÊ   Úversioned_kinds               r?   ÚwalkdirszGitPreviewTree.walkdirs4  s½  è è € Ø”?Ô'Ð(ˆÝ�'‰lŒl˜QÒÑØŸš™œˆIØˆHØˆGØ—]’] 3Ñ'Ô'ˆFØÔ+×4Ò4°YÑ?Ô?ˆKØ ×.Ò.¨yÑ9Ô9ð 2ð 2�Ø!%Ô!2×!;Ò!;¸HÑ!EÔ!E�Øœ?×5Ò5°hÑ?Ô?�Ø”×1Ò1°(Ñ;Ô;�ØÐ#Ø%)�N�Nà$�DØ%)¤_Ô%:×%FÒ%FØ&ñ&(ô &(�Nà! [Ò0Ð0Ø—N’N 8Ñ,Ô,Ð,Ø—’ °¸4ÀØ!/ð!1ñ 2ô 2ð 2ð 2à�MŠM‰OŒOˆOØ×%Ò% fÑ-Ô-ð ,Ø! 8Ð+Ð+Ð+Ð+Ø�NŠN�6 '¨tÔ/@Ô/IØ*.ð0ñ 0ô 0ñ 1ô 1ð 1õ/ �'‰lŒl˜QÒÑÐÐÐÐr@   NTc                 ó^   — t          j        || ¦  «                             ||||||¬¦  «        S )z®See InterTree.iter_changes.

        This has a fast path that is only used when the from_tree matches
        the transform tree, and no fancy options are supplied.
        )Úinclude_unchangedr
  r0   Úextra_treesÚrequire_versionedr  )r   re   r%  )r;   Ú	from_treerg  r
  r0   rh  ri  r  s           r?   r%  zGitPreviewTree.iter_changesP  s?   € õ Œ}˜Y¨Ñ-Ô-×:Ò:Ø/Ø)ØØ#Ø/Ø-ð ;ñ /ô /ð 	/r@   c                 ó~  — |                       |¦  «        }|€t          j        |¦  «        ‚|| j        j        v r*| j                             |¦  «        }t          |d¦  «        S || j        j        v rt          j        |¦  «        ‚| j                             |¦  «        }| j        j	         
                    |¦  «        S )zSee Tree.get_fileNÚrb)Ú_path2trans_idrª   r«   rY  rh   r’  r©  rk   r‘   rC   Úget_file)r;   rt   rR   rP   r“   s        r?   rn  zGitPreviewTree.get_file`  s°   € à×&Ò& tÑ,Ô,ˆØÐÝ Ô+¨DÑ1Ô1Ð1Ø�t”Ô4Ð4Ð4Ø”?×.Ò.¨xÑ8Ô8ˆDÝ˜˜dÑ#Ô#Ð#Ø�t”Ô8Ð8Ð8Ý Ô+¨DÑ1Ô1Ð1Ø”O×-Ò-¨hÑ7Ô7ˆ	ØŒÔ$×-Ò-¨iÑ8Ô8Ð8r@   c                 óB  — |                       |¦  «        }|€t          j        |¦  «        ‚|| j        j        vr9| j                             |¦  «        }| j        j                             |¦  «        S | j                             |¦  «        }t          j
        |¦  «        S )zSee Tree.get_symlink_target)rm  rª   r«   rY  rh   r‘   rC   rÙ  r’  r   r¯  )r;   rt   rR   r“   rP   s        r?   rÙ  z!GitPreviewTree.get_symlink_targetm  s�   € à×&Ò& tÑ,Ô,ˆØÐÝ Ô+¨DÑ1Ô1Ð1Ø˜4œ?Ô8Ð8Ð8Øœ×1Ò1°(Ñ;Ô;ˆIØ”?Ô(×;Ò;¸IÑFÔFÐFØŒ×*Ò*¨8Ñ4Ô4ˆÝÔ Ñ%Ô%Ð%r@   c                 ó<  — |                       |¦  «        }|€d S | j                             |¦  «        }|�"| j        j                             ||¬¦  «        }ng }	 |                      |¦  «        }n# t          j        $ r Y d S w xY wt          j	        |g||¦  «        S )N)Údefault_revision)
rm  rY  r‘   rC   Úannotate_iterrO  rª   r«   r   Ú
reannotate)r;   rt   rq  rR   r“   Úold_annotationÚliness          r?   rr  zGitPreviewTree.annotate_iterx  sÂ   € Ø×&Ò& tÑ,Ô,ˆØÐØ�4Ø”O×-Ò-¨hÑ7Ô7ˆ	ØÐ Ø!œ_Ô2×@Ò@ØÐ,<ð Añ >ô >ˆNˆNð  ˆNð	Ø×'Ò'¨Ñ-Ô-ˆEˆEøÝÔ(ð 	ð 	ð 	Ø�4�4ð	øøøåÔ" NÐ#3°UÐ<LÑMÔMÐMs   ÁA1 Á1BÂBc                 óÐ   — t          |t          ¦  «        r|g k    rdg}t          j        |Ž }|                      |¦  «        sd S | j        j        j                             |¦  «        S )Nr1   )	Ú
isinstancerb   r   r”  r’   rY  rC   rD   rÌ  r´  s     r?   Úpath2idzGitPreviewTree.path2idˆ  sh   € Ý�d�DÑ!Ô!ð 	+Ø�rŠzˆzØ�t�ÝÔ# TÐ*ˆDØ× Ò  Ñ&Ô&ð 	Ø�4ØŒÔ$Ô,×=Ò=¸dÑCÔCÐCr@   c                 óˆ   — |                       |¦  «        5 }|                     ¦   «         cddd¦  «         S # 1 swxY w Y   dS )z“Return the byte content of a file.

        :param path: The path of the file.

        :returns: A single byte string for the whole file.
        N)rn  Úread)r;   rt   Úmy_files      r?   rL  zGitPreviewTree.get_file_text‘  s‚   € ð �]Š]˜4Ñ Ô ð 	" GØ—<’<‘>”>ð	"ð 	"ð 	"ð 	"ñ 	"ô 	"ð 	"ð 	"ð 	"ð 	"ð 	"ð 	"øøøð 	"ð 	"ð 	"ð 	"ð 	"ð 	"s   –7·;¾;c                 óP   — t          j        |                      |¦  «        ¦  «        S )z\Return the content of a file, as lines.

        :param path: The path of the file.
        )r   Úsplit_linesrL  r´  s     r?   rO  zGitPreviewTree.get_file_lines›  s#   € õ
 Ô" 4×#5Ò#5°dÑ#;Ô#;Ñ<Ô<Ð<r@   c              #   óR  ‡ K  — ˆ fd„‰ j         j                             ¦   «         D ¦   «         }|                     ‰ j         j        ¦  «         |                     ‰ j         j        ¦  «         |D ]8}‰ j                              |¦  «        s‰ j                             |¦  «        V — Œ9d S )Nc                 óD   •— h | ]}‰j                              |¦  «        ’ŒS rU   )rY  r7   )rY   r7  r;   s     €r?   ú	<setcomp>z(GitPreviewTree.extras.<locals>.<setcomp>£  s;   ø€ ð Að Að AÀQ˜4œ?×=Ò=¸aÑ@Ô@ð Að Að Ar@   )	rY  rC   Úextrasr…   rh   r�   r”   rS  Ú_determine_path)r;   Úpossible_extrasrR   s   `  r?   r�  zGitPreviewTree.extras¢  sÍ   øè è € ðAð Að Að AØ!%¤Ô!6×!=Ò!=Ñ!?Ô!?ðAñ Aô Aˆà×Ò˜tœÔ<Ñ=Ô=Ð=Ø×Ò˜tœÔ:Ñ;Ô;Ð;Ø'ð 	Bð 	BˆHØ”?×5Ò5°hÑ?Ô?ð BØÔ'×7Ò7¸ÑAÔAÐAÐAÐAøð	Bð 	Br@   c                 óž  — |                       |¦  «        }| j        }|                     |¦  «        }|j                             |¦  «        }|€/|�	||j        v rdS |j                             |¦  «        }|\  }}}}	n±d }	|                     |¦  «        }
||j	        v rd}|dk    rBt          j        |
¦  «        }|j        }|                     ¦   «         sd}n|j        t          z  }nd }d }|dk    r=t          j        |
¦  «        }	t#          |	t$          ¦  «        st          j        |	¦  «        }	|j                             ||¦  «        }||||	fS )N)rJ  NNNrÁ  rÌ   FrÆ   )rm  rY  r‘   rh   re   rk   rC   rK  r’  rÂ  rã   r¬  Úst_sizerŽ  rå   r   r¯  rw  ÚstrÚfsdecoder„   )r;   rt   rR   Úttr‘   rÊ   ÚsummaryÚsizerô   Úlink_or_sha1r‘  Ústatvals               r?   rK  z#GitPreviewTree.path_content_summary«  sc  € Ø×&Ò& tÑ,Ô,ˆØŒ_ˆØ—L’L Ñ*Ô*ˆ	ØÔ×#Ò# HÑ-Ô-ˆØˆ<ØÐ  H°Ô0DÐ$DÐ$DØ2Ð2Ø”h×3Ò3°IÑ>Ô>ˆGØ3:Ñ0ˆD�$˜
 L LàˆLØŸš¨Ñ1Ô1ˆJØ˜2Ô5Ð5Ð5Ø'�Ø�vŠ~ˆ~Ýœ( :Ñ.Ô.�Ø”�Ø×4Ò4Ñ6Ô6ð ;Ø!&�J�Jà!(¤µ7Ñ!:�J�Jà�Ø!�
Ø�yÒ Ð Ý!œ{¨:Ñ6Ô6�Ý! ,µÑ4Ô4ð =Ý#%¤;¨|Ñ#<Ô#<�LØÔ*×.Ò.¨x¸ÑDÔDˆ
Ø�T˜: |Ð3Ð3r@   c                 óL  — |                       |¦  «        }|€t          j        |¦  «        ‚|| j        j        vr7| j        j                             | j                             |¦  «        ¦  «        S | j                             |¦  «        }t          j
        |¦  «        }|j        S )zSee Tree.get_file_mtime)rm  rª   r«   rY  rh   rC   Úget_file_mtimer‘   r’  rã   r¬  Úst_mtime)r;   rt   rR   rP   rŒ  s        r?   rŽ  zGitPreviewTree.get_file_mtimeË  s—   € à×&Ò& tÑ,Ô,ˆØÐÝ Ô+¨DÑ1Ô1Ð1Ø˜4œ?Ô8Ð8Ð8Ø”?Ô(×7Ò7Ø”×)Ò)¨(Ñ3Ô3ñ5ô 5ð 5àŒ×*Ò*¨8Ñ4Ô4ˆÝ”(˜4‘.”.ˆØÔÐr@   c                 óæ   — |                       |¦  «        }|€dS || j        j        v rdS || j        j        v rdS | j                             |¦  «        }| j        j                             |¦  «        S )NFT)rm  rY  r6   r�   r‘   rC   r’   )r;   rt   rR   r“   s       r?   r’   zGitPreviewTree.is_versioned×  sx   € Ø×&Ò& tÑ,Ô,ˆØÐà�5Ø�t”Ô1Ð1Ð1Ø�4Ø�t”Ô2Ð2Ð2Ø�5Ø”O×-Ò-¨hÑ7Ô7ˆ	ØŒÔ$×1Ò1°)Ñ<Ô<Ð<r@   c              #   óÚ   K  — |rt          d¦  «        ‚|                      ¦   «         D ]B\  }}| j                             |¦  «        \  }}|€Œ%|s|j        dk    rŒ3|�||vrŒ:|�||fV — ŒCd S )Nz(follow tree references not yet supportedr¤   )r~   Ú_list_files_by_dirrY  rÖ  rÊ   )r;   r
  Úrecurse_nestedrR   rt   Úentryr’   s          r?   r  z"GitPreviewTree.iter_entries_by_dirã  s±   è è € Øð 	<Ý%Ø:ñ<ô <ð <ð #×5Ò5Ñ7Ô7ð 		"ð 		"‰NˆH�dØ"&¤/×"=Ò"=¸hÑ"GÔ"GÑˆE�<Øˆ}ØØð  E¤J°+Ò$=Ð$=ØØÐ)¨d¸.Ð.HÐ.HØØÐ Ø˜E�kÐ!Ð!Ð!øð		"ð 		"r@   c              #   óè  K  — t           g}t          |¦  «        dk    rÔ|                     ¦   «         }t          |                      |¦  «        ¦  «        }t          t          || j                             |¦  «        ¦  «        ¦  «        }| 	                    |j
        ¬¦  «         |                     t          |¦  «        ¦  «         |D ]}|||         d         fV — Œt          |¦  «        dk    °Òd S d S )Nr   rw   )r'   r^   r^  rb   r_  ÚdictÚziprS  r‡   rÓ   re   r˜   Úreversed)r;   ÚtodorQ   rÔ   ÚpathsrR   s         r?   r’  z!GitPreviewTree._list_files_by_dirø  sá   è è € Ýˆ}ˆÝ�$‰iŒi˜!ŠmˆmØ—X’X‘Z”ZˆFÝ˜D×.Ò.¨vÑ6Ô6Ñ7Ô7ˆHÝ�˜X tÔ'8×'BÒ'BÀ8Ñ'LÔ'LÑMÔMÑNÔNˆEØ�MŠM˜eœiˆMÑ(Ô(Ð(Ø�KŠK� Ñ*Ô*Ñ+Ô+Ð+Ø$ð 3ð 3�Ø  h¤°Ô 2Ð2Ð2Ð2Ð2Ð2õ �$‰iŒi˜!Šmˆmˆmˆmˆmˆmr@   c                 ó@   — | j         j                             |¦  «        S rB   )rY  rC   Úrevision_tree)r;   r0  s     r?   rœ  zGitPreviewTree.revision_tree  s   € ØŒÔ$×2Ò2°;Ñ?Ô?Ð?r@   c                 ó^   — | j                              |¦  «        }t          j        |¦  «        S rB   )rY  r’  rã   r¬  )r;   rR   rP   s      r?   Ú_stat_limbo_filezGitPreviewTree._stat_limbo_file  s%   € ØŒ×*Ò*¨8Ñ4Ô4ˆÝŒx˜‰~Œ~Ðr@   c                 ó°  — t          ¦   «         }g }|                      ¦   «         D ]•\  }}| j                             |¦  «        s|sŒ"|                     |¦  «         | j                             |¦  «        \  }}|�?| j                             |¦  «          |j        t          |¦  «        |j
        |f¦  «         Œ–|sd |fS t          | j        |¦  «        |fS rB   )r5   r’  rY  r”   rz   rÛ  rR  Ú
add_objectr©   r   rÏ  r*   )r;   r  Úextrarã   rR   rt   ÚorÓ  s           r?   Úgit_snapshotzGitPreviewTree.git_snapshot
  sâ   € Ý‘”ˆØˆØ"×5Ò5Ñ7Ô7ð 	?ð 	?‰NˆH�dØ”?×5Ò5°hÑ?Ô?ð  Ø'ð ØØ—	’	˜$‘”�Ø”o×5Ò5°hÑ?Ô?‰GˆAˆtØˆ}Ø”
×%Ò% aÑ(Ô(Ð(Ø�”	�?¨4Ñ0Ô0°!´$¸Ð=Ñ>Ô>Ð>øØð 	Ø˜�;ÐÝ˜4œ: rÑ*Ô*¨EÐ1Ð1r@   c              #   óÜ   K  — |                       |¦  «        }|€t          j        |¦  «        ‚|                      |¦  «        D ](}| j                             |¦  «        \  }}|sŒ"|�|V — Œ)d S rB   )rm  rª   r«   r_  rY  rÖ  )r;   rt   rR   Úchild_trans_idr”  r’   s         r?   rN  z!GitPreviewTree.iter_child_entries  sŒ   è è € Ø×&Ò& tÑ,Ô,ˆØÐÝ Ô+¨DÑ1Ô1Ð1Ø"×0Ò0°Ñ:Ô:ð 	ð 	ˆNØ"&¤/×"=Ò"=¸hÑ"GÔ"GÑˆE�<Øð ØØÐ Ø���øð	ð 	r@   )r1   )FNNNTFrV  rm  )ro  rp  rq  rr  Úsupports_file_idsr3   rW  rÈ   râ   re  r%  rn  rÙ  r3  ÚCURRENT_REVISIONrr  rx  rL  rO  r�  rK  rŽ  r’   r  r’  rœ  rž  r£  rN  rU   r@   r?   r'  r'     s¥  € € € € € ØCÐCàÐð2ð 2ð 2ðð ð ð0ð 0ð 0ð<ð <ð <ð1ð 1ð 1ð 1ð8 9>Ø?CØ>Cð/ð /ð /ð /ð 9ð 9ð 9ð	&ð 	&ð 	&ð 4AÔ3Qð Nð Nð Nð Nð Dð Dð Dð"ð "ð "ð=ð =ð =ðBð Bð Bð4ð 4ð 4ð@
 ð 
 ð 
 ð
=ð 
=ð 
=ð"ð "ð "ð "ð*	3ð 	3ð 	3ð@ð @ð @ðð ð ð2ð 2ð 2ð 2ð 	ð 	ð 	ð 	ð 	r@   r'  )=r‡  rã   Ú	posixpathrä   r   r   rF  r²  rD   r   r   r   r	   r<   r
   r   r   r   r   r1   r   r   r   r   r   r   r3  r   r   rª   r   r   Úi18nr   Úmutabletreer   r   r   rT  r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   Údulwich.indexr*   r+   Údulwich.objectsr,   r.   rw  rÝ  rB  r'  rU   r@   r?   ú<module>r­     s.  ðð$ €€€Ø 	€	€	€	Ø Ð Ð Ð Ø !Ð !Ð !Ð !Ð !Ð !Ð !Ð !Ø €€€Ø €€€à PÐ PÐ PÐ PÐ PÐ PÐ PÐ PÐ PÐ PÐ PÐ PØ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HØ $Ð $Ð $Ð $Ð $Ð $ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð Ð Ð Ð Ð Ð Ø %Ð %Ð %Ð %Ð %Ð %Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ?Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ø  Ð  Ð  Ð  Ð  Ð  ðLCð LCð LCð LCð LC˜ñ LCô LCð LCð^Dð Dð Dð Dð DÐ)ñ Dô Dð DðN
UNð UNð UNð UNð UNÐ(ñ UNô UNð UNðp03ð 03ð 03ð 03ð 03Ð*ñ 03ô 03ð 03ðfCð Cð Cð Cð C�[ 'ñ Cô Cð Cð Cð Cr@   