§
    cÌcÎ	  ã                   óJ   — d Z ddlmZ  G d„ d¦  «        Z G d„ d¦  «        ZdS )z$This module provides an IdentityMap.é   )Úerrorsc                   ó:   ‡ — e Zd ZdZd„ Zd„ Zˆ fd„Zd„ Zd„ Zˆ xZ	S )ÚIdentityMapa  An in memory map from object id to instance.

    An IdentityMap maps from keys to single instances of objects in memory.
    We have explicit calls on the map for the root of each inheritance tree
    that is store in the map. Look for find_CLASS and add_CLASS methods.
    c                 óà   — |                       |¦  «        | j        v rt          j        d|z  ¦  «        ‚|| j        |                       |¦  «        <   |                       |¦  «        | j        |<   dS )z%Add weave to the map with a given id.z$weave %s already in the identity mapN)Ú
_weave_keyÚ_mapr   ÚBzrErrorÚ_reverse_map©ÚselfÚidÚweaves      ú4/usr/lib/python3/dist-packages/breezy/identitymap.pyÚ	add_weavezIdentityMap.add_weave!   sh   € à�?Š?˜2ÑÔ $¤)Ð+Ð+Ý”/Ð"HÈ2Ñ"MÑNÔNÐNØ).ˆŒ	�$—/’/ "Ñ%Ô%Ñ&Ø#'§?¢?°2Ñ#6Ô#6ˆÔ˜%Ñ Ð Ð ó    c                 ó^   — | j                              |                      |¦  «        d¦  «        S )z8Return the weave for 'id', or None if it is not present.N)r   Úgetr   ©r   r   s     r   Ú
find_weavezIdentityMap.find_weave(   s$   € àŒy�}Š}˜TŸ_š_¨RÑ0Ô0°$Ñ7Ô7Ð7r   c                 ód   •— t          ¦   «                              ¦   «          i | _        i | _        d S )N)ÚsuperÚ__init__r   r
   )r   Ú	__class__s    €r   r   zIdentityMap.__init__,   s.   ø€ Ý‰Œ×ÒÑÔÐØˆŒ	ØˆÔÐÐr   c                 óÒ   — t          |t          ¦  «        rt          d|z  ¦  «        ‚| j                             | j        |         ¦  «         | j                             |¦  «         dS )zRemove object from map.z%r not in identity mapN)Ú
isinstanceÚlistÚKeyErrorr   Úpopr
   )r   Ú	an_objects     r   Úremove_objectzIdentityMap.remove_object1   sa   € å�i¥Ñ&Ô&ð 	-ÝÐ3°iÑ?Ñ@Ô@Ð@àŒI�MŠM˜$Ô+¨IÔ6Ñ7Ô7Ð7ØÔ×!Ò! )Ñ,Ô,Ð,Ð,Ð,r   c                 ó   — d|z   S )zReturn the key for a weaves id.zweave-© r   s     r   r   zIdentityMap._weave_key9   s   € à˜"‰}Ðr   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r    r   Ú__classcell__)r   s   @r   r   r      s~   ø€ € € € € ðð ð7ð 7ð 7ð8ð 8ð 8ðð ð ð ð ð
-ð -ð -ðð ð ð ð ð ð r   r   c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚNullIdentityMapz†A pretend in memory map from object id to instance.

    A NullIdentityMap is an Identity map that does not store anything in it.
    c                 ó   — dS )zSee IdentityMap.add_weave.Nr"   r   s      r   r   zNullIdentityMap.add_weaveD   s   € € € r   c                 ó   — dS )zSee IdentityMap.find_weave.Nr"   r   s     r   r   zNullIdentityMap.find_weaveG   s   € àˆtr   N)r#   r$   r%   r&   r   r   r"   r   r   r)   r)   >   s<   € € € € € ðð ð
)ð )ð )ðð ð ð ð r   r)   N)r&   Ú r   r   r)   r"   r   r   ú<module>r-      s†   ðð$ +Ð *ðð ð ð ð ð ð
"ð "ð "ð "ð "ñ "ô "ð "ðJð ð ð ð ñ ô ð ð ð r   