§
    cÌcŸ	 ã                   ó  — d Z ddlmZ ddlZddlZddlmZ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 ddlmZ ddlmZ dd	lmZ dd
lmZ  ej         e¦   «         d¦  «         ddlmZmZm Z m!Z!m"Z"m#Z#  G d„ de"¦  «        Z$ G d„ de!¦  «        Z%dd„Z&d„ Z'd„ Z( G d„ dee%¦  «        Z) G d„ d¦  «        Z* G d„ dee%¦  «        Z+ G d„ de¦  «        Z, ej-        e,¦  «          G d„ de,¦  «        Z. ej-        e.¦  «         dS ) z7Tree classes, representing directory at point in time.
é    )ÚdequeN)ÚTypeÚTYPE_CHECKINGÚOptionalé   )	ÚbranchÚ
controldirÚdebugÚerrorsÚlazy_importÚosutilsÚrevisionÚtraceÚ	transport)Ú
ControlDir)ÚMutableTree)Ú
Repository)ÚRevisionTreeze
from breezy import (
    add,
    )
from breezy.bzr import (
    inventory as _mod_inventory,
    )
)ÚFileTimestampUnavailableÚ	InterTreeÚMissingNestedTreeÚTreeÚ
TreeChangeÚTreeFilec                   óz   ‡ — e Zd Zej        ddgz   Z	 dˆ fd„	Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zed„ ¦   «         Zd„ Zˆ xZS )ÚInventoryTreeChangeÚfile_idÚ	parent_idFc
           	      ót   •— || _         || _        t          ¦   «                              |||||||	¬¦  «         d S )N)ÚpathÚchanged_contentÚ	versionedÚnameÚkindÚ
executableÚcopied)r   r   ÚsuperÚ__init__)Úselfr   r    r!   r"   r   r#   r$   r%   r&   Ú	__class__s             €ú:/usr/lib/python3/dist-packages/breezy/bzr/inventorytree.pyr(   zInventoryTreeChange.__init__H   sQ   ø€ àˆŒØ"ˆŒÝ‰Œ×ÒØ À)Ø˜D¨ZÀð 	ñ 	Hô 	Hð 	Hð 	Hð 	Hó    c                 óf   — d                      | j        j        |                      ¦   «         ¦  «        S )Nz{}{!r})Úformatr*   Ú__name__Ú	_as_tuple©r)   s    r+   Ú__repr__zInventoryTreeChange.__repr__P   s%   € Ø�Š˜tœ~Ô6¸¿ºÑ8HÔ8HÑIÔIÐIr,   c           	      ór   — | j         | j        | j        | j        | j        | j        | j        | j        | j        f	S ©N)	r   r    r!   r"   r   r#   r$   r%   r&   r1   s    r+   r0   zInventoryTreeChange._as_tupleS   s5   € Ø”˜dœi¨Ô)=¸t¼~Ø” ¤	¨4¬9°d´oÀtÄ{ðTð 	Tr,   c                 óÞ   — t          |t          ¦  «        r*|                      ¦   «         |                     ¦   «         k    S t          |t          ¦  «        r|                      ¦   «         |k    S dS ©NF)Ú
isinstancer   r0   Útuple©r)   Úothers     r+   Ú__eq__zInventoryTreeChange.__eq__W   s_   € Ý�e�ZÑ(Ô(ð 	9Ø—>’>Ñ#Ô# u§¢Ñ'8Ô'8Ò8Ð8Ý�e�UÑ#Ô#ð 	-Ø—>’>Ñ#Ô# uÒ,Ð,Øˆur,   c                 óV   — |                       ¦   «         |                      ¦   «         k     S r4   )r0   r9   s     r+   Ú__lt__zInventoryTreeChange.__lt__^   s!   € Ø�~Š~ÑÔ %§/¢/Ñ"3Ô"3Ò3Ð3r,   c                 óT   — | j         dk    r| j        d         | j        d         k    S dS )N©TTr   é   F)r"   r%   r1   s    r+   Úmeta_modifiedz!InventoryTreeChange.meta_modifieda   s-   € ØŒ>˜\Ò)Ð)Ø”O AÔ&¨$¬/¸!Ô*<Ò<Ð=Øˆur,   c                 ó:   — | j         d         | j         d         k    S ©Nr   r@   )r   r1   s    r+   Úis_reparentedz!InventoryTreeChange.is_reparentedf   s   € ØŒ~˜aÔ  D¤N°1Ô$5Ò5Ð5r,   c                 ó¦   — | j          oId | j        vo@d | j        vo7| j        d         | j        d         k    p| j        d         | j        d         k    S rC   )r&   r#   r   r1   s    r+   ÚrenamedzInventoryTreeChange.renamedi   sf   € ð ”ˆOð UØ˜œ	Ð!ðUà˜œÐ&ðUð ŒY�qŒ\˜TœY qœ\Ò)ÐS¨T¬^¸AÔ->À$Ä.ÐQRÔBSÒ-Sð		Vr,   c                 óî   — |                       | j        | j        d         d f| j        | j        d         d f| j        d         d f| j        d         d f| j        d         d f| j        d         d fd¬¦	  «	        S )Nr   F)r&   )	r*   r   r    r!   r"   r   r#   r$   r%   r1   s    r+   Údiscard_newzInventoryTreeChange.discard_newq   s~   € Ø�~Š~ØŒL˜4œ9 Qœ<¨Ð.°Ô0DØŒ^˜AÔ Ð%¨¬°qÔ(9¸4Ð'@ØŒY�qŒ\˜4Ð  4¤9¨Q¤<°Ð"6ØŒ_˜QÔ Ð&Øð ñ ô ð 	r,   )F)r/   Ú
__module__Ú__qualname__r   Ú	__slots__r(   r2   r0   r;   r=   rA   rD   ÚpropertyrF   rH   Ú__classcell__)r*   s   @r+   r   r   D   sç   ø€ € € € € àÔ$¨	°;Ð'?Ñ?€Ið 16ðHð Hð Hð Hð Hð HðJð Jð JðTð Tð Tðð ð ð4ð 4ð 4ðð ð ð
6ð 6ð 6ð ðVð Vñ „XðVðð ð ð ð ð ð r,   r   c                   óÞ   — e Zd ZdZd„ Zed„ ¦   «         Zd„ Z eed¬¦  «        Z	dZ
d„ Zg dfd	„Zg dfd
„Zd„ Zd„ Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Z	 	 dd„Zd„ Zd„ Zd d„Zd d„Zd„ Zd„ Zd d„ZdS )!ÚInventoryTreeaÕ  A tree that relies on an inventory for its metadata.

    Trees contain an `Inventory` object, and also know how to retrieve
    file texts mentioned in the inventory, either from a working
    directory or from a store.

    It is possible for trees to contain files that are not described
    in their inventory or vice versa; for this use `filenames()`.

    Subclasses should set the _inventory attribute, which is considered
    private to external API users.
    c                 ó   — dS )NT© r1   s    r+   Úsupports_symlinkszInventoryTree.supports_symlinksˆ   s   € Øˆtr,   c                 ó,   — |                      d¦  «        S )Nz.bzr)Ú
startswith)Úclsr    s     r+   Úis_special_pathzInventoryTree.is_special_path‹   s   € à�Š˜vÑ&Ô&Ð&r,   c                 ó   — | j         S r4   )Ú
_inventoryr1   s    r+   Ú_get_root_inventoryz!InventoryTree._get_root_inventory�   s
   € ØŒÐr,   zRoot inventory of this tree)ÚdocTc                 ó˜   — t          |t          ¦  «        r-t          |¦  «        dk    rt          d|z  ¦  «        ‚|d         }| j        |fS )z¸Find the inventory and inventory file id for a tree file id.

        :param file_id: The tree file id, as bytestring or tuple
        :return: Inventory and inventory file id
        r@   z"nested trees not yet supported: %rr   )r7   r8   ÚlenÚ
ValueErrorÚroot_inventory)r)   r   s     r+   Ú_unpack_file_idzInventoryTree._unpack_file_id—   s[   € õ �g�uÑ%Ô%ð 	!Ý�7‰|Œ|˜qÒ Ð Ý Ø8¸7ÑBñDô Dð Dà˜a”jˆGØÔ" GÐ+Ð+r,   c                 óà   — |€dS |                       |||¬¦  «        }t          ¦   «         }|D ]@}	 |                     |                      |¦  «        ¦  «         Œ,# t          j        $ r Y Œ=w xY w|S )aH  Find related paths in tree corresponding to specified filenames in any
        of `lookup_trees`.

        All matches in all trees will be used, and all children of matched
        directories will be used.

        :param paths: The filenames to find related paths for (if None, returns
            None)
        :param trees: The trees to find file_ids within
        :param require_versioned: if true, all specified filenames must occur in
            at least one tree.
        :return: a set of paths for the specified filenames and their children
            in `tree`
        N©Úrequire_versioned)Ú	paths2idsÚsetÚaddÚid2pathr   ÚNoSuchId)r)   ÚpathsÚtreesrb   Úfile_idsÚretr   s          r+   Úfind_related_paths_across_treesz-InventoryTree.find_related_paths_across_trees¤   s“   € ð  ˆ=Ø�4Ø—>’>Ø�5Ð,=ð "ñ ?ô ?ˆå‰eŒeˆØð 	ð 	ˆGðØ—’˜Ÿš WÑ-Ô-Ñ.Ô.Ð.Ð.øÝ”?ð ð ð Ø�ðøøøàˆ
s   °(AÁA+Á*A+c                 óF   — t          || gt          |¦  «        z   |¦  «        S )a“  Return all the ids that can be reached by walking from paths.

        Each path is looked up in this tree and any extras provided in
        trees, and this is repeated recursively: the children in an extra tree
        of a directory that has been renamed under a provided path in this tree
        are all returned, even if none exist under a provided path in this
        tree, and vice versa.

        :param paths: An iterable of paths to start converting to ids from.
            Alternatively, if paths is None, no ids should be calculated and None
            will be returned. This is offered to make calling the api unconditional
            for code that *might* take a list of files.
        :param trees: Additional trees to consider.
        :param require_versioned: If False, do not raise NotVersionedError if
            an element of paths is not versioned in this tree and all of trees.
        )Úfind_ids_across_treesÚlist)r)   rh   ri   rb   s       r+   rc   zInventoryTree.paths2idsÀ   s$   € õ" % U¨T¨FµT¸%±[´[Ñ,@ÐBSÑTÔTÐTr,   c                 ó”   — |                       ¦   «         5  |                      |¦  «        d         cddd¦  «         S # 1 swxY w Y   dS )z$Return the id for path in this tree.r@   N)Ú	lock_readÚ_path2inv_file_id©r)   r    s     r+   Úpath2idzInventoryTree.path2idÓ   sŒ   € à�^Š^ÑÔð 	3ð 	3Ø×)Ò)¨$Ñ/Ô/°Ô2ð	3ð 	3ð 	3ð 	3ñ 	3ô 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3øøøð 	3ð 	3ð 	3ð 	3ð 	3ð 	3s   •=½AÁAc                 ó0   — |                       |¦  «        d uS r4   )rt   rs   s     r+   Úis_versionedzInventoryTree.is_versionedÙ   s   € Ø�|Š|˜DÑ!Ô!¨Ð-Ð-r,   c                 ób   — |                       |¦  «        \  }}|€t          j        |¦  «        ‚|S )zqLookup an inventory entry by path.

        :param path: Path to look up
        :return: InventoryEntry
        )Ú_path2inv_ieÚ_mod_transportÚ
NoSuchFile©r)   r    ÚinvÚies       r+   Ú_path2iezInventoryTree._path2ieÜ   s6   € ð ×#Ò# DÑ)Ô)‰ˆˆRØˆ:Ý Ô+¨DÑ1Ô1Ð1Øˆ	r,   c                 ó6  — | j         }t          |t          ¦  «        r|}nt          j        |¦  «        }|j        }|rV|                     |¦  «        \  }}}|r9|                      d                     |¦  «        |j	        |j
        ¦  «        j         }|°V|€dS ||fS )Nú/©NN)r^   r7   ro   r   Ú	splitpathÚrootÚget_entry_by_path_partialÚ_get_nested_treeÚjoinr   Úreference_revision)r)   r    r|   Ú	remainingr}   Úbases         r+   rx   zInventoryTree._path2inv_ieç   s¯   € ØÔ!ˆÝ�d�DÑ!Ô!ð 	0ØˆIˆIåÔ)¨$Ñ/Ô/ˆIØŒXˆØð 	nØ"%×"?Ò"?À	Ñ"JÔ"JÑˆB��iØð nØ×+Ò+¨C¯HªH°T©N¬N¸B¼JÈÔH]Ñ^Ô^Ôm�ð ð 	nð ˆ:Ø�:Ø�Bˆwˆr,   c                 óL   — |                       |¦  «        \  }}|€dS ||j        fS )zœLookup a inventory and inventory file id by path.

        :param path: Path to look up
        :return: tuple with inventory and inventory file id
        Nr�   )rx   r   r{   s       r+   rr   zInventoryTree._path2inv_file_idö   s1   € ð ×#Ò# DÑ)Ô)‰ˆˆRØˆ:Ø�:Ø�B”JˆÐr,   Údownc                 óÚ  — |                       |¦  «        \  }}	 |                     |¦  «        S # t          j        $ r¬ |dk    r�dt          j        v rt          j        dd¦  «         |                      ¦   «         D ]X}|  	                    |¦  «        }	 t          j        ||                     |¦  «        ¦  «        c cY S # t          j        $ r Y ŒUw xY wt          j        | |¦  «        ‚w xY w)zBReturn the path for a file id.

        :raises NoSuchId:
        r‹   Úevilr   z0id2path with nested trees scales with tree size.)r_   rf   r   rg   r
   Údebug_flagsr   Úmutter_callsiteÚiter_referencesÚget_nested_treer   Úpathjoin)r)   r   ÚrecurseÚ	inventoryr    Úsubtrees         r+   rf   zInventoryTree.id2path  s  € ð
 "×1Ò1°'Ñ:Ô:Ñˆ	�7ð	1Ø×$Ò$ WÑ-Ô-Ð-øÝŒð 	1ð 	1ð 	1Ø˜&Ò Ð Ø�UÔ.Ð.Ð.ÝÔ)ØÐMñOô Oð Oà ×0Ò0Ñ2Ô2ð ð �DØ"×2Ò2°4Ñ8Ô8�GðÝ&Ô/°°g·o²oÀgÑ6NÔ6NÑOÔOÐOÐOÐOÐOÐOøÝ!œ?ð ð ð Ø˜ðøøøå”/ $¨Ñ0Ô0Ð0ð	1øøøs.   š/ ¯A#C*Â'B?Â:C*Â?CÃC*ÃCÃC*c                 ó>   — d„ |                       ¦   «         D ¦   «         S )Nc                 ó"   — h | ]\  }}|j         ’ŒS rQ   ©r   ©Ú.0r    Úentrys      r+   ú	<setcomp>z-InventoryTree.all_file_ids.<locals>.<setcomp>  s   € ÐLÐLÐL¡+ $¨�”ÐLÐLÐLr,   ©Úiter_entries_by_dirr1   s    r+   Úall_file_idszInventoryTree.all_file_ids  s"   € ØLÐL°×1IÒ1IÑ1KÔ1KÐLÑLÔLÐLr,   c                 ó>   — d„ |                       ¦   «         D ¦   «         S )Nc                 ó   — h | ]\  }}|’ŒS rQ   rQ   r™   s      r+   rœ   z4InventoryTree.all_versioned_paths.<locals>.<setcomp>  s   € ÐCÐCÐC™˜˜u�ÐCÐCÐCr,   r�   r1   s    r+   Úall_versioned_pathsz!InventoryTree.all_versioned_paths  s"   € ØCÐC¨×(@Ò(@Ñ(BÔ(BÐCÑCÔCÐCr,   NFc                 ón  ‡ ‡‡‡— ‰                       ¦   «         5  |�hg Š|D ]b}‰                      |¦  «        \  }}|r1|‰ j        ur(t          d                     |‰ j        ¦  «        ¦  «        ‚‰                     |¦  «         ŒcndŠˆˆˆˆ fd„Š ‰‰ j        ¦  «        cddd¦  «         S # 1 swxY w Y   dS )zÒWalk the tree in 'by_dir' order.

        This will yield each entry in the tree as a (path, entry) tuple.
        The order that they are yielded is:

        See Tree.iter_entries_by_dir for details.
        Nz{!r} != {!r}c              3   óª  •K  — |                       ‰¬¦  «        D ]¸\  }}|j        dk    r¢‰r 	 ‰	                     ||j        |j        ¦  «        }|                     ¦   «         5  |j        } ‰|¦  «        D ]"\  }}|rt          j        ||¦  «        n||fV — Œ#	 d d d ¦  «         n# 1 swxY w Y   Œ—# t          j
        $ r	 ||fV — Y Œ®w xY w||fV — Œ¹d S )N)Úspecific_file_idsútree-reference)rž   r$   r…   r   r‡   rq   r^   r   r’   r   ÚNotBranchError)
r|   ÚpÚer•   ÚsubinvÚsubpÚinventory_file_idsÚiter_entriesÚrecurse_nestedr)   s
         €€€€r+   r­   z7InventoryTree.iter_entries_by_dir.<locals>.iter_entries0  s‚  øè è € Ø×3Ò3ÐFXÐ3ÑYÔYð #ð #‘D�A�qØ”vÐ!1Ò1Ð1°nÐ1ðXØ&*×&;Ò&;¸A¸q¼yÈ!ÔJ^Ñ&_Ô&_˜Gð ")×!2Ò!2Ñ!4Ô!4ð Xð XØ)0Ô)? Ø/;¨|¸FÑ/CÔ/Cð !Xð !X¡G D¨!ØHLÐ+S­7Ô+;¸A¸tÑ+DÔ+DÐ+DÐRSÐVWÐ*WÐ$WÐ$WÐ$WÐ$Wð!XðXð Xð Xñ Xô Xð Xð Xð Xð Xð Xð Xøøøð Xð Xð Xð Xøøõ  &Ô4ð 'ð 'ð 'Ø"# Q $˜J˜J˜J˜J˜Jð'øøøð   ˜d˜
˜
˜
˜
ð#ð #s#   ­!B1Á"6B%Â%B)	Â,B)	Â1C	ÃC	)rq   rr   r^   ÚAssertionErrorr.   Úappend)r)   Úspecific_filesr®   r    r”   Úinv_file_idr¬   r­   s   ` `   @@r+   rž   z!InventoryTree.iter_entries_by_dir  sN  øøøø€ ð �^Š^ÑÔð 	5ð 	5ØÐ)Ø%'Ð"Ø*ð ;ð ;�DØ-1×-CÒ-CÀDÑ-IÔ-IÑ*�I˜{Ø ð = Y°dÔ6IÐ%IÐ%IÝ,¨^×-BÒ-BØ% tÔ':ñ.<ô .<ñ =ô =ð =à&×-Ò-¨kÑ:Ô:Ð:Ð:ð;ð &*Ð"ð#ð #ð #ð #ð #ð #ð #ð #ð  �< Ô 3Ñ4Ô4ð3	5ð 	5ð 	5ð 	5ñ 	5ô 	5ð 	5ð 	5ð 	5ð 	5ð 	5ð 	5øøøð 	5ð 	5ð 	5ð 	5ð 	5ð 	5s   ™BB*Â*B.Â1B.c                 óø   — |                       ¦   «         5  |                      |¦  «        }|j        dk    rt          j        |¦  «        ‚|j                             ¦   «         cd d d ¦  «         S # 1 swxY w Y   d S )NÚ	directory)rq   r~   r$   r   ÚNotADirectoryÚchildrenÚvalues©r)   r    r}   s      r+   Úiter_child_entriesz InventoryTree.iter_child_entries@  s¶   € Ø�^Š^ÑÔð 	(ð 	(Ø—’˜tÑ$Ô$ˆBØŒw˜+Ò%Ð%ÝÔ*¨4Ñ0Ô0Ð0Ø”;×%Ò%Ñ'Ô'ð		(ð 	(ð 	(ð 	(ñ 	(ô 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(øøøð 	(ð 	(ð 	(ð 	(ð 	(ð 	(s   •AA/Á/A3Á6A3c                 óT  — ddl m} |                      |¦  «        }|                     |¦  «        }|                      |||d¦  «        }|                     |                     |¦  «        ||d¦  «        }|€d }	n+|                     |                     |¦  «        ||d¦  «        }	||||	fS )Nr@   ©Úversionedfiles   this:s   other:s   base:)Ú r¼   rt   Ú_PlanMergeVersionedFileÚ_get_file_revisionrf   )
r)   r    r:   r‰   r¼   r   ÚvfÚlast_revision_aÚlast_revision_bÚlast_revision_bases
             r+   Ú_get_plan_merge_dataz"InventoryTree._get_plan_merge_dataG  sÉ   € Ø#Ð#Ð#Ð#Ð#Ð#Ø—,’,˜tÑ$Ô$ˆØ×2Ò2°7Ñ;Ô;ˆØ×1Ò1Ø�'˜2˜xñ)ô )ˆà×2Ò2Ø�MŠM˜'Ñ"Ô" G¨R°ñ<ô <ˆàˆ<Ø!%ÐÐà!%×!8Ò!8Ø—’˜WÑ%Ô% w°°Hñ">ô ">Ðà�? OÐ5GÐGÐGr,   c                 ól   — |                       |||¦  «        }|\  }}}}|                     |||¦  «        S )a;  Generate a merge plan based on annotations.

        If the file contains uncommitted changes in this tree, they will be
        attributed to the 'current:' pseudo-revision.  If the file contains
        uncommitted changes in the other tree, they will be assigned to the
        'other:' pseudo-revision.
        )rÄ   Ú
plan_merge©	r)   r    r:   r‰   ÚdatarÀ   rÁ   rÂ   rÃ   s	            r+   Úplan_file_mergezInventoryTree.plan_file_mergeV  sG   € ð ×(Ò(¨¨u°dÑ;Ô;ˆØCGÑ@ˆˆO˜_Ð.@Ø�}Š}˜_¨oØ/ñ1ô 1ð 	1r,   c                 ól   — |                       |||¦  «        }|\  }}}}|                     |||¦  «        S )a8  Generate a merge plan based lca-newness.

        If the file contains uncommitted changes in this tree, they will be
        attributed to the 'current:' pseudo-revision.  If the file contains
        uncommitted changes in the other tree, they will be assigned to the
        'other:' pseudo-revision.
        )rÄ   Úplan_lca_mergerÇ   s	            r+   Úplan_file_lca_mergez!InventoryTree.plan_file_lca_mergec  sI   € ð ×(Ò(¨¨u°dÑ;Ô;ˆØCGÑ@ˆˆO˜_Ð.@Ø× Ò  °/Ø!3ñ5ô 5ð 	5r,   c              #   óÔ   K  — |                       ¦   «         D ]P}	 |                      |¦  «        V — Œ# t          j        $ r$ | j        j                             |¦  «        V — Y ŒMw xY wdS )z?Iterate through parent trees, defaulting to Tree.revision_tree.N)Úget_parent_idsÚrevision_treer   ÚNoSuchRevisionInTreer   Ú
repository)r)   Úrevision_ids     r+   Ú_iter_parent_treesz InventoryTree._iter_parent_treesp  s™   è è € à×.Ò.Ñ0Ô0ð 	Hð 	HˆKðHØ×(Ò(¨Ñ5Ô5Ð5Ð5Ð5Ð5øÝÔ.ð Hð Hð HØ”kÔ,×:Ò:¸;ÑGÔGÐGÐGÐGÐGÐGðHøøøð	Hð 	Hs   š2²0A%Á$A%c                 ó¢  ‡‡— ddl m} |}ˆˆfd„|                      ¦   «         D ¦   «         }|                      ‰¦  «        5 }|                     |                     ‰|f||t          j        |¦  «        ¬¦  «        ¦  «         ddd¦  «         n# 1 swxY w Y   | j        j	        }	|	j
        }
|
|j        vr|j                             |
¦  «         |S )ú>Ensure that file_id, tree_revision is in vf to plan the merge.r@   r»   c                 ó>   •— g | ]}‰|                      ‰¦  «        f‘ŒS rQ   )Úget_file_revision)rš   Útr   r    s     €€r+   ú
<listcomp>z4InventoryTree._get_file_revision.<locals>.<listcomp>|  s9   ø€ ð 'ð 'ð 'Ø56ˆW�a×)Ò)¨$Ñ/Ô/Ð0ð'ð 'ð 'r,   )ÚsizeN)r½   r¼   rÓ   Úget_fileÚadd_contentÚFileContentFactoryr   Úfilesizer   rÑ   ÚtextsÚfallback_versionedfilesr°   )r)   r    r   rÀ   Útree_revisionr¼   Úlast_revisionÚparent_keysÚfÚrepoÚbase_vfs    ``        r+   r¿   z InventoryTree._get_file_revisionx  sU  øø€ à#Ð#Ð#Ð#Ð#Ð#Ø%ˆð'ð 'ð 'ð 'ð 'à×#Ò#Ñ%Ô%ð'ñ 'ô 'ˆð �]Š]˜4Ñ Ô ð 	Y AØ�NŠNØ×0Ò0Ø˜mÐ,¨k¸1Å7ÔCSÐTUÑCVÔCVð 1ñ Xô XñYô Yð Yð	Yð 	Yð 	Yñ 	Yô 	Yð 	Yð 	Yð 	Yð 	Yð 	Yð 	Yøøøð 	Yð 	Yð 	Yð 	Yð Œ{Ô%ˆØ”*ˆØ˜"Ô4Ð4Ð4ØÔ&×-Ò-¨gÑ6Ô6Ð6ØÐs   ÁABÂBÂBc                 ó(   — ddl m}  || |¬¦  «        S )Nr@   )ÚTransformPreview©Úpb)Ú	transformrè   )r)   rê   rè   s      r+   Úpreview_transformzInventoryTree.preview_transform‰  s*   € Ø/Ð/Ð/Ð/Ð/Ð/ØÐ ¨Ð,Ñ,Ô,Ð,r,   )r‹   r6   r4   )r/   rI   rJ   Ú__doc__rR   ÚclassmethodrV   rY   rL   r^   Úsupports_file_idsr_   rl   rc   rt   rv   r~   rx   rr   rf   rŸ   r¢   rž   r¹   rÄ   rÉ   rÌ   rÓ   r¿   rì   rQ   r,   r+   rO   rO   z   sè  € € € € € ðð ðð ð ð ð'ð 'ñ „[ð'ðð ð ð �XÐ1Ø"?ðAñ Aô A€Nð Ðð,ð ,ð ,ð <>Ø:>ðð ð ð ð8 &(¸4ð Uð Uð Uð Uð&3ð 3ð 3ð.ð .ð .ð	ð 	ð 	ðð ð ð	ð 	ð 	ð1ð 1ð 1ð 1ð*Mð Mð MðDð Dð Dð 26Ø+0ð"5ð "5ð "5ð "5ðH(ð (ð (ðHð Hð Hð1ð 1ð 1ð 1ð5ð 5ð 5ð 5ðHð Hð Hðð ð ð"-ð -ð -ð -ð -ð -r,   rO   Tc                 óL   — | sdS t          | ||¦  «        }t          ||¦  «        S )aâ  Find the ids corresponding to specified filenames.

    All matches in all trees will be used, and all children of matched
    directories will be used.

    :param filenames: The filenames to find file_ids for (if None, returns
        None)
    :param trees: The trees to find file_ids within
    :param require_versioned: if true, all specified filenames must occur in
        at least one tree.
    :return: a set of file ids for the specified filenames and their children.
    N)Ú_find_ids_across_treesÚ_find_children_across_trees)Ú	filenamesri   rb   Úspecified_path_idss       r+   rn   rn   Ž  s;   € ð ð ØˆtÝ/°	¸5Ø0AñCô CÐå&Ð'9¸5ÑAÔAÐAr,   c                 ó  — g }t          ¦   «         }| D ]N}d}|D ]0}|                     |¦  «        }|�|                     |¦  «         d}Œ1|r|                     |¦  «         ŒOt	          |¦  «        dk    r|rt          j        |¦  «        ‚|S )a˜  Find the ids corresponding to specified filenames.

    All matches in all trees will be used, but subdirectories are not scanned.

    :param filenames: The filenames to find file_ids for
    :param trees: The trees to find file_ids within
    :param require_versioned: if true, all specified filenames must occur in
        at least one tree.
    :return: a set of file ids for the specified filenames
    TNFr   )rd   rt   re   r°   r\   r   ÚPathsNotVersionedError)	ró   ri   rb   Únot_versionedÚinteresting_idsÚ	tree_pathÚ	not_foundÚtreer   s	            r+   rñ   rñ   ¢  s³   € ð €MÝ‘e”e€OØð ,ð ,ˆ	Øˆ	Øð 	"ð 	"ˆDØ—l’l 9Ñ-Ô-ˆGØÐ"Ø×#Ò# GÑ,Ô,Ð,Ø!�	øØð 	,Ø× Ò  Ñ+Ô+Ð+øÝ
ˆ=ÑÔ˜AÒÐÐ"3ÐÝÔ+¨MÑ:Ô:Ð:ØÐr,   c                 óÌ  — t          | ¦  «        }|}t          |¦  «        dk    r¿t          ¦   «         }|D ]„}|D ]}	 |                     |¦  «        }n# t          j        $ r Y Œ*w xY w	 |                     |¦  «        D ]%}|j        |vr|                     |j        ¦  «         Œ&Œk# t          j        $ r Y Œ|w xY wŒ…| 	                    |¦  «         |}t          |¦  «        dk    °¿|S )záReturn a set including specified ids and their children.

    All matches in all trees will be used.

    :param trees: The trees to find file_ids within
    :return: a set containing all specified ids and their children
    r   )
rd   r\   rf   r   rg   r¹   r   re   rµ   Úupdate)	Úspecified_idsri   rø   ÚpendingÚnew_pendingr   rû   r    Úchilds	            r+   rò   rò   ½  s3  € õ ˜-Ñ(Ô(€OØ€Gõ ˆg‰,Œ,˜Ò
Ð
Ý‘e”eˆØð 	ð 	ˆGØð 
ð 
�ðØŸ<š<¨Ñ0Ô0�D�DøÝ”ð ð ð Ø�HðøøøðØ!%×!8Ò!8¸Ñ!>Ô!>ð ;ð ;˜Ø œ=°Ð?Ð?Ø'ŸOšO¨E¬MÑ:Ô:Ð:øð;øõ Ô+ð ð ð Ø�Dðøøøð
ð 	×Ò˜{Ñ+Ô+Ð+Øˆõ ˆg‰,Œ,˜Ò
Ð
ð  Ðs#   ¼AÁA$Á#A$Á(;B$Â$B6Â5B6c                   óL   — e Zd Zd„ Zdd„Zd„ Zdd„Zd„ Zdd„Zdd	„Z	d
„ Z
d„ ZdS )ÚMutableInventoryTreec                 óê   — |                       ¦   «         5  |                      ¦   «          | j        }|                     |¦  «         |                      |¦  «         ddd¦  «         dS # 1 swxY w Y   dS )a  Apply changes to the inventory as an atomic operation.

        :param changes: An inventory delta to apply to the working tree's
            inventory.
        :return None:
        :seealso Inventory.apply_delta: For details on the changes parameter.
        N)Úlock_tree_writeÚflushr^   Úapply_deltaÚ_write_inventory)r)   Úchangesr|   s      r+   Úapply_inventory_deltaz*MutableInventoryTree.apply_inventory_deltaÞ  sµ   € ð ×!Ò!Ñ#Ô#ð 	'ð 	'Ø�JŠJ‰LŒLˆLØÔ%ˆCØ�OŠO˜GÑ$Ô$Ð$Ø×!Ò! #Ñ&Ô&Ð&ð		'ð 	'ð 	'ñ 	'ô 	'ð 	'ð 	'ð 	'ð 	'ð 	'ð 	'ð 	'øøøð 	'ð 	'ð 	'ð 	'ð 	'ð 	's   •AA(Á(A,Á/A,Nc                 ó„  — |                       ¦   «         5  t          |                      ¦   «         ¦  «        dk    r	 ddd¦  «         dS |€|                      ¦   «         }|                      |¦  «        }|                      ¦   «         rT	 t          |¦  «        }|j        dk    rt          |¦  «        }	 ddd¦  «         dS # t          $ r Y ddd¦  «         dS w xY wt          d„ |¦  «        }	 t          t          |¦  «        ¦  «         n# t          $ r Y ddd¦  «         dS w xY w	 ddd¦  «         dS # 1 swxY w Y   dS )a  Quickly check that the tree contains at least one commitable change.

        :param _from_tree: tree to compare against to find changes (default to
            the basis tree and is intended to be used by tests).

        :return: True if a change is found. False otherwise
        r@   NTr�   Fc                 ó>   — | d         d         dk    o| d         dk    S )Né   r   Úsymlinké   r�   rQ   )Úcs    r+   ú<lambda>z2MutableInventoryTree.has_changes.<locals>.<lambda>  s!   € ˜a œd 1œg¨Ò2ÐK°q¸´t¸|Ò7K€ r,   )rq   r\   rÎ   Ú
basis_treeÚiter_changesrR   Únextr   ÚStopIterationÚfilterÚiter)r)   Ú
_from_treer	  Úchanges       r+   Úhas_changesz MutableInventoryTree.has_changesì  s  € ð �^Š^ÑÔð #	ð #	å�4×&Ò&Ñ(Ô(Ñ)Ô)¨AÒ-Ð-Øð#	ð #	ð #	ñ #	ô #	ð #	ð #	ð #	ð Ð!Ø!Ÿ_š_Ñ.Ô.�
Ø×'Ò'¨
Ñ3Ô3ˆGØ×%Ò%Ñ'Ô'ð ð!Ý! '™]œ]�FàÔ'¨<Ò7Ð7Ý!% g¡¤˜Øð#	ð #	ð #	ñ #	ô #	ð #	ð #	ð #	øõ %ð !ð !ð !à ð##	ð #	ð #	ñ #	ô #	ð #	ð #	ð #	ð!øøøõ !ØKÐKØñô �ð!Ý�˜g™œÑ'Ô'Ð'Ð'øÝ$ð !ð !ð !Ø ðE#	ð #	ð #	ñ #	ô #	ð #	ð #	ð #	ðB!øøøàðG#	ð #	ð #	ñ #	ô #	ð #	ð #	ð #	ð #	ð #	ð #	ð #	øøøð #	ð #	ð #	ð #	ð #	ð #	sY   •'D5Á	?D5Â	)C Ã 
CÃ
D5ÃCÃD5Ã.DÄ
D5Ä
D$ÄD5Ä#D$Ä$D5Ä5D9Ä<D9c                 ó>   — | j         s|                      |¦  «        }|S )z;If our tree isn't case sensitive, return the canonical path)Úcase_sensitiveÚget_canonical_pathrs   s     r+   Ú_fix_case_of_inventory_pathz0MutableInventoryTree._fix_case_of_inventory_path  s%   € àÔ"ð 	1Ø×*Ò*¨4Ñ0Ô0ˆDØˆr,   Tc                 óà  — |                       ¦   «         5  t          | dd¦  «        �Mt          ¦   «         }|                      ¦   «         D ])}|                     |                     ¦   «         ¦  «         Œ*nd}t          | ||¦  «        }|                     ||¬¦  «         |r)|                     ¦   «         }|  	                    |¦  «         |j
        |j        fcddd¦  «         S # 1 swxY w Y   dS )a  Version file_list, optionally recursing into directories.

        This is designed more towards DWIM for humans than API clarity.
        For the specific behaviour see the help for cmd_add().

        :param file_list: List of zero or more paths.  *NB: these are
            interpreted relative to the process cwd, not relative to the
            tree.*  (Add and most other tree methods use tree-relative
            paths.)
        :param action: A reporter to be called with the inventory, parent_ie,
            path and kind of the path being added. It may return a file_id if
            a specific one should be used.
        :param save: Save the inventory after completing the adds. If False
            this provides dry-run functionality by doing the add and not saving
            the inventory.
        :return: A tuple - files_added, ignored_files. files_added is the count
            of added files, and ignored_files is a dict mapping files that were
            ignored to the rule that caused them to be ignored.
        Ú	conflictsN©r“   )r  Úgetattrrd   r   rý   Úassociated_filenamesÚ_SmartAddHelperre   Úget_inventory_deltar
  ÚaddedÚignored)	r)   Ú	file_listr“   ÚactionÚsaveÚconflicts_relatedr  ÚadderÚinvdeltas	            r+   Ú	smart_addzMutableInventoryTree.smart_add  sE  € ð( ×!Ò!Ñ#Ô#ð 	.ð 	.å�t˜[¨$Ñ/Ô/Ð;õ %(¡E¤EÐ!ØŸšÑ)Ô)ð Gð G�AØ%×,Ò,¨Q×-CÒ-CÑ-EÔ-EÑFÔFÐFÐFðGð %)Ð!Ý# D¨&Ð2CÑDÔDˆEØ�IŠI�i¨ˆIÑ1Ô1Ð1Øð 5Ø ×4Ò4Ñ6Ô6�Ø×*Ò*¨8Ñ4Ô4Ð4Ø”; ¤Ð-ð!	.ð 	.ð 	.ð 	.ñ 	.ô 	.ð 	.ð 	.ð 	.ð 	.ð 	.ð 	.øøøð 	.ð 	.ð 	.ð 	.ð 	.ð 	.s   •CC#Ã#C'Ã*C'c                 óª  — |                       ¦   «         |k    r|                      |g¦  «         dS |                      ¦   «         }|                     ¦   «         5  t                               |¦  «        }ddd¦  «         n# 1 swxY w Y   |                     |¦  «         t          | j        j	        ||¦  «        }|  
                    ||fg¦  «         dS )a  Update the parents of this tree after a commit.

        This gives the tree one parent, with revision id new_revid. The
        inventory delta is applied to the current basis tree to generate the
        inventory for the parent new_revid, and all other parent trees are
        discarded.

        All the changes in the delta should be changes synchronising the basis
        tree with some or all of the working tree, with a change to a directory
        requiring that its contents have been recursively included. That is,
        this is not a general purpose tree modification routine, but a helper
        for commit which is not required to handle situations that do not arise
        outside of commit.

        See the inventory developers documentation for the theory behind
        inventory deltas.

        :param new_revid: The new revision id for the trees parent.
        :param delta: An inventory delta (see apply_inventory_delta) describing
            the changes from the current left most parent revision to new_revid.
        N)râ   Úset_parent_idsr  rq   Ú_mod_inventoryÚmutable_inventory_from_treer  ÚInventoryRevisionTreer   rÑ   Úset_parent_trees)r)   Ú	new_revidÚdeltaÚbasisr”   Úrev_trees         r+   Úupdate_basis_by_deltaz*MutableInventoryTree.update_basis_by_deltaE  s%  € ð4 ×ÒÑÔ 9Ò,Ð,Ø×Ò  Ñ,Ô,Ð,ØˆFð —’Ñ!Ô!ˆØ�_Š_ÑÔð 	Jð 	Jõ '×BÒBÀ5ÑIÔIˆIð		Jð 	Jð 	Jñ 	Jô 	Jð 	Jð 	Jð 	Jð 	Jð 	Jð 	Jøøøð 	Jð 	Jð 	Jð 	Jð
 	×Ò˜eÑ$Ô$Ð$Ý(¨¬Ô)?Ø)2°Iñ?ô ?ˆà×Ò 	¨8Ð4Ð5Ñ6Ô6Ð6Ð6Ð6s   ÁB Â BÂBc                 ó(   — ddl m}  || |¬¦  «        S )Nr@   )ÚInventoryTreeTransformré   )rë   r;  )r)   rê   r;  s      r+   rë   zMutableInventoryTree.transformo  s*   € Ø5Ð5Ð5Ð5Ð5Ð5Ø%Ð% d¨rÐ2Ñ2Ô2Ð2r,   c                 ó@  — t          |t          ¦  «        rW|�#t          |t          ¦  «        st          ¦   «         ‚|�#t          |t          ¦  «        st          ¦   «         ‚|g}|�|g}|�|g}d„ |D ¦   «         }|€dgt	          |¦  «        z  }n.t	          |¦  «        t	          |¦  «        k    st          ¦   «         ‚|€dgt	          |¦  «        z  }n.t	          |¦  «        t	          |¦  «        k    st          ¦   «         ‚|                      ¦   «         5  |D ]@}|                      |¦  «        rt          j        |¬¦  «        ‚t          j
        |¦  «        }ŒA|                      ||¦  «         |                      |||¦  «         ddd¦  «         dS # 1 swxY w Y   dS )aÎ  Add paths to the set of versioned paths.

        Note that the command line normally calls smart_add instead,
        which can automatically recurse.

        This adds the files to the tree, so that they will be
        recorded by the next commit.

        Args:
          files: List of paths to add, relative to the base of the tree.
          kinds: Optional parameter to specify the kinds to be used for
            each file.
          ids: If set, use these instead of automatically generated ids.
            Must be the same length as the list of files, but may
            contain None for ids that are to be autogenerated.

        TODO: Perhaps callback with the ids and paths as they're added.
        Nc                 ó8   — g | ]}|                      d ¦  «        ‘ŒS )r€   )Ústrip)rš   r    s     r+   rÙ   z,MutableInventoryTree.add.<locals>.<listcomp>“  s"   € Ð3Ð3Ð3 T�—’˜C‘”Ð3Ð3Ð3r,   ©Úfilename)r7   ÚstrÚbytesr¯   r\   r  Úis_control_filenamer   ÚForbiddenControlFileErrorr   r‚   Ú_gather_kindsÚ_add)r)   ÚfilesÚkindsÚidsrä   Úfps         r+   re   zMutableInventoryTree.adds  sñ  € õ& �e�SÑ!Ô!ð 	 ð �K¥:¨cµ5Ñ#9Ô#9�KÝ$Ñ&Ô&Ð&Ø�M¥Z°µsÑ%;Ô%;�MÝ$Ñ&Ô&Ð&Ø�GˆEØˆØ�e�ØÐ Ø˜�à3Ð3¨UÐ3Ñ3Ô3ˆàˆ;Ø�&�3˜u™:œ:Ñ%ˆCˆCå˜‘H”H¥ E¡
¤
Ò*Ð*Ý$Ñ&Ô&Ð&Øˆ=Ø�F�S ™ZœZÑ'ˆEˆEÝ�U‘”�s 5™zœzÒ)Ð)Ý Ñ"Ô"Ð"Ø×!Ò!Ñ#Ô#ð 
	)ð 
	)Øð *ð *�à×+Ò+¨AÑ.Ô.ð GÝ Ô:ÀAÐFÑFÔFÐFÝÔ& qÑ)Ô)��ð ×Ò˜u eÑ,Ô,Ð,Ø�IŠI�e˜U CÑ(Ô(Ð(ð
	)ð 
	)ð 
	)ñ 
	)ô 
	)ð 
	)ð 
	)ð 
	)ð 
	)ð 
	)ð 
	)ð 
	)øøøð 
	)ð 
	)ð 
	)ð 
	)ð 
	)ð 
	)s   ÄA1FÆFÆFc                 ó*   — t          | j        ¦  «        ‚)z4Helper function for add - sets the entries of kinds.)ÚNotImplementedErrorrE  )r)   rG  rH  s      r+   rE  z"MutableInventoryTree._gather_kindsª  s   € å! $Ô"4Ñ5Ô5Ð5r,   c                 ó*   — t          | j        ¦  «        ‚)a;  Helper function for add - updates the inventory.

        :param files: sequence of pathnames, relative to the tree root
        :param kinds: sequence of  inventory kinds of the files (i.e. may
            contain "tree-reference")
        :param ids: sequence of suggested ids for the files (may be None)
        )rL  rF  )r)   rG  rH  rI  s       r+   rF  zMutableInventoryTree._add®  s   € õ " $¤)Ñ,Ô,Ð,r,   r4   )TNTr�   )r/   rI   rJ   r
  r  r  r.  r9  rë   re   rE  rF  rQ   r,   r+   r  r  Ü  s³   € € € € € ð'ð 'ð 'ð+ð +ð +ð +ðZð ð ð$.ð $.ð $.ð $.ðL(7ð (7ð (7ðT3ð 3ð 3ð 3ð5)ð 5)ð 5)ð 5)ðn6ð 6ð 6ð-ð -ð -ð -ð -r,   r  c                   ó@   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zdd„Z	dd
„Z
dS )r$  z!Helper for MutableTree.smart_add.c                 óN   — t          | j                             ¦   «         ¦  «        S r4   )ro   Ú	_invdeltar·   r1   s    r+   r%  z#_SmartAddHelper.get_inventory_delta¼  s    € õ �D”N×)Ò)Ñ+Ô+Ñ,Ô,Ð,r,   c                 ó   — | j                              |¦  «        }|�|d         S | j                             |¦  «        }	 t	          | j                             |g¬¦  «        ¦  «        d         S # t          $ r Y dS w xY w)zÔRetrieve the most up to date inventory entry for a path.

        :param inv_path: Normalized inventory path
        :return: Inventory entry (with possibly invalid .children for
            directories)
        Né   ©r±   r@   )rP  Úgetrû   r  r  rž   r  )r)   Úinv_pathr›   s      r+   Ú_get_iez_SmartAddHelper._get_ieÁ  sœ   € ð ”×"Ò" 8Ñ,Ô,ˆØÐØ˜”8ˆOà”9×8Ò8¸ÑBÔBˆð	Ý˜œ	×5Ò5Ø (˜zð 6ñ +ô +ñ ,ô ,Ø,-ô/ð /øåð 	ð 	ð 	Ø�4�4ð	øøøs   Á .A/ Á/
A=Á<A=c                 ó‚   — t                                |j        |j        |j        ¦  «        }|||j        |f| j        |<   |S )z¼Convert an entry to a directory.

        :param this_ie: Inventory entry
        :param inv_path: Normalized path for the inventory entry
        :return: The new inventory entry
        )r1  ÚInventoryDirectoryr   r#   r   rP  )r)   Úthis_ierU  s      r+   Ú_convert_to_directoryz%_SmartAddHelper._convert_to_directoryÓ  sF   € õ !×3Ò3ØŒO˜Wœ\¨7Ô+<ñ>ô >ˆà$,¨h¸¼Ø$+ð$-ˆŒ�xÑ àˆr,   c                 óÞ  — t          j        |¦  «        }t          j        |¦  «        \  }}|€1|                      |¦  «        }|�|S |                      d|d|¦  «        }|j        dk    r|                      ||¦  «        }|                      | j        |||¦  «        }	t           
                    |||j        |	¬¦  «        }
d||
j        |
f| j        |<   | j                             |¦  «         |
S )aú  Add a new entry to the inventory and automatically add unversioned parents.

        :param parent_ie: Parent inventory entry if known, or None.  If
            None, the parent is looked up by name and used if present, otherwise it
            is recursively added.
        :param path: Filesystem path to add
        :param kind: Kind of new entry (file, directory, etc)
        :param inv_path: Inventory path
        :return: Inventory entry for path and a list of paths which have been added.
        Nr´   r˜   )r   ÚdirnameÚsplitrV  Ú_add_one_and_parentr$   rZ  r)  rû   r1  Ú
make_entryr   rP  r&  r°   )r)   Ú	parent_ier    r$   rU  Úinv_dirnamer\  ÚbasenamerY  r   r›   s              r+   r^  z#_SmartAddHelper._add_one_and_parentâ  s  € õ ”o hÑ/Ô/ˆÝ#œM¨$Ñ/Ô/Ñˆ�ØÐà—l’l 8Ñ,Ô,ˆGØÐ"Ø�ð
 ×0Ò0°Ø18¸+Ø1<ñ>ô >ˆIð Œ>˜[Ò(Ð(ð ×2Ò2°9¸kÑJÔJˆIØ—+’+˜dœi¨°D¸$Ñ?Ô?ˆÝ×)Ò)¨$°¸)Ô:KØ29ð *ñ ;ô ;ˆà$(¨(°E´MÀ5Ð#IˆŒ�xÑ ØŒ
×Ò˜(Ñ#Ô#Ð#Øˆr,   c              #   ó’   K  — d }t           j        }t          |¦  «        D ]&}|� ||g|¦  «        s||         \  }}|||d fV — |}Œ'd S r4   )r   Úis_inside_or_parent_of_anyÚsorted)r)   Ú	user_dirsÚprev_dirÚ	is_insider    rU  rY  s          r+   Ú_gather_dirs_to_addz#_SmartAddHelper._gather_dirs_to_add  sy   è è € ð ˆåÔ6ˆ	Ý˜9Ñ%Ô%ð 	ð 	ˆDØÐ ¨	¨	°8°*¸dÑ(CÔ(CÐ Ø$-¨d¤OÑ!�˜'Ø˜X w°Ð5Ð5Ð5Ð5ØˆHˆHð		ð 	r,   Nc                 óÊ   — || _         |€t                               ¦   «         | _        n|| _        i | _        g | _        i | _        |€t          ¦   «         | _        d S || _        d S r4   )	rû   re   Ú	AddActionr)  rP  r&  r'  Ú	frozensetr+  )r)   rû   r)  r+  s       r+   r(   z_SmartAddHelper.__init__  sa   € ØˆŒ	Øˆ>ÝŸ-š-™/œ/ˆDŒKˆKà ˆDŒKØˆŒØˆŒ
ØˆŒØÐ$Ý%.¡[¤[ˆDÔ"Ð"Ð"à%6ˆDÔ"Ð"Ð"r,   Tc                 óü  — |sdg}| j                              ¦   «         r't          t          t          j        |¦  «        ¦  «        }i }t	          j        | j         j        |¦  «        D ]²}| j                              |¦  «        rt          j
        |¬¦  «        ‚| j                              |¦  «        }t	          j        |¦  «        }t	          j        |¦  «        \  }}|                      |¦  «        }	|	€|                      d |||¦  «        }	|dk    r||	f||<   Œ³|sd S t          |                      |¦  «        ¦  «        }
t#          j        d¦  «        }|
D �]$\  }}}	}| j                              |¦  «        }d }|	€.t	          j        |¦  «        }t	          j        |j        ¦  «        }n|	j        }| j                             | j         |||¦  «        rŒ~t2          j                             |¦  «        st9          j        d||¦  «         Œ´|                     |¦  «        rt9          j        d|z  ¦  «         Œá|| j        v rt9          j        d|¦  «         �Œ|dk    rf|dk    r`	 tA          j!        |¦  «        }tD          j#         $                    |¦  «         d	}n+# t          j%        $ r d
}Y nt          j&        $ r d	}Y nw xY wd
}|	�n0|rt9          j        d|¦  «         n|                      ||||¦  «        }	|dk    �r{|�sx|	j        dk    r|  '                    |	|¦  «        }	tQ          tS          j*        |¦  «        ¦  «        D �]4}t	          j        |¦  «        \  }}t	          j+        ||¦  «        }| j                              |¦  «        rt9          j,        d|¦  «         Œ_t	          j+        ||¦  «        }| j-         .                    |¦  «        }|�	|d         }n|	j/         .                    |¦  «        }|�|
 0                    ||||	f¦  «         ŒÏ| j          1                    |¦  «        }|�0| j2         3                    |g ¦  «         0                    |¦  «         �Œ|
 0                    ||d |	f¦  «         �Œ6�Œ&d S )Nú.r?  r´   z[\r\n]z)skipping %s (can't add file of kind '%s')zskipping %r (contains \n or \r)z1skipping %s (generated to help resolve conflicts)r½   TFzskipping nested tree %rzskip control directory %rrR  )4rû   rR   ro   Úmapr   ÚnormalizepathÚcanonical_relpathsÚbasedirrC  r   rD  ÚabspathÚ	file_kindÚnormalized_filenamerV  r^  ri  ÚreÚcompileÚ	file_statÚfile_kind_from_stat_modeÚst_moder$   r)  Ú	skip_filer1  ÚInventoryEntryÚversionable_kindr   ÚwarningÚsearchr+  ry   Úget_transport_from_pathr	   ÚControlDirFormatÚfind_formatr§   ÚUnsupportedFormatErrorrZ  re  ÚosÚlistdirr’   ÚmutterrP  rT  r¶   r°   Ú
is_ignoredr'  Ú
setdefault)r)   r(  r“   rf  Úfilepathrs  r$   rU  Ú_rY  Úthings_to_addÚillegalpath_rer´   r`  Ú
stat_valuer   Úsub_treeÚsubfÚinv_fr«   Úsub_invpr›   Úsub_ieÚignore_globs                           r+   re   z_SmartAddHelper.add&  s  € Øð 	ð ˜ˆIð
 Œ9×&Ò&Ñ(Ô(ð 	DÝ�S¥Ô!6¸	ÑBÔBÑCÔCˆIàˆ	õ
  Ô2°4´9Ô3DÀiÑPÔPð 	:ð 	:ˆHð Œy×,Ò,¨XÑ6Ô6ð JÝÔ6ÀÐIÑIÔIÐIà”i×'Ò'¨Ñ1Ô1ˆGÝÔ$ WÑ-Ô-ˆDõ
 "Ô5°hÑ?Ô?‰KˆH�aØ—l’l 8Ñ,Ô,ˆGØˆØ×2Ò2Ø˜( D¨(ñ4ô 4�à�{Ò"Ð"à'/°Ð&9�	˜(Ñ#øàð 	àˆFå˜T×5Ò5°iÑ@Ô@ÑAÔAˆåœ IÑ.Ô.ˆØ7Dð `	Añ `	AÑ3ˆI�x ¨)à”i×'Ò'¨	Ñ2Ô2ˆGð ˆJØˆÝ$Ô.¨wÑ7Ô7�
ÝÔ7¸
Ô8JÑKÔK��à”|�ð Œ{×$Ò$ T¤Y°¸¸zÑJÔJð ØÝ!Ô0×AÒAÀ$ÑGÔGð Ý”ÐIØ% tñ-ô -ð -àØ×$Ò$ YÑ/Ô/ð Ý”ÐAÀGÑKÑLÔLÐLØØ˜DÔ2Ð2Ð2õ ”ØGØñô ð ñ à�{Ò"Ð" y°B¢ ð$Ý .Ô FÀwÑ OÔ O�IÝÔ/×;Ò;¸IÑFÔFÐFØ#�H�HøÝÔ,ð %ð %ð %Ø$�H�H�HÝÔ4ð $ð $ð $Ø#�H�H�Hð$øøøð !�àÐ"ØØð =õ ”Ð7¸ÑAÔAÐAÐAà×2Ò2°9¸iÈØ3;ñ=ô =�ð �{Ò"Ñ"¨8Ñ"Ø”< ;Ò.Ð.Ø"×8Ò8¸À(ÑKÔK�Gå"¥2¤:¨gÑ#6Ô#6Ñ7Ô7ð Añ A�DÝ&Ô:¸4Ñ@Ô@‘H�E˜1õ #Ô+¨I°tÑ<Ô<�Dð
 ”y×4Ò4°TÑ:Ô:ð !ÝœÐ%@À$ÑGÔGÐGØ Ý&Ô/°¸%Ñ@Ô@�HØ œN×.Ò.¨xÑ8Ô8�EØÐ(Ø!& q¤˜˜à!(Ô!1×!5Ò!5°eÑ!<Ô!<˜ØÐ)à%×,Ò,¨d°H¸fÀgÐ-NÑOÔOÐOÐOð
 '+¤i×&:Ò&:¸4Ñ&@Ô&@˜Ø&Ð2Ø œL×3Ò3Ø +¨Rñ1ô 1ß17²¸±´°±à)×0Ò0Ø!% x°°wÐ ?ñAô Að Añ Aùð`	Að `	As   É$5JÊK Ê-K Ê?K r4   ©T)r/   rI   rJ   rí   r%  rV  rZ  r^  ri  r(   re   rQ   r,   r+   r$  r$  ¹  sš   € € € € € Ø+Ð+ð-ð -ð -ð
ð ð ð$ð ð ð(ð (ð (ðT
ð 
ð 
ð7ð 7ð 7ð 7ðNAð NAð NAð NAð NAð NAr,   r$  c                   óº   — e Zd Zd„ Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Z	d	„ Z
dd
„Zdd„Z	 	 dd„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd d„Zd„ Zej        fd„Zd„ Zd„ Zd„ ZdS )!r3  c                 ó@   — t          j        | ||¦  «         || _        d S r4   )r   r(   rX   )r)   rÑ   r|   rÒ   s       r+   r(   zInventoryRevisionTree.__init__¹  s"   € ÝÔ˜d J°Ñ<Ô<Ð<ØˆŒˆˆr,   c                 óŽ   — |                       |¦  «        }| j        j        }||j        vr|j                             |¦  «         |S )rÕ   )r×   Ú_repositoryrß   rà   r°   )r)   r    r   rÀ   rá   râ   ræ   s          r+   r¿   z(InventoryRevisionTree._get_file_revision½  sK   € à×.Ò.¨tÑ4Ô4ˆØÔ"Ô(ˆØ˜"Ô4Ð4Ð4ØÔ&×-Ò-¨gÑ6Ô6Ð6ØÐr,   c                 óÀ   — |                       |¦  «        }	 | j                             |j        ¦  «        }n"# t          j        $ r t          |¦  «        ‚w xY w|j        S r4   )r~   r˜  Úget_revisionr   r   ÚNoSuchRevisionr   Ú	timestamp)r)   r    r}   r   s       r+   Úget_file_mtimez$InventoryRevisionTree.get_file_mtimeÅ  sg   € Ø�]Š]˜4Ñ Ô ˆð	1ØÔ'×4Ò4°R´[ÑAÔAˆHˆHøÝÔ$ð 	1ð 	1ð 	1Ý*¨4Ñ0Ô0Ð0ð	1øøøàÔ!Ð!s	   —7 ·Ac                 ó6   — |                       |¦  «        j        S r4   )r~   Ú	text_sizers   s     r+   Úget_file_sizez#InventoryRevisionTree.get_file_sizeÍ  s   € Ø�}Š}˜TÑ"Ô"Ô,Ð,r,   Nc                 óT   — |                       |¦  «        }|j        dk    r|j        S d S )NÚfile)r~   r$   Ú	text_sha1)r)   r    r�  r}   s       r+   Úget_file_sha1z#InventoryRevisionTree.get_file_sha1Ð  s-   € Ø�]Š]˜4Ñ Ô ˆØŒ7�fÒÐØ”<ÐØˆtr,   c                 ó6   — |                       |¦  «        j        S r4   )r~   r   rs   s     r+   r×   z'InventoryRevisionTree.get_file_revisionÖ  s   € Ø�}Š}˜TÑ"Ô"Ô+Ð+r,   c                 óT   — |                       |¦  «        }|j        dk    rdS |j        S )Nr¢  F)r~   r$   r%   r¸   s      r+   Úis_executablez#InventoryRevisionTree.is_executableÙ  s-   € Ø�]Š]˜4Ñ Ô ˆØŒ7�fÒÐØ�5ØŒ}Ðr,   c                 óF   — t          |                      |¦  «        ¦  «        S r4   )Úboolrt   )r)   r@  s     r+   Úhas_filenamez"InventoryRevisionTree.has_filenameß  s   € Ý�D—L’L Ñ*Ô*Ñ+Ô+Ð+r,   c                 ó`  — |�1|                       |¦  «        }|                     |¦  «        d         }nWt          j        | j        j                             |¦  «        ¦  «        }|                     ¦   «                              ¦   «         }|€d S t          j
                             ||¬¦  «        S )Nr   )Úpossible_transports)rt   Úget_reference_infor   Úopen_from_transportr˜  Úuser_transportÚcloneÚopen_branchÚ
get_parentÚ_mod_branchÚBranchÚopen)r)   r    r   r¬  r   Ú
parent_urlÚsubdirs          r+   Úreference_parentz&InventoryRevisionTree.reference_parentâ  sª   € ØÐØ—l’l 4Ñ(Ô(ˆGØ×2Ò2°7Ñ;Ô;¸AÔ>ˆJˆJåÔ3ØÔ Ô/×5Ò5°dÑ;Ô;ñ=ô =ˆFà×+Ò+Ñ-Ô-×8Ò8Ñ:Ô:ˆJØÐØ�4ÝÔ!×&Ò&ØØ 3ð 'ñ 5ô 5ð 	5r,   c                 ó^   — |                      |                      |¦  «        ¦  «        d         S )Nr   )r­  rt   )r)   r    r   s      r+   r­  z(InventoryRevisionTree.get_reference_infoð  s'   € Ø×(Ò(¨¯ª°dÑ);Ô);Ñ<Ô<¸QÔ?Ð?r,   FTc              #   óÈ  K  — |€
d }| j         }n|                      |¦  «        \  }}|€d S |                     ||¬¦  «        }|j        �|s|€t	          |¦  «         |D ]ƒ\  }}	|	j        dk    rf|rd|                      ||	j        |	j        ¦  «        }
|
 	                    d||¬¦  «        D ])\  }}}}	|rt          j        ||¦  «        }n|}||||	fV — Œ*Œv|d|	j        |	fV — Œ„d S )N)Úfrom_dirÚ	recursiver¦   T)Úinclude_rootr®   r¼  ÚV)r^   rr   r­   rƒ   r  r$   r…   r   r‡   Ú
list_filesr   r’   )r)   r½  r»  r¼  r®   Úfrom_dir_idr|   Úentriesr    r›   r•   ÚsubpathÚstatusr$   Úfull_subpaths                  r+   r¿  z InventoryRevisionTree.list_filesó  sZ  è è € ð ÐØˆKØÔ%ˆCˆCà#×5Ò5°hÑ?Ô?ÑˆC�ØÐ"à�Ø×"Ò"¨KÀ9Ð"ÑMÔMˆØŒ8Ð¨Ð¸Ð9Iå�‰MŒMˆMØ"ð 	3ð 	3‰KˆD�%ØŒzÐ-Ò-Ð-°.Ð-Ø×/Ò/Ø˜%œ-¨Ô)AñCô C�à4;×4FÒ4FØ%)¸.Ø"+ð 5Gñ 5-ô 5-ð <ð <Ñ0�G˜V T¨5ð ð ,Ý'.Ô'7¸¸gÑ'FÔ'F˜˜à'+˜Ø&¨°°eÐ;Ð;Ð;Ð;Ð;ð<ð ˜C ¤¨UÐ2Ð2Ð2Ð2Ð2ð	3ð 	3r,   c                 ó6   — |                       |¦  «        j        S r4   )r~   Úsymlink_targetrs   s     r+   Úget_symlink_targetz(InventoryRevisionTree.get_symlink_target  s   € à�}Š}˜TÑ"Ô"Ô1Ð1r,   c                 ó6   — |                       |¦  «        j        S r4   )r~   r‡   rs   s     r+   Úget_reference_revisionz,InventoryRevisionTree.get_reference_revision  s   € Ø�}Š}˜TÑ"Ô"Ô5Ð5r,   c                 óö  — 	 t          j        | j        j                             |¦  «        ¦  «        }n'# t
          j        $ r}t          |¦  «        |‚d }~ww xY w|                     ¦   «         }	 | 	                    |¦  «        }n"# t
          j
        $ r t          |¦  «        ‚w xY w|�O||                     d¦  «        k    r6t          d                     ||                     d¦  «        ¦  «        ¦  «        ‚|S )Nr½   zinvalid root id: {!r} != {!r})r   r®  r˜  r¯  r°  r   r§   r   Úfind_repositoryrÏ   r›  rt   r¯   r.   )r)   r    r   r‡   r·  r©   ÚsubrepoÚrevtrees           r+   r…   z&InventoryRevisionTree._get_nested_tree  s  € ð	1ÝÔ3ØÔ Ô/×5Ò5°dÑ;Ô;ñ=ô =ˆFˆFøåÔ$ð 	1ð 	1ð 	1Ý# DÑ)Ô)¨qÐ0øøøøð	1øøøà×(Ò(Ñ*Ô*ˆð	*Ø×+Ò+Ð,>Ñ?Ô?ˆGˆGøÝÔ$ð 	*ð 	*ð 	*Ý# DÑ)Ô)Ð)ð	*øøøàÐ 7¨g¯oªo¸bÑ.AÔ.AÒ#AÐ#AÝ Ð!@×!GÒ!GØ˜Ÿš¨Ñ,Ô,ñ".ô ".ñ /ô /ð /àˆs!   ‚14 ´AÁAÁAÁ0B ÂB%c                 óZ   — |                       |¦  «        }|                      |d |¦  «        S r4   )rÉ  r…   )r)   r    Únested_revids      r+   r‘   z%InventoryRevisionTree.get_nested_tree)  s-   € Ø×2Ò2°4Ñ8Ô8ˆØ×$Ò$ T¨4°Ñ>Ô>Ð>r,   c                 ó6   — |                       |¦  «        j        S r4   )r~   r$   rs   s     r+   r$   zInventoryRevisionTree.kind-  s   € Ø�}Š}˜TÑ"Ô"Ô'Ð'r,   c                 óÎ   — 	 |                       |¦  «        }n# t          j        $ r Y dS w xY w|j        }|dk    r||j        |j        |j        fS |dk    r|dd|j        fS |dddfS )zSee Tree.path_content_summary.)ÚmissingNNNr¢  r  N)r~   ry   rz   r$   rŸ  r%   r£  rÆ  )r)   r    r›   r$   s       r+   Úpath_content_summaryz*InventoryRevisionTree.path_content_summary0  s“   € ð	1Ø—M’M $Ñ'Ô'ˆEˆEøÝÔ(ð 	1ð 	1ð 	1Ø0Ð0Ð0ð	1øøøàŒzˆØ�6Š>ˆ>Ø˜%œ/¨5Ô+;¸U¼_ÐMÐMØ�YÒÐØ˜$  eÔ&:Ð;Ð;à˜$  dÐ+Ð+s   ‚ ˜+ª+c                 ó(   — |€dS |j         |j        d fS )N)NFN)r$   r%   )r)   r›   r    s      r+   Ú_comparison_dataz&InventoryRevisionTree._comparison_data>  s   € Øˆ=Ø$Ð$ØŒz˜5Ô+¨TÐ1Ð1r,   r½   c              #   óö  K  — d}|                       |¦  «        \  }}|€g }n||fg}|rÐg }|                     ¦   «         \  }}|r|dz   }	nd}	|                     |¦  «        }
g }|
                     ¦   «         D ]U\  }}|	|z   }|                     |||j        d |j        f¦  «         |j        |k    r|                     ||j        f¦  «         ŒV||fV — |                     t          |¦  «        ¦  «         |°Îd S d S )Nr´   r€   r½   )	rr   ÚpopÚ	get_entryÚsorted_childrenr°   r$   r   ÚextendÚreversed)r)   ÚprefixÚ
_directoryr|   Útop_idrÿ   Údirblockrƒ   r   Úrelrootr›   Úsubdirsr#   r  Útoppaths                  r+   ÚwalkdirszInventoryRevisionTree.walkdirsC  s?  è è € Ø ˆ
Ø×,Ò,¨VÑ4Ô4‰ˆˆVØˆ>ØˆGˆGà Ð'Ð(ˆGØð 	.ØˆHØ#ŸKšK™MœM‰MˆD�'Øð Ø ™*��à�à—M’M 'Ñ*Ô*ˆEØˆGØ$×4Ò4Ñ6Ô6ð =ð =‘��eØ! D™.�Ø—’ ¨$°´
¸DÀ%Ä*Ð MÑNÔNÐNØ”: Ò+Ð+Ø—N’N G¨U¬]Ð#;Ñ<Ô<Ð<øØ˜�.Ð Ð Ð à�NŠN�8 GÑ,Ô,Ñ-Ô-Ð-ð# ð 	.ð 	.ð 	.ð 	.ð 	.r,   c              #   óÊ   ‡ K  — ˆ fd„|D ¦   «         }	 ‰ j                              |¦  «        E d{V —† dS # t          j        $ r}t	          j        |j        ¦  «        ‚d}~ww xY w)zeSee Tree.iter_files_bytes.

        This version is implemented on top of Repository.iter_files_bytesc                 ól   •— g | ]0\  }}‰                      |¦  «        ‰                     |¦  «        |f‘Œ1S rQ   )rt   r×   )rš   rä   Úir)   s      €r+   rÙ   z:InventoryRevisionTree.iter_files_bytes.<locals>.<listcomp>a  sL   ø€ ð 9ð 9ð 9Ù"& ! Qð  $Ÿ|š|¨A™œ°×0FÒ0FÀqÑ0IÔ0IÈ1ÐMð 9ð 9ð 9r,   N)r˜  Úiter_files_bytesr   ÚRevisionNotPresentry   rz   r   )r)   Údesired_filesÚrepo_desired_filesr©   s   `   r+   rç  z&InventoryRevisionTree.iter_files_bytes]  sš   øè è € ð9ð 9ð 9ð 9Ø*7ð9ñ 9ô 9Ðð	7ØÔ'×8Ò8Ð9KÑLÔLÐLÐLÐLÐLÐLÐLÐLÐLÐLøÝÔ(ð 	7ð 	7ð 	7Ý Ô+¨A¬IÑ6Ô6Ð6øøøøð	7øøøs   “ 5 µA"ÁAÁA"c                 óØ   — |                       |¦  «        }||                      |¦  «        f}| j        j                             ¦   «         }|                     |¦  «        }d„ |D ¦   «         S )zSee Tree.annotate_iterc                 ó(   — g | ]\  }}|d          |f‘ŒS )éÿÿÿÿrQ   )rš   ÚkeyÚlines      r+   rÙ   z7InventoryRevisionTree.annotate_iter.<locals>.<listcomp>n  s$   € Ð=Ð=Ð=¡I C¨��R”˜$�Ð=Ð=Ð=r,   )rt   r×   r˜  rß   Úget_annotatorÚannotate_flat)r)   r    Údefault_revisionr   Útext_keyÚ	annotatorÚannotationss          r+   Úannotate_iterz#InventoryRevisionTree.annotate_iterh  si   € à—,’,˜tÑ$Ô$ˆØ˜T×3Ò3°DÑ9Ô9Ð:ˆØÔ$Ô*×8Ò8Ñ:Ô:ˆ	Ø×-Ò-¨hÑ7Ô7ˆØ=Ð=°Ð=Ñ=Ô=Ð=r,   c                 ó\   — | |u rdS t          |t          ¦  «        r| j        |j        k    S dS ©NTF)r7   r3  r^   r9   s     r+   r;   zInventoryRevisionTree.__eq__p  s:   € Ø�5ˆ=ˆ=Ø�4Ý�eÕ2Ñ3Ô3ð 	AØÔ'¨5Ô+?Ò?Ð@Øˆur,   c                 ó   — | |k     S r4   rQ   r9   s     r+   Ú__ne__zInventoryRevisionTree.__ne__w  s   € Ø˜E’MÐ"Ð"r,   c                 ó    — t          d¦  «        ‚)Nznot hashable)r]   r1   s    r+   Ú__hash__zInventoryRevisionTree.__hash__z  s   € Ý˜Ñ(Ô(Ð(r,   r4   r�   )FNTF)r½   )r/   rI   rJ   r(   r¿   r�  r   r¤  r×   r§  rª  r¸  r­  r¿  rÇ  rÉ  r…   r‘   r$   rÓ  rÕ  rã  rç  r   ÚCURRENT_REVISIONrö  r;   rú  rü  rQ   r,   r+   r3  r3  ·  s°  € € € € € ðð ð ðð ð ð"ð "ð "ð-ð -ð -ðð ð ð ð,ð ,ð ,ðð ð ð,ð ,ð ,ð5ð 5ð 5ð 5ð@ð @ð @ð @ð GKØ"'ð3ð 3ð 3ð 3ð<2ð 2ð 2ð6ð 6ð 6ðð ð ð"?ð ?ð ?ð(ð (ð (ð,ð ,ð ,ð2ð 2ð 2ð
.ð .ð .ð .ð4	7ð 	7ð 	7ð 4<Ô3Lð >ð >ð >ð >ðð ð ð#ð #ð #ð)ð )ð )ð )ð )r,   r3  c                   ór   — e Zd ZdZed„ ¦   «         Zd„ Zdddg ddfd„Zed„ ¦   «         Z		 dd	„Z
dd„Zdd„ZdS )ÚInterInventoryTreez9InterTree implementation for InventoryTree objects.

    c                 óV   — t          |t          ¦  «        ot          |t          ¦  «        S r4   )r7   rO   )ÚklsÚsourceÚtargets      r+   Úis_compatiblez InterInventoryTree.is_compatible‚  s(   € õ ˜6¥=Ñ1Ô1ð 2Ý˜6¥=Ñ1Ô1ð	3r,   c           
      ól  — |€|€dS |j         }n|j         }|�0d}|j        }|j        }| j                             ||¦  «        \  }	}
}n
d}d}d}d}	d}
|�0d}|j        }|j        }| j                             ||¦  «        \  }}}n
d}d}d}d}d}||f}|	|f}d}|	|k    rd}nž|	dk    r|                      ||||¦  «        sd}n}|	dk    r9| j                             |¦  «        | j                             |¦  «        k    rd}n>|	dk    r8| j                             |¦  «        | j                             |¦  «        k    rd}||f}||f}|
|f}|dusH|d         |d         k    s6|d         |d         k    s$|d         |d         k    s|d         |d         k    rd}nd}t          |||f||||||¦  «        |fS )	aè  Generate a iter_changes tuple between source_entry and target_entry.

        :param source_entry: An inventory entry from self.source, or None.
        :param target_entry: An inventory entry from self.target, or None.
        :param source_path: The path of source_entry.
        :param target_path: The path of target_entry.
        :return: A tuple, item 0 of which is an iter_changes result tuple, and
            item 1 is True if there are any changes in the result tuple.
        NTFr¢  r  r¦   r   r@   )
r   r#   r   r  rÕ  r  Úfile_content_matchesrÇ  rÉ  r   )r)   Úsource_entryÚtarget_entryÚsource_pathÚtarget_pathr   Úsource_versionedÚsource_nameÚsource_parentÚsource_kindÚsource_executableÚsource_statÚtarget_versionedÚtarget_nameÚtarget_parentÚtarget_kindÚtarget_executableÚtarget_statr"   r$   r!   Úparentr#   r%   r	  s                            r+   Ú_changes_from_entriesz(InterInventoryTree._changes_from_entries‰  sy  € ð ÐØÐ#Ø�tØ"Ô*ˆGˆGà"Ô*ˆGØÐ#Ø#ÐØ&Ô+ˆKØ(Ô2ˆMà”×,Ò,¨\¸;ÑGÔGñ 8ˆKÐ*¨K¨Kð  %ÐØˆKØ ˆMØˆKØ $ÐØÐ#Ø#ÐØ&Ô+ˆKØ(Ô2ˆMà”×,Ò,¨\¸;ÑGÔGñ 8ˆKÐ*¨K¨Kð  %ÐØˆKØ ˆMØˆKØ $ÐØ%Ð'7Ð8ˆ	Ø˜[Ð)ˆØˆØ˜+Ò%Ð%Ø"ˆOˆOØ˜FÒ"Ð"Ø×,Ò,Ø Ø ñ.ô .ð 'ð #'�øØ˜IÒ%Ð%Ø”×.Ò.¨{Ñ;Ô;Ø”K×2Ò2°;Ñ?Ô?ò@ð @à"&�øØÐ,Ò,Ð,Ø”×2Ò2°;Ñ?Ô?Ø”{×9Ò9¸+ÑFÔFòGð Gà"&�Ø Ð/ˆØ˜[Ð)ˆØ'Ð):Ð;ˆ
Ø 5Ð(Ð(¨I°a¬L¸IÀa¼LÒ,HÐ,HØ�1ŒI˜ œÒ"Ð" d¨1¤g°°a´Ò&8Ð&8Ø˜1” ¨A¤Ò.Ð.ØˆGˆGàˆGÝ"Ø�k ;Ð/°Ø�v˜t T¨:ñ7ô 7à8?ð@ð 	@r,   FNTc              #   óØ	  ‡K  — |sg }nt          |¦  «        }t          ¦   «         }g }‰g k    rg }	g }
nL| j                             ‰| j        g|z   |¬¦  «        }	| j                             ‰| j        g|z   |¬¦  «        }
‰�t          ¦   «         }t          ¦   «         }|rBt          ˆfd„| j                             ¦   «         D ¦   «         ¦  «        }t          |¦  «        }nt          ¦   «         }i }t          | j                             |
¬¦  «        ¦  «        }t          |¦  «        }t          | j                             |	¬¦  «        ¦  «        }|  
                    d„ |D ¦   «         ¦  «        }t          |¦  «        t          |¦  «        z   }d}t          ¦   «         }|D �]ô\  }}|r·|d         d         |                     d¦  «        k     r’|                     ¦   «         }| j                             ||d         ¦  «        \  }}}t!          dd|d         fd	d
dd|d         d         fd|fd|f¦  «        V — |r%|d         d         |                     d¦  «        k     °’||         }|�|                     |¦  «        }nd}|                      ||||¬¦  «        \  }}|j        d         ||j        <   |dz  }|j        d         r|dz  }|�|                     d||¦  «         |s|r@‰�:|                     |j        d         ¦  «         |                     |j        ¦  «         |V — ‰�l|j        d         dk    r|                     |j        ¦  «         |j        d         r|                     ¦   «         r |                     |j        d         ¦  «         �Œö|rm|                     ¦   «         }| j                             ||d         ¦  «        \  } }!}"t!          dd|d         fd	d
dd|d         d         fd| fd|!f¦  «        V — |°m|D ]²\  }#}$|$j        }%|%|v rŒ|                      |#¦  «        }&|dz  }|�|                     d||¦  «         d}'|$j        df}(|$j        df})| j                             |$|#¦  «        \  }*}+},|*df}-|+df}.|*du}/|                     |%¦  «         t!          |%|#|&f|/|'|(|)|-|.¦  «        V — Œ³t          |¦  «        }‰�|                      ||¦  «        D ]}|V — ŒdS dS )aˆ  Generate an iterator of changes between trees.

        A tuple is returned:
        (file_id, (path_in_source, path_in_target),
         changed_content, versioned, parent, name, kind,
         executable)

        Changed_content is True if the file's content has changed.  This
        includes changes to its kind, and to a symlink's target.

        versioned, parent, name, kind, executable are tuples of (from, to).
        If a file is missing in a tree, its kind is None.

        Iteration is done in parent-to-child order, relative to the target
        tree.

        There is no guarantee that all paths are in sorted order: the
        requirement to expand the search due to renames may result in children
        that should be found early being found late in the search, after
        lexically later results have been returned.
        :param require_versioned: Raise errors.PathsNotVersionedError if a
            path in the specific_files list is not versioned in one of
            source, target or extra_trees.
        :param specific_files: An optional list of file paths to restrict the
            comparison to. When mapping filenames to ids, all matches in all
            trees (including optional extra_trees) are used, and all children
            of matched directories are included. The parents in the target tree
            of the specific files up to and including the root of the tree are
            always evaluated for changes too.
        :param want_unversioned: Should unversioned files be returned in the
            output. An unversioned file is defined as one with (False, False)
            for the versioned pair.
        ra   Nc                 ól   •— g | ]0}‰�t          j        ‰|¦  «        ¯|                     d¦  «        |f‘Œ1S )Nr€   )r   Úis_inside_anyr]  )rš   r¨   r±   s     €r+   rÙ   z3InterInventoryTree.iter_changes.<locals>.<listcomp>  sP   ø€ ð &Pð &Pð &P¸Aà)7Ð)?Ý&-Ô&;¸NÈAÑ&NÔ&Nð *@ð ()§w¢w¨s¡|¤|°QÐ&7à)?Ð)?Ð)?r,   rS  c                 ó   — g | ]\  }}|‘ŒS rQ   rQ   )rš   r¨   r©   s      r+   rÙ   z3InterInventoryTree.iter_changes.<locals>.<listcomp>  s   € Ð-NÐ-NÐ-N±D°A°q¨aÐ-NÐ-NÐ-Nr,   r   r€   r@   T)FFr�   rí  )r	  r
  zcomparing filesr´   )TF)ro   rd   r  rl   r  re  Úextrasr   rž   ÚdictÚfind_source_pathsr\   r   r]  ÚpopleftrÕ  r   rT  r  r    r   r"   rý   re   r   r°   r$   rD   Úfind_target_pathr#   Ú_handle_precise_ids)0r)   Úinclude_unchangedr±   rê   Úextra_treesrb   Úwant_unversionedÚprecise_file_idsÚchanged_file_idsÚtarget_specific_filesÚsource_specific_filesÚseen_parentsÚ	seen_dirsÚall_unversionedÚto_pathsÚfrom_entries_by_dirÚ	from_dataÚto_entries_by_dirÚpath_equivsÚnum_entriesÚentry_countÚ
fake_entryr
  r  Úunversioned_pathr  r  r  r	  r  Úresultr	  Úto_kindÚto_executableÚto_statr    Ú
from_entryr   Úto_pathr"   r  r#   Ú	from_kindÚfrom_executabler�  r$   r%   r!   s0     `                                             r+   r  zInterInventoryTree.iter_changesÑ  sa  øè è € ðH ð 	,ØˆKˆKå˜{Ñ+Ô+ˆKå™5œ5ÐØÐØ˜RÒÐØ$&Ð!Ø$&Ð!Ð!à$(¤K×$OÒ$OØ ¤ °Ñ ;Ø"3ð %Pñ %5ô %5Ð!ð %)¤K×$OÒ$OØ ¤ °Ñ ;Ø"3ð %Pñ %5ô %5Ð!ð Ð%õ ™5œ5ˆLÝ™œˆIØð 	&Ý$ð &Pð &Pð &Pð &PØ&*¤k×&8Ò&8Ñ&:Ô&:ð&Pñ &Pô &Pñ Qô QˆOõ $ OÑ4Ô4ˆOˆOå#™gœgˆOØˆÝ" 4¤;×#BÒ#BØ0ð $Cñ $2ô $2ñ 3ô 3ÐåÐ,Ñ-Ô-ˆ	Ý  ¤×!@Ò!@Ø0ð "Añ "2ô "2ñ 3ô 3Ðà×,Ò,Ð-NÐ-NÐ<MÐ-NÑ-NÔ-NÑOÔOˆÝÐ-Ñ.Ô.µÐ5FÑ1GÔ1GÑGˆØˆõ ‘Z”Zˆ
Ø):ð &	:ñ &	:Ñ%ˆK˜Ø"ð /Ø" 1Ô% aÔ(¨;×+<Ò+<¸SÑ+AÔ+AÒAÐAØ#2×#:Ò#:Ñ#<Ô#<Ð à”K×0Ò0Ø"Ð$4°QÔ$7ñ9ô 9ñ <�Ð.°õ *Ø˜4Ð!1°!Ô!4Ð5°t¸^Ø ØÐ+¨AÔ.¨rÔ2Ð3Ø˜;Ð'ØÐ,Ð-ñ/ô /ð /ð /ð /ð #ð /Ø" 1Ô% aÔ(¨;×+<Ò+<¸SÑ+AÔ+AÒAÐAð & kÔ2ˆKØÐ&Ø(Ÿ}š}¨[Ñ9Ô9��à#�Ø"×8Ò8Ø˜l¸ÐQ\ð 9ñ ^ô ^‰OˆF�Gà'-¤{°1¤~ˆH�V”^Ñ$Ø˜1ÑˆKØÔ Ô"ð !Ø˜qÑ �Øˆ~Ø—	’	Ð+¨[¸+ÑFÔFÐFØð Ð+ð Ø!Ð-Ø$×(Ò(¨Ô)9¸!Ô)<Ñ=Ô=Ð=Ø$×+Ò+¨F¬NÑ;Ô;Ð;Ø���àÐ)à”;˜q”> [Ò0Ð0Ø—M’M &¤.Ñ1Ô1Ð1àÔ'¨Ô*ð :¨f×.BÒ.BÑ.DÔ.Dð :Ø ×$Ò$ VÔ%5°aÔ%8Ñ9Ô9Ð9ùØð 
	'à.×6Ò6Ñ8Ô8Ðà”×,Ò,¨ZÐ9IÈ!Ô9LÑMÔMñ ,ˆG�] Gå%Ø�tÐ-¨aÔ0Ð1°4¸ØØÐ'¨Ô*¨2Ô.Ð/Ø�w�Ø�}Ð%ñ'ô 'ð 'ð 'ð 'ð ð 
	'ð !4ð 	(ð 	(ÑˆD�*Ø Ô(ˆGØ˜(Ð"Ð"àØ×+Ò+¨DÑ1Ô1ˆGØ˜1ÑˆKØˆ~Ø—	’	Ð+¨[¸+ÑFÔFÐFØ%ˆIØ Ô*¨DÐ1ˆFØ”O TÐ*ˆDà”×,Ò,¨Z¸Ñ>Ô>ñ 3ˆI�¨
à˜tÐ$ˆDØ)¨4Ð0ˆJØ'¨tÐ3ˆOà×#Ò# GÑ,Ô,Ð,Ý%Ø˜$ ˜¨/¸9ÀfØ�d˜Jñ(ô (ð (ð (ð (ð (õ Ð/Ñ0Ô0ÐØÐ%Ø×2Ò2Ð3CØ3CñEô Eð ð �à����ð &Ð%ðð r,   c                 ó~   — 	 |                       |g¬¦  «        }t          |¦  «        d         S # t          $ r Y dS w xY w)aU  Get an inventory entry from a tree, with missing entries as None.

        If the tree raises NotImplementedError on accessing .inventory, then
        this is worked around using iter_entries_by_dir on just the file id
        desired.

        :param tree: The tree to lookup the entry in.
        :param path: The path to look up
        rS  r@   N)rž   r  r  )rû   r    Úiterators      r+   Ú
_get_entryzInterInventoryTree._get_entrys  sR   € ð	Ø×/Ò/À¸vÐ/ÑFÔFˆHÝ˜‘>”> !Ô$Ð$øÝð 	ð 	ð 	Ø�4�4ð	øøøs   ‚+. ®
<»<c              #   ó  K  — |�r‡|                      d¦  «         |                     |¦  «         |sdS g }|D ]E}	 |                     | j                             |¦  «        ¦  «         Œ1# t
          j        $ r Y ŒBw xY w|D ]1}| j                             |¦  «        }| 	                    |¦  «         Œ2|                      d¦  «         |}t          ¦   «         }|D �]­}	|r|                     |	¦  «        }
d}nd}
|
€¼	 | j                             |	¦  «        }|                      | j        |¦  «        }n# t
          j        $ r d}d}Y nw xY w	 | j                             |	¦  «        }|                      | j        |¦  «        }n# t
          j        $ r d}d}Y nw xY w|                      ||||¦  «        \  }
}nd}|
j        d         }| 	                    |¦  «         |rª|
j        d         dk    r{|
j        d         dk    rj|€&|                      | j        |
j        d         ¦  «        }|                     d„ | j                             |
j        d         ¦  «        D ¦   «         ¦  «         | 	                    |
j        ¦  «         |
V — �Œ¯|�°…dS dS )aß  Fill out a partial iter_changes to be consistent.

        :param precise_file_ids: The file ids of parents that were seen during
            the iter_changes.
        :param changed_file_ids: The file ids of already emitted items.
        :param discarded_changes: An optional dict of precalculated
            iter_changes items which the partial iter_changes had not output
            but had calculated.
        :return: A generator of iter_changes items to output.
        NTr@   r   r´   c              3   ó$   K  — | ]}|j         V — Œd S r4   r˜   )rš   r  s     r+   ú	<genexpr>z9InterInventoryTree._handle_precise_ids.<locals>.<genexpr>×  s@   è è € ð 0Yð 0Yà %ð "œMð0Yð 0Yð 0Yð 0Yð 0Yð 0Yr,   )ÚdiscardÚdifference_updater°   r  rf   r   rg   r  rt   re   rd   rT  r@  r  r   r$   r    rý   r¹   r   )r)   r&  r'  Údiscarded_changesrh   r   r    Úold_idÚcurrent_idsr   r6  r  r	  r
  r  r	  Únew_parent_ids                    r+   r"  z&InterInventoryTree._handle_precise_ids…  sM  è è € ð ñ G	!Ø×$Ò$ TÑ*Ô*Ð*à×.Ò.Ð/?Ñ@Ô@Ð@Ø#ð Ø�ð ˆEØ-ð ð �	ðØ—L’L ¤×!4Ò!4°YÑ!?Ô!?Ñ@Ô@Ð@Ð@øÝ”ð ð ð ð �Dð	øøøð
 ð -ð -�Øœ×,Ò,¨TÑ2Ô2�Ø ×$Ò$ VÑ,Ô,Ð,Ð,Ø×$Ò$ TÑ*Ô*Ð*Ø*ˆKÝ"™uœuÐð 'ð ,!ñ ,!�à$ð "Ø.×2Ò2°7Ñ;Ô;�FØ#'�L�Là!�FØ�>ð6Ø&*¤k×&9Ò&9¸'Ñ&BÔ&B˜ð
 (,§¢Ø œK¨ñ(6ô (6˜˜øõ	 "œ?ð ,ð ,ð ,Ø&*˜Ø'+˜˜˜ð,øøøð6Ø&*¤k×&9Ò&9¸'Ñ&BÔ&B˜ð
 (,§¢Ø œK¨ñ(6ô (6˜˜øõ	 "œ?ð ,ð ,ð ,Ø&*˜Ø'+˜˜˜ð,øøøð '+×&@Ò&@Ø$ l°KÀñ'Nô 'N‘O�F˜G˜Gð #�Gà &Ô 0°Ô 3�Ø ×$Ò$ ]Ñ3Ô3Ð3Øð !Øœ Aœ¨+Ò5Ð5Ø"œK¨œN¨kÒ9Ð9ð (Ð/à+/¯?ª?Ø $¤¨V¬[¸¬^ñ,=ô ,=˜Là(×/Ò/ð 0Yð 0Yà)-¬×)GÒ)GÈÌÐTUÌÑ)WÔ)Wð0Yñ 0Yô 0Yñ Yô Yð Yð %×(Ò(¨¬Ñ8Ô8Ð8Ø �L�L�LùðO ñ G	!ð G	!ð G	!ð G	!ð G	!s5   »-A)Á)A;Á:A;Ã;D1Ä1EÅEÅFÆFÆFÚnonec                 óÈ   — | j                              |¦  «        }|€t          j        |¦  «        ‚	 | j                             ||¬¦  «        S # t          j        $ r Y dS w xY w)zãFind target tree path.

        :param path: Path to search for (exists in source)
        :return: path in target, or None if there is no equivalent path.
        :raise NoSuchFile: If the path doesn't exist in source
        Nr!  )r  rt   ry   rz   r  rf   r   rg   ©r)   r    r“   r   s       r+   r!  z#InterInventoryTree.find_target_pathÝ  ós   € ð ”+×%Ò% dÑ+Ô+ˆØˆ?Ý Ô+¨DÑ1Ô1Ð1ð	Ø”;×&Ò& w¸Ð&Ñ@Ô@Ð@øÝŒð 	ð 	ð 	Ø�4�4ð	øøøó   ²A ÁA!Á A!c                 óÈ   — | j                              |¦  «        }|€t          j        |¦  «        ‚	 | j                             ||¬¦  «        S # t          j        $ r Y dS w xY w)zçFind the source tree path.

        :param path: Path to search for (exists in target)
        :return: path in source, or None if there is no equivalent path.
        :raise NoSuchFile: if the path doesn't exist in target
        Nr!  )r  rt   ry   rz   r  rf   r   rg   rL  s       r+   Úfind_source_pathz#InterInventoryTree.find_source_pathì  rM  rN  r4   )rJ  )r/   rI   rJ   rí   rî   r  r  r  Ústaticmethodr@  r"  r!  rP  rQ   r,   r+   rÿ  rÿ  ~  sÚ   € € € € € ðð ð ð3ð 3ñ „[ð3ðF@ð F@ð F@ðP .3Ø$(¨T¸rØ'+¸eð`ð `ð `ð `ðD ðð ñ „\ðð$ /3ðV!ð V!ð V!ð V!ðpð ð ð ðð ð ð ð ð r,   rÿ  c                   ó<   — e Zd ZdZed„ ¦   «         Zdddg ddfd„ZdS )ÚInterCHKRevisionTreez;Fast path optimiser for RevisionTrees with CHK inventories.c                 ó°   — t          | t          ¦  «        r@t          |t          ¦  «        r+	 | j        j         |j        j         dS # t          $ r Y nw xY wdS rø  )r7   r   r^   Úid_to_entryÚAttributeError)r  r  s     r+   r  z"InterCHKRevisionTree.is_compatible  sm   € å�v�|Ñ,Ô,ð 	Ý˜6¥<Ñ0Ô0ð	ðàÔ%Ô1Ð1ØÔ%Ô1Ð1Ø�tøÝ!ð ð ð Ø�ðøøøàˆus   ¬A Á
AÁAFNTc              #   óZ  K  — | j         g}|r|                     |¦  «         t          ¦   «         }i }	|g k    rg }
n| j                             |||¬¦  «        }
t          ¦   «         }| j        j                             | j         j        ¦  «        D ]_}t          |Ž }|
�4|j        |
vr||	|j        <   Œ!| 	                    |j
        d         ¦  «         |V — | 	                    |j        ¦  «         Œ`|
�|                      |||	¬¦  «        D ]}|V — Œ|r—t          |¦  «        }| j        j                             ¦   «         D ]k\  }}|
�
|j        |
vrŒ|j        |vrOt          |j        ||fdd|j
        |j
        f|j        |j        f|j        |j        f|j        |j        f¦  «        V — Œjd S d S )Nra   r@   )rF  Fr?   )r  rÚ  rd   r  rc   r^   r  r   r   re   r   r"  r­   r#   r$   r%   )r)   r#  r±   rê   r$  rb   r%  Úlookup_treesr&  rF  r¥   r'  r6  Úrelpathr›   s                  r+   r  z!InterCHKRevisionTree.iter_changes  s6  è è € ð œ�}ˆØð 	-Ø×Ò Ñ,Ô,Ð,å™5œ5ÐØÐØ˜RÒÐØ "ÐÐà $¤× 5Ò 5°nØ6BÐVgð !6ñ !iô !iÐõ
 ™5œ5Ðà”kÔ0×=Ò=Ø”Ô*ñ,ô ,ð 	1ð 	1ˆFå(¨&Ð1ˆFØ Ð,Ø”>Ð):Ð:Ð:ð 9?Ð% f¤nÑ5ØØ ×$Ò$ VÔ%5°aÔ%8Ñ9Ô9Ð9ØˆLˆLˆLØ× Ò  ¤Ñ0Ô0Ð0Ð0ØÐ(Ø×2Ò2Ð3CØ3CÐWhð 3ñ jô jð ð �à����Øð 	>õ  #Ð#3Ñ4Ô4ÐØ"&¤+Ô"<×"IÒ"IÑ"KÔ"Kð >ð >‘�˜Ø%Ð1ØœÐ->Ð>Ð>ØØ”=Ð(8Ð8Ð8Ý-ØœØ  'Ð*ØØ$Øœ¨%¬/Ð:Øœ U¤ZÐ0Øœ U¤ZÐ0ØÔ)¨5Ô+;Ð<ñ>ô >ð >ð >ð >øð	>ð 	>ð>ð >r,   )r/   rI   rJ   rí   rQ  r  r  rQ   r,   r+   rS  rS  ÿ  sX   € € € € € ØEÐEàð
ð 
ñ „\ð
ð .3Ø$(¨T¸rØ'+¸eð8>ð 8>ð 8>ð 8>ð 8>ð 8>r,   rS  r”  )/rí   Úcollectionsr   r„  rv  Útypingr   r   r   r½   r   r³  r	   r
   r   r   r   r   r   r   ry   r   Úmutabletreer   rÑ   r   Úrevisiontreer   Úglobalsrû   r   r   r   r   r   r   r   rO   rn   rñ   rò   r  r$  r3  rÿ  Úregister_optimiserrS  rQ   r,   r+   ú<module>r`     s  ðð"ð ð Ð Ð Ð Ð Ð à 	€	€	€	Ø 	€	€	€	Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ðð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ð €Ô ˜˜™	œ	ð $ñ ô ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð3ð 3ð 3ð 3ð 3˜*ñ 3ô 3ð 3ðlQ-ð Q-ð Q-ð Q-ð Q-�Dñ Q-ô Q-ð Q-ðhBð Bð Bð Bð(ð ð ð6ð ð ð>Z-ð Z-ð Z-ð Z-ð Z-˜;¨ñ Z-ô Z-ð Z-ðz{Að {Að {Að {Að {Añ {Aô {Að {Að|D)ð D)ð D)ð D)ð D)˜L¨-ñ D)ô D)ð D)ðN{ð {ð {ð {ð {˜ñ {ô {ð {ð| €	Ô Ð/Ñ 0Ô 0Ð 0ðH>ð H>ð H>ð H>ð H>Ð-ñ H>ô H>ð H>ðV €	Ô Ð1Ñ 2Ô 2Ð 2Ð 2Ð 2r,   