§
    cÌc†  ã                   ó°   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ d	d
lmZmZ  G d„ d¦  «        Z G d„ d¦  «        Z G d„ d¦  «        ZdS )z	Annotate.é    )Útree_lookup_pathé   )Úosutils)ÚUnavailableRepresentation)ÚNoSuchRevision)ÚGraph)ÚNULL_REVISIONé   )Údecode_git_pathÚencode_git_pathc                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )ÚGitBlobContentFactorya$  Static data content factory.

    This takes a fulltext when created and just returns that during
    get_bytes_as('fulltext').

    :ivar sha1: None, or the sha1 of the content fulltext.
    :ivar storage_kind: The native storage kind of this factory. Always
        'fulltext'.
    :ivar key: The key of this content. Each key is a tuple with a single
        string in it.
    :ivar parents: A tuple of parent keys for self.key. If the object has
        no parent information, None (as opposed to () for an empty list of
        parents).
     c                 ó^   — || _         ||f| _        d| _        d| _        || _        d| _        dS )úCreate a ContentFactory.zgit-blobN)ÚstoreÚkeyÚstorage_kindÚparentsÚblob_idÚsize)Úselfr   ÚpathÚrevisionr   s        ú5/usr/lib/python3/dist-packages/breezy/git/annotate.pyÚ__init__zGitBlobContentFactory.__init__7   s6   € àˆŒ
Ø˜(Ð#ˆŒØ&ˆÔØˆŒØˆŒØˆŒ	ˆ	ˆ	ó    c                 ór  — |dk    r$| j         | j                                      ¦   «         S |dk    rCt          t	          j        | j         | j                                      ¦   «         ¦  «        ¦  «        S |dk    r$| j         | j                                      ¦   «         S t          | j        || j	        ¦  «        ‚)NÚfulltextÚlinesÚchunked)
r   r   Úas_raw_stringÚlistr   Úchunks_to_linesÚas_raw_chunksr   r   r   ©r   r   s     r   Úget_bytes_asz"GitBlobContentFactory.get_bytes_as@   s¥   € Ø˜:Ò%Ð%Ø”:˜dœlÔ+×9Ò9Ñ;Ô;Ð;Ø˜WÒ$Ð$Ý�Ô/°´
¸4¼<Ô0H×0VÒ0VÑ0XÔ0XÑYÔYÑZÔZÐZØ˜YÒ&Ð&Ø”:˜dœlÔ+×9Ò9Ñ;Ô;Ð;Ý'¨¬°,Ø(,Ô(9ñ;ô ;ð 	;r   c                 ó8  — |dk    rCt          t          j        | j        | j                                      ¦   «         ¦  «        ¦  «        S |dk    r1t          | j        | j                                      ¦   «         ¦  «        S t          | j        || j        ¦  «        ‚)Nr   r    )	Úiterr   r#   r   r   r$   r   r   r   r%   s     r   Úiter_bytes_asz#GitBlobContentFactory.iter_bytes_asJ   s‡   € Ø˜7Ò"Ð"Ý�Ô/°´
¸4¼<Ô0H×0VÒ0VÑ0XÔ0XÑYÔYÑZÔZÐZØ˜YÒ&Ð&Ý˜œ
 4¤<Ô0×>Ò>Ñ@Ô@ÑAÔAÐAÝ'¨¬°,Ø(,Ô(9ñ;ô ;ð 	;r   N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r&   r)   © r   r   r   r   '   sK   € € € € € ð	ð 	ðð ð ð;ð ;ð ;ð;ð ;ð ;ð ;ð ;r   r   c                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )ÚGitAbsentContentFactoryaÁ  Absent data content factory.

    :ivar sha1: None, or the sha1 of the content fulltext.
    :ivar storage_kind: The native storage kind of this factory. Always
        'fulltext'.
    :ivar key: The key of this content. Each key is a tuple with a single
        string in it.
    :ivar parents: A tuple of parent keys for self.key. If the object has
        no parent information, None (as opposed to () for an empty list of
        parents).
     c                 óP   — || _         ||f| _        d| _        d| _        d| _        dS )r   ÚabsentN)r   r   r   r   r   )r   r   r   r   s       r   r   z GitAbsentContentFactory.__init__`   s/   € àˆŒ
Ø˜(Ð#ˆŒØ$ˆÔØˆŒØˆŒ	ˆ	ˆ	r   c                 ó   — t           ‚©N©Ú
ValueErrorr%   s     r   r&   z$GitAbsentContentFactory.get_bytes_ash   ó   € ÝÐr   c                 ó   — t           ‚r5   r6   r%   s     r   r)   z%GitAbsentContentFactory.iter_bytes_ask   r8   r   Nr*   r/   r   r   r1   r1   S   sK   € € € € € ð
	ð 
	ðð ð ðð ð ðð ð ð ð r   r1   c                   ó&   — e Zd Zd„ Zd„ Zd„ Zd„ ZdS )ÚAnnotateProviderc                 óJ   — || _         | j         j        j        j        | _        d S r5   )Úchange_scannerÚ
repositoryÚ_gitÚobject_storer   )r   r=   s     r   r   zAnnotateProvider.__init__q   s!   € Ø,ˆÔØÔ(Ô3Ô8ÔEˆŒ
ˆ
ˆ
r   c                 ób  ‡ ‡— ‰ j         j                             |¦  «        \  }}g }t          ‰¦  «        Š‰ j        |         j        D ]L}	 ‰ j                              ‰|¦  «        \  }Š}n# t          $ r Y Œ/w xY w||vr|                     |¦  «         ŒMt          ˆˆ fd„|D ¦   «         ¦  «        S )Nc                 ól   •— g | ]0}t          ‰¦  «        ‰j        j                             |¦  «        f‘Œ1S r/   )r   r=   r>   Úlookup_foreign_revision_id)Ú.0Úpr   r   s     €€r   ú
<listcomp>z1AnnotateProvider._get_parents.<locals>.<listcomp>„   sP   ø€ ð #ð #ð #ð õ ˜TÑ"Ô"ØÔ#Ô.×IÒIÈ!ÑLÔLðNð#ð #ð #r   )
r=   r>   Úlookup_bzr_revision_idr   r   r   Úfind_last_change_revisionÚKeyErrorÚappendÚtuple)	r   r   Útext_revisionÚ	commit_idÚmappingÚtext_parentsÚcommit_parentr   Útext_parents	   ``       r   Ú_get_parentszAnnotateProvider._get_parentsu   s  øø€ àÔÔ*×AÒAØñô ñ 	ˆ	�7ð ˆÝ˜tÑ$Ô$ˆØ!œZ¨	Ô2Ô:ð 	1ð 	1ˆMðàÔ'×AÒAØ˜mñ-ô -ñ +�˜˜k˜køõ ð ð ð Ø�ðøøøà ,Ð.Ð.Ø×#Ò# KÑ0Ô0Ð0øÝð #ð #ð #ð #ð #ð "ð#ñ #ô #ñ $ô $ð 	$s   ÁA+Á+
A8Á7A8c                 ó”   — i }|D ]B}|\  }}|t           k    rd||<   Œ	 |                      ||¦  «        ||<   Œ3# t          $ r Y Œ?w xY w|S )Nr/   )r	   rR   rI   )r   ÚkeysÚretr   r   rL   s         r   Úget_parent_mapzAnnotateProvider.get_parent_map‰   s|   € ØˆØð 	ð 	ˆCØ$'Ñ!ˆT�=Ø¥Ò-Ð-Ø��C‘ØðØ×,Ò,¨T°=ÑAÔA��C‘�øÝð ð ð Ø�ðøøøàˆ
s   ž8¸
AÁAc              #   óH  K  — |dk    r$t          | ¦  «        }|                     |¦  «        }| j        j        j        j        }|D ]Ü\  }}	 | j        j                             |¦  «        \  }}	n## t          $ r t          |||¦  «        V — Y ŒHw xY w	 ||         j	        }
n## t          $ r t          |||¦  «        V — Y Œzw xY w	 t          |j        |
t          |¦  «        ¦  «        \  }}t          ||||¦  «        V — Œº# t          $ r t          |||¦  «        V — Y ŒÙw xY wd S )NÚtopological)r   Úiter_topo_orderr=   r>   r?   r@   rG   r   r1   ÚtreerI   r   Ú__getitem__r   r   )r   rT   ÚorderingÚinclude_delta_closureÚgraphr   r   rL   rM   rN   Útree_idÚmodeÚblob_shas                r   Úget_record_streamz"AnnotateProvider.get_record_stream–   s¨  è è € Ø�}Ò$Ð$Ý˜$‘K”KˆEØ×(Ò(¨Ñ.Ô.ˆDØÔ#Ô.Ô3Ô@ˆØ%)ð 	:ð 	:Ñ!ˆT�=ðàÔ'Ô2×IÒIØ%ñ'ô 'ñ #�	˜7˜7øõ "ð ð ð Ý-¨e°T¸=ÑIÔIÐIÐIÐIØ�ðøøøðØ 	Ô*Ô/��øÝð ð ð Ý-¨e°T¸=ÑIÔIÐIÐIÐIØ�ðøøøð:Ý#3ØÔ% wµÀÑ0EÔ0Eñ$Gô $GÑ ��xõ
 ,Ø˜4 °ñ:ô :ð :ð :ð :ð :øõ ð Jð Jð JÝ-¨e°T¸=ÑIÔIÐIÐIÐIÐIÐIðJøøøð#	:ð 	:s6   Á"A.Á.BÂBÂB Â C Â?C Ã&C?Ã?DÄDN)r+   r,   r-   r   rR   rV   rb   r/   r   r   r;   r;   o   sS   € € € € € ðFð Fð Fð$ð $ð $ð(ð ð ð:ð :ð :ð :ð :r   r;   N)r.   Údulwich.object_storer   Ú r   Úbzr.versionedfiler   Úerrorsr   r^   r   r   r	   rN   r   r   r   r1   r;   r/   r   r   ú<module>rg      sU  ðð" €ðð ð ð ð ð ð Ð Ð Ð Ð Ð Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9ðð ð ð ð ð ð Ð Ð Ð Ð Ð ðð ð ð ð ð ðð ð ð ð ð ð ð ð);ð );ð );ð );ð );ñ );ô );ð );ðXð ð ð ð ñ ô ð ð8A:ð A:ð A:ð A:ð A:ñ A:ô A:ð A:ð A:ð A:r   