§
    cÌcûe ã                   ór  — d dl Z d dlZd dlmZ ddlmZ  e e¦   «         d¦  «         ddlmZmZm	Z	m
Z ddl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 ddlmZ ddlmZmZmZ ddlmZm Z m!Z!  G d„ dej"        ¦  «        Z# G d„ de#¦  «        Z$ G d„ de¦  «        Z% G d„ d¦  «        Z& G d„ de&¦  «        Z' G d„ de'¦  «        Z( G d„ de&¦  «        Z) G d„ d¦  «        Z* G d „ d!¦  «        Z+ G d"„ d#¦  «        Z, G d$„ d%e¦  «        Z- G d&„ d'e¦  «        Z. G d(„ d)e#¦  «        Z/ G d*„ d+¦  «        Z0dS ),é    N)ÚTypeé   )Úlazy_importzê
import contextlib
import time

from breezy import (
    config,
    debug,
    graph,
    osutils,
    transactions,
    ui,
    )
from breezy.bzr import (
    pack,
    )
from breezy.bzr.index import (
    CombinedGraphIndex,
    )
)ÚerrorsÚlockable_filesÚlockdirÚ	transport)ÚindexÚbtree_index)Úonly_raises)ÚLogicalLockResult)Ú_LazyListJoinÚRepositoryWriteLockResulté   )ÚMetaDirRepositoryÚRepositoryFormatMetaDir)Ú
Serializer)ÚMetaDirVersionedFileRepositoryÚ$MetaDirVersionedFileRepositoryFormatÚVersionedFileCommitBuilder)ÚmutterÚnoteÚwarningc                   ó    — e Zd ZdZdZdZd„ ZdS )ÚRetryWithNewPacksa  Raised when we realize that the packs on disk have changed.

    This is meant as more of a signaling exception, to trap between where a
    local error occurred and the code that can actually handle the error and
    code that can retry appropriately.
    TzNPack files have changed, reload and retry. context: %(context)s %(orig_error)sc                 óˆ   — t           j                             | ¦  «         || _        || _        || _        |d         | _        dS )aJ  create a new RetryWithNewPacks error.

        :param reload_occurred: Set to True if we know that the packs have
            already been reloaded, and we are failing because of an in-memory
            cache miss. If set to True then we will ignore if a reload says
            nothing has changed, because we assume it has already reloaded. If
            False, then a reload with nothing changed will force an error.
        :param exc_info: The original exception traceback, so if there is a
            problem we can raise the original error (value from sys.exc_info())
        r   N)r   ÚBzrErrorÚ__init__ÚcontextÚreload_occurredÚexc_infoÚ
orig_error)Úselfr   r    r!   s       ú6/usr/lib/python3/dist-packages/breezy/bzr/pack_repo.pyr   zRetryWithNewPacks.__init__Z   s?   € õ 	Œ× Ò  Ñ&Ô&Ð&ØˆŒØ.ˆÔØ ˆŒØ" 1œ+ˆŒˆˆó    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úinternal_errorÚ_fmtr   © r%   r$   r   r   M   s;   € € € € € ðð ð €Nð€Dð&ð &ð &ð &ð &r%   r   c                   ó   — e Zd ZdZdZdZdS )ÚRetryAutopackz—Raised when we are autopacking and we find a missing file.

    Meant as a signaling exception, to tell the autopack code it should try
    again.
    Tz[Pack files have changed, reload and try autopack again. context: %(context)s %(orig_error)sN©r&   r'   r(   r)   r*   r+   r,   r%   r$   r.   r.   o   ó&   € € € € € ðð ð €Nð3€D€D€Dr%   r.   c                   ó&   — e Zd ZdZ	 	 	 dd„Zd„ ZdS )ÚPackCommitBuilderzÎSubclass of VersionedFileCommitBuilder to add texts with pack semantics.

    Specifically this uses one knit object rather than one knit object per
    added text, reducing memory and object pressure.
    NFTc                 ó    — t          j        | |||||||||	|
¬¦  «         t                               |j        j        j        ¦  «        | _        d S )N)Ú	timestampÚtimezoneÚ	committerÚrevpropsÚrevision_idÚlossyÚowns_transaction)r   r   ÚgraphÚGraphÚ_pack_collectionÚ
text_indexÚcombined_indexÚ_file_graph)r#   Ú
repositoryÚparentsÚconfigr4   r5   r6   r7   r8   r9   r:   s              r$   r   zPackCommitBuilder.__init__ƒ   si   € õ 	#Ô+¨D°*¸gÀvØ6?È(Ð^gØ5=È;Ð^cØ=Mð	Oñ 	Oô 	Oð 	Oõ !Ÿ;š;ØÔ'Ô2ÔAñCô CˆÔÐÐr%   c                 óh   ‡— ˆfd„|D ¦   «         }d„ | j                              |¦  «        D ¦   «         S )Nc                 ó   •— g | ]}‰|f‘ŒS r,   r,   )Ú.0r8   Úfile_ids     €r$   ú
<listcomp>z,PackCommitBuilder._heads.<locals>.<listcomp>Ž   s   ø€ ÐGÐGÐG¨;�˜+Ð&ÐGÐGÐGr%   c                 ó   — h | ]
}|d          ’ŒS ©r   r,   ©rF   Úkeys     r$   ú	<setcomp>z+PackCommitBuilder._heads.<locals>.<setcomp>�   s   € Ð?Ð?Ð?˜3��A”Ð?Ð?Ð?r%   )r@   Úheads)r#   rG   Úrevision_idsÚkeyss    `  r$   Ú_headszPackCommitBuilder._heads�   sA   ø€ ØGÐGÐGÐG¸,ÐGÑGÔGˆØ?Ð? $Ô"2×"8Ò"8¸Ñ">Ô">Ð?Ñ?Ô?Ð?r%   )NNNNNFT)r&   r'   r(   r)   r   rQ   r,   r%   r$   r2   r2   |   sV   € € € € € ðð ð ?CØ9=ØAEðCð Cð Cð Cð@ð @ð @ð @ð @r%   r2   c                   óz   — e Zd ZdZddddd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d„ Zd„ Zd„ ZdS )ÚPackz£An in memory proxy for a pack and its indices.

    This is a base class that is not directly used, instead the classes
    ExistingPack and NewPack are used.
    )ú.cixé   )ú.rixr   )ú.iixr   )ú.tixr   )ú.sixé   )ÚchkÚrevisionÚ	inventoryÚtextÚ	signatureNc                 óL   — || _         || _        || _        || _        || _        dS )a=  Create a pack instance.

        :param revision_index: A GraphIndex for determining what revisions are
            present in the Pack and accessing the locations of their texts.
        :param inventory_index: A GraphIndex for determining what inventories are
            present in the Pack and accessing the locations of their
            texts/deltas.
        :param text_index: A GraphIndex for determining what file texts
            are present in the pack and accessing the locations of their
            texts/deltas (via (fileid, revisionid) tuples).
        :param signature_index: A GraphIndex for determining what signatures are
            present in the Pack and accessing the locations of their texts.
        :param chk_index: A GraphIndex for accessing content by CHK, if the
            pack has one.
        N)Úrevision_indexÚinventory_indexr>   Úsignature_indexÚ	chk_index)r#   ra   rb   r>   rc   rd   s         r$   r   zPack.__init__£   s.   € ð" -ˆÔØ.ˆÔØ$ˆŒØ.ˆÔØ"ˆŒˆˆr%   c                 ó8   — | j         |                      ¦   «         fS )ú6Return a tuple (transport, name) for the pack content.)Úpack_transportÚ	file_name©r#   s    r$   Úaccess_tuplezPack.access_tupleº   s   € àÔ" D§N¢NÑ$4Ô$4Ð4Ð4r%   c                 óº  — i }d|                       | j        ¦  «        | j        j        j        fd|                       | j        ¦  «        | j        j        j        ffD ]T\  }}}|                     d„  |j        |¦  «        D ¦   «         ¦  «        }|rt          t          |¦  «        ¦  «        ||<   ŒU|r)ddl	m
} t          j        d| ›d ||¦  «        ›�¦  «        ‚dS )	aB  Make sure our external references are present.

        Packs are allowed to have deltas whose base is not in the pack, but it
        must be present somewhere in this collection.  It is not allowed to
        have deltas based on a fallback repository.
        (See <https://bugs.launchpad.net/bzr/+bug/288751>)
        ÚtextsÚinventoriesc              3   ó$   K  — | ]\  }}}}|V — Œd S ©Nr,   )rF   ÚidxÚkÚvÚrs        r$   ú	<genexpr>z)Pack._check_references.<locals>.<genexpr>Ï   s;   è è € ð /3ð /3Ù$�s˜A˜q !�ð/3ð /3ð /3ð /3ð /3ð /3r%   r   )ÚpformatzNewly created pack file z6 has delta references to items not in its repository:
N)Ú_get_external_refsr>   r=   r?   rb   Ú
differenceÚiter_entriesÚsortedÚlistÚpprintru   r   ÚBzrCheckError)r#   Úmissing_itemsÚ
index_nameÚexternal_refsr
   Úmissingru   s          r$   Ú_check_referenceszPack._check_references¾   s3  € ð ˆàØ×+Ò+¨D¬OÑ<Ô<ØÔ)Ô4ÔCðEð Ø×+Ò+¨DÔ,@ÑAÔAØÔ)Ô9ÔHðJð	3ð 	Bð 	BÑ.ˆZ˜¨ð $×.Ò.ð /3ð /3à"�Ô" =Ñ1Ô1ð/3ñ /3ô /3ñ 3ô 3ˆGð ð BÝ,2µ4¸±=´=Ñ,AÔ,A�˜jÑ)øØð 	2Ø&Ð&Ð&Ð&Ð&Ð&ÝÔ&Ð&ð �4�4˜˜ Ñ/Ô/Ð/ð1ñ2ô 2ð 2ð	2ð 	2r%   c                 ó   — | j         dz   S )z'Get the file name for the pack on disk.ú.pack©Únameri   s    r$   rh   zPack.file_nameÛ   s   € àŒy˜7Ñ"Ð"r%   c                 ó4   — | j                              ¦   «         S ro   )ra   Ú	key_countri   s    r$   Úget_revision_countzPack.get_revision_countß   s   € ØÔ"×,Ò,Ñ.Ô.Ð.r%   c                 ó8   — |t           j        |         d         z   S )z8Get the disk name of an index type for pack name 'name'.r   ©rS   Úindex_definitions)r#   Ú
index_typer…   s      r$   r~   zPack.index_nameâ   s   € à•dÔ,¨ZÔ8¸Ô;Ñ;Ð;r%   c                 ó2   — t           j        |         d         S )z>Get the position in a index_size array for a given index type.r   rŠ   )r#   rŒ   s     r$   Úindex_offsetzPack.index_offsetæ   s   € åÔ% jÔ1°!Ô4Ð4r%   c                 ó.   — |                       d|¦  «        S )z!The inv index is the name + .iix.r]   ©r~   ©r#   r…   s     r$   Úinventory_index_namezPack.inventory_index_nameê   ó   € à�Š˜{¨DÑ1Ô1Ð1r%   c                 ó.   — |                       d|¦  «        S )z&The revision index is the name + .rix.r\   r�   r‘   s     r$   Úrevision_index_namezPack.revision_index_nameî   s   € à�Š˜z¨4Ñ0Ô0Ð0r%   c                 ó.   — |                       d|¦  «        S )z'The signature index is the name + .six.r_   r�   r‘   s     r$   Úsignature_index_namezPack.signature_index_nameò   r“   r%   c                 ó.   — |                       d|¦  «        S )z"The text index is the name + .tix.r^   r�   r‘   s     r$   Útext_index_namezPack.text_index_nameö   s   € à�Š˜v tÑ,Ô,Ð,r%   c                 ó  — d}|dk    rd}|                       | j        |                      || j        ¦  «        | j        |                      |¦  «                 |¬¦  «        }|dk    rt          j        |_        t          | |dz   |¦  «         d S )NFr[   T©Úunlimited_cacheÚ_index)
Úindex_classÚindex_transportr~   r…   Úindex_sizesrŽ   r   Ú_gcchk_factoryÚ_leaf_factoryÚsetattr)r#   rŒ   rœ   r
   s       r$   Ú_replace_index_with_readonlyz!Pack._replace_index_with_readonlyú   s£   € ØˆØ˜ÒÐØ"ˆOØ× Ò  Ô!5Ø!%§¢°¸T¼YÑ!GÔ!GØ!%Ô!1°$×2CÒ2CØ%/ñ31ô 31ô "2à1@ð	 !ñ Bô Bˆð
 ˜ÒÐÝ"-Ô"<ˆEÔÝ��j 8Ñ+¨UÑ3Ô3Ð3Ð3Ð3r%   c                 óŠ   — t          |t          ¦  «        st          |¦  «        ‚t          | ¦  «        t          |¦  «        k     S ro   )Ú
isinstancerS   Ú	TypeErrorÚid©r#   Úothers     r$   Ú__lt__zPack.__lt__  s9   € Ý˜%¥Ñ&Ô&ð 	#Ý˜EÑ"Ô"Ð"Ý�4‘”�2˜e™9œ9Ò$Ð%r%   c                 óx   — t          t          | ¦  «        | j        | j        | j        | j        | j        f¦  «        S ro   )ÚhashÚtypera   rb   r>   rc   rd   ri   s    r$   Ú__hash__zPack.__hash__  s=   € Ý•T˜$‘Z”Z Ô!4°dÔ6JØ”_ dÔ&:¸D¼NðLñ Mô Mð 	Mr%   ro   )r&   r'   r(   r)   r‹   r   rj   r�   rh   rˆ   r~   rŽ   r’   r•   r—   r™   r¤   r«   r¯   r,   r%   r$   rS   rS   ’   s  € € € € € ðð ð ØØ ØØ ð
ð 
Ðð -1ð#ð #ð #ð #ð.5ð 5ð 5ð2ð 2ð 2ð:#ð #ð #ð/ð /ð /ð<ð <ð <ð5ð 5ð 5ð2ð 2ð 2ð1ð 1ð 1ð2ð 2ð 2ð-ð -ð -ð4ð 4ð 4ð&ð &ð &ð
Mð Mð Mð Mð Mr%   rS   c                   ó4   — e Zd ZdZ	 dd„Zd„ Zd„ Zd„ Zd„ ZdS )	ÚExistingPackz>An in memory proxy for an existing .pack and its disk indices.Nc                 ó�   — t                                | |||||¦  «         || _        || _        d||||||fv rt	          ¦   «         ‚dS )z»Create an ExistingPack object.

        :param pack_transport: The transport where the pack file resides.
        :param name: The name of the pack on disk in the pack_transport.
        N)rS   r   r…   rg   ÚAssertionError)r#   rg   r…   ra   rb   r>   rc   rd   s           r$   r   zExistingPack.__init__  sk   € õ 	�Š�d˜N¨O¸ZØ% yñ	2ô 	2ð 	2àˆŒ	Ø,ˆÔØ�N O°ZØ# T¨>ð;ð ;ð ;å Ñ"Ô"Ð"ð;ð ;r%   c                 ó"   — | j         |j         k    S ro   )Ú__dict__r©   s     r$   Ú__eq__zExistingPack.__eq__#  s   € ØŒ} ¤Ò.Ð.r%   c                 ó.   — |                       |¦  «         S ro   )r¶   r©   s     r$   Ú__ne__zExistingPack.__ne__&  s   € Ø—;’;˜uÑ%Ô%Ð%Ð%r%   c                 óŠ   — d                      | j        j        | j        j        t	          | ¦  «        | j        | j        ¦  «        S )Nz<{}.{} object at 0x{:x}, {}, {})ÚformatÚ	__class__r'   r&   r¨   rg   r…   ri   s    r$   Ú__repr__zExistingPack.__repr__)  s;   € Ø0×7Ò7ØŒNÔ% t¤~Ô'>ÅÀ4ÁÄØÔ ¤ñ,ô ,ð 	,r%   c                 óH   — t          t          | ¦  «        | j        f¦  «        S ro   )r­   r®   r…   ri   s    r$   r¯   zExistingPack.__hash__.  s   € Ý•T˜$‘Z”Z ¤Ð+Ñ,Ô,Ð,r%   ro   )	r&   r'   r(   r)   r   r¶   r¸   r¼   r¯   r,   r%   r$   r±   r±     so   € € € € € ØHÐHð 9=ð#ð #ð #ð #ð/ð /ð /ð&ð &ð &ð,ð ,ð ,ð
-ð -ð -ð -ð -r%   r±   c                   ó0   — e Zd Z	 dd„Zd„ Zd„ Zd„ Zd„ ZdS )ÚResumedPackNc           
      ó†  — t                                | |||||||
¬¦  «         || _        || _        g d¢| _        d|fd|fd|fd|fg}|
�1|                     d|
f¦  «         | j                             d¦  «         |D ])\  }}|                      |¦  «        }|j        | j        |<   Œ*|	j        | _	        |	| _
        d	| _        dS )
zCreate a ResumedPack object.©rd   ©NNNNr\   r]   r^   r_   Nr[   Úresumed)r±   r   Úupload_transportrŸ   r    ÚappendrŽ   Ú_sizeÚ_index_classrž   r=   Ú_state)r#   r…   ra   rb   r>   rc   rÄ   rg   rŸ   Úpack_collectionrd   ÚindicesrŒ   r
   Úoffsets                  r$   r   zResumedPack.__init__4  s  € õ 	×Ò˜d N°D¸.Ø-¨z¸?Ø(1ð 	ñ 	3ô 	3ð 	3ð !1ˆÔØ.ˆÔØ3Ð3Ð3ˆÔà˜Ð(Ø˜/Ð*Ø�ZÐ Ø˜/Ð*ð	ˆð Ð Ø�NŠN˜E 9Ð-Ñ.Ô.Ð.ØÔ×#Ò# DÑ)Ô)Ð)Ø!(ð 	3ð 	3ÑˆJ˜Ø×&Ò& zÑ2Ô2ˆFØ',¤{ˆDÔ˜VÑ$Ð$Ø*Ô7ˆÔØ /ˆÔØˆŒˆˆr%   c                 óÀ   — | j         dk    rt                               | ¦  «        S | j         dk    r| j        |                      ¦   «         fS t          | j         ¦  «        ‚)NÚfinishedrÃ   )rÈ   rS   rj   rÄ   rh   r³   ri   s    r$   rj   zResumedPack.access_tupleO  sX   € ØŒ;˜*Ò$Ð$Ý×$Ò$ TÑ*Ô*Ð*ØŒ[˜IÒ%Ð%ØÔ(¨$¯.ª.Ñ*:Ô*:Ð:Ð:å  ¤Ñ-Ô-Ð-r%   c                 ó  — | j                              |                      ¦   «         ¦  «         | j        | j        | j        | j        g}| j        �|                     | j        ¦  «         |D ]!}|j	                             |j
        ¦  «         Œ"d S ro   )rÄ   Údeleterh   ra   rb   r>   rc   rd   rÅ   Ú
_transportÚ_name)r#   rÊ   r
   s      r$   ÚabortzResumedPack.abortW  s�   € ØÔ×$Ò$ T§^¢^Ñ%5Ô%5Ñ6Ô6Ð6ØÔ&¨Ô(<¸d¼oØÔ'ð)ˆàŒ>Ð%Ø�NŠN˜4œ>Ñ*Ô*Ð*Øð 	1ð 	1ˆEØÔ×#Ò# E¤KÑ0Ô0Ð0Ð0ð	1ð 	1r%   c                 ó®  — |                       ¦   «          g d¢}| j        �|                     d¦  «         |D ]R}|                      || j        ¦  «        }d|z   }| j                             ||¦  «         |                      |¦  «         ŒSd|                      ¦   «         z   }| j                             |                      ¦   «         |¦  «         d| _	        d S )N)r\   r]   r^   r_   r[   z../indices/ú	../packs/rÍ   )
r�   rd   rÅ   r~   r…   rÄ   Úmover¤   rh   rÈ   )r#   Úindex_typesrŒ   Úold_nameÚnew_names        r$   ÚfinishzResumedPack.finish`  sÛ   € Ø×ÒÑ Ô Ð ØDÐDÐDˆØŒ>Ð%Ø×Ò˜uÑ%Ô%Ð%Ø%ð 	:ð 	:ˆJØ—’ z°4´9Ñ=Ô=ˆHØ$ xÑ/ˆHØÔ!×&Ò& x°Ñ:Ô:Ð:Ø×-Ò-¨jÑ9Ô9Ð9Ð9Ø §¢Ñ!1Ô!1Ñ1ˆØÔ×"Ò" 4§>¢>Ñ#3Ô#3°XÑ>Ô>Ð>Ø ˆŒˆˆr%   c                 ó"   —  |j         d¦  «        S )zéReturn compression parents for this index that are not present.

        This returns any compression parents that are referenced by this index,
        which are not contained *in* this index. They may be present elsewhere.
        r   )Úexternal_references©r#   r
   s     r$   rv   zResumedPack._get_external_refsn  s   € ð )ˆuÔ(¨Ñ+Ô+Ð+r%   ro   )r&   r'   r(   r   rj   rÒ   rÙ   rv   r,   r%   r$   r¿   r¿   2  si   € € € € € ð -1ð ð  ð  ð  ð6.ð .ð .ð1ð 1ð 1ð!ð !ð !ð,ð ,ð ,ð ,ð ,r%   r¿   c                   óT   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ Zdd
„Z	d„ Z
d„ Zd„ Zdd„ZdS )ÚNewPackz5An in memory proxy for a pack which is being created.Ú Nc           	      óF  ‡ — |j         }|j        � |d¬¦  «        }nd}t                               ‰  |d¬¦  «         |d¬¦  «         |dd¬¦  «         |d¬¦  «        |¬¦  «         |‰ _        |j        ‰ _        |j        ‰ _        |j	        ‰ _
        |j        ‰ _        |‰ _        t                               ¦   «         ‰ _        d‰ _        d‰ _        t                               d¦  «        |z   ‰ _        t*                               ¦   «         ‰ _        ‰ j                             ‰ j        ‰ j        ¬	¦  «        ‰ _        d
t2          j        v rXt7          dt*                               ¦   «         ‰ j        j        ‰ j        t*                               ¦   «         ‰ j        z
  ¦  «         g dg‰ _        d‰ j        ‰ j        j        ‰ j        j         fˆ fd„	}|‰ _!        tD           #                    ‰ j!        ¦  «        ‰ _$        ‰ j$         %                    ¦   «          d‰ _&        d‰ _'        dS )aM  Create a NewPack instance.

        :param pack_collection: A PackCollection into which this is being inserted.
        :param upload_suffix: An optional suffix to be given to any temporary
            files created during the pack creation. e.g '.autopack'
        :param file_mode: Unix permissions for newly created file.
        Nr   )Úreference_listsr   r   )rá   Úkey_elementsrÁ   é   ©ÚmodeÚpackz0%s: create_pack: pack stream open: %s%s t+%6.3fsFc                 ó  •— |d                               | ¦  «         |dxx         t          | ¦  «        z  cc<   |d         ‰j        k    s|r<d                     |d         ¦  «        }  || ¦  «          || ¦  «         g dg|d d …<   d S d S )Nr   r   r%   )rÅ   ÚlenÚ_cache_limitÚjoin)ÚbytesÚflushÚ_bufferÚ_writeÚ_updater#   s        €r$   Ú_write_dataz%NewPack.__init__.<locals>._write_dataÄ  sš   ø€ à�AŒJ×Ò˜eÑ$Ô$Ð$Ø�AˆJˆJŒJ�#˜e™*œ*Ñ$ˆJˆJ‰Jà�qŒz˜DÔ-Ò-Ð-°Ð-ØŸš ¨¤Ñ,Ô,�Ø��u‘”�Ø�˜‘”�Ø  !˜W�˜˜˜‘
�
�
ð	 .Ð-r%   Úopen)(Ú_index_builder_classrd   rS   r   r=   rÇ   rž   Ú_upload_transportrÄ   Ú_index_transportrŸ   Ú_pack_transportrg   Ú
_file_modeÚosutilsÚmd5Ú_hashr    ré   Ú
rand_charsÚrandom_nameÚtimeÚ
start_timeÚopen_write_streamÚwrite_streamÚdebugÚdebug_flagsr   ÚctimeÚbaserí   ÚwriteÚupdaterð   ræ   ÚContainerWriterÚ_writerÚbeginrÈ   r…   )r#   rÉ   Úupload_suffixÚ	file_modeÚindex_builder_classrd   rð   s   `      r$   r   zNewPack.__init__z  s+  ø€ ð .ÔBÐØÔ$Ð0Ø+Ð+¸AÐ>Ñ>Ô>ˆIˆIàˆIÝ�Š�dà)Ð)¸!Ð<Ñ<Ô<ð
 *Ð)¸!Ð<Ñ<Ô<ð *Ð)¸!È!ÐLÑLÔLð *Ð)¸!Ð<Ñ<Ô<à )ð 	ñ 	ô 	ð 	ð" !0ˆÔà*Ô7ˆÔà /Ô AˆÔà.Ô?ˆÔà-Ô=ˆÔà#ˆŒå—[’[‘]”]ˆŒ
ð  ˆÔð
 ˆÔå"×-Ò-¨bÑ1Ô1°MÑAˆÔåŸ)š)™+œ+ˆŒà Ô1×CÒCØÔ 4¤?ð Dñ 4ô 4ˆÔà•UÔ&Ð&Ð&ÝÐEÝ—:’:‘<”< Ô!6Ô!;¸TÔ=MÝ—9’9‘;”; ¤Ñ0ñ2ô 2ð 2ð ˜A�wˆŒð &+°D´LØ#Ô0Ô6ÀÄ
Ô@Qð		%ð 		%ð 		%ð 		%ð 		%ð 		%ð 'ˆÔå×+Ò+¨DÔ,<Ñ=Ô=ˆŒØŒ×ÒÑÔÐàˆŒàˆŒ	ˆ	ˆ	r%   c                 ó„   — d| _         | j                             ¦   «          | j                             | j        ¦  «         dS )zCancel creating this pack.ÚabortedN)rÈ   rÿ   ÚcloserÄ   rÏ   rû   ri   s    r$   rÒ   zNewPack.abortØ  s>   € àˆŒØÔ×ÒÑ!Ô!Ð!àÔ×$Ò$ TÔ%5Ñ6Ô6Ð6Ð6Ð6r%   c                 ó¦   — | j         dk    rt                               | ¦  «        S | j         dk    r| j        | j        fS t          | j         ¦  «        ‚)rf   rÍ   rñ   )rÈ   rS   rj   rÄ   rû   r³   ri   s    r$   rj   zNewPack.access_tupleà  sQ   € àŒ;˜*Ò$Ð$Ý×$Ò$ TÑ*Ô*Ð*ØŒ[˜FÒ"Ð"ØÔ(¨$Ô*:Ð:Ð:å  ¤Ñ-Ô-Ð-r%   c                 ó  — t          |                      ¦   «         pl| j                             ¦   «         pS| j                             ¦   «         p:| j                             ¦   «         p!| j        duo| j                             ¦   «         ¦  «        S )z)True if data has been added to this pack.N)Úboolrˆ   rb   r‡   r>   rc   rd   ri   s    r$   Údata_insertedzNewPack.data_insertedé  s“   € å�D×+Ò+Ñ-Ô-ð PØÔ(×2Ò2Ñ4Ô4ðPà”O×-Ò-Ñ/Ô/ðPð Ô(×2Ò2Ñ4Ô4ðPð ”^¨4Ð/ÐN°D´N×4LÒ4LÑ4NÔ4Nñ	Qô Qð 	Qr%   c                 óÎ   — | j         �d S | j                             ¦   «          | j        d         r|                      dd¬¦  «         | j                             ¦   «         | _         d S )Nr   r%   T)rì   )r…   r  Úendrí   rð   rù   Ú	hexdigestri   s    r$   Úfinish_contentzNewPack.finish_contentñ  sc   € ØŒ9Ð ØˆFØŒ×ÒÑÔÐØŒ<˜Œ?ð 	.Ø×Ò˜S¨ÐÑ-Ô-Ð-Ø”J×(Ò(Ñ*Ô*ˆŒ	ˆ	ˆ	r%   Fc           	      ó‚  — |                       ¦   «          |s|                      ¦   «          g d¢| _        |                      d| j        d|¦  «         |                      d| j        d|¦  «         |                      d| j        d|¦  «         |                      d| j        d|¦  «         | j        �7| j         	                    d¦  «         |                      d	| j        d
|¦  «         | j
                             | j        j                             d¦  «        ¬¦  «         | j        dz   }|sd|z   }| j                             | j        |¦  «         d| _        dt(          j        v r[t-          dt.                               ¦   «         | j        j        | j        |t.                               ¦   «         | j        z
  ¦  «         dS dS )a=  Finish the new pack.

        This:
         - finalises the content
         - assigns a name (the md5 of the content, currently)
         - writes out the associated indices
         - renames the pack into place.
         - stores the index size tuple for the pack in the index_sizes
           attribute.
        rÂ   r\   r]   r^   z
file textsr_   zrevision signaturesNr[   zcontent hash bytesúrepository.fdatasync©Úwant_fdatasyncrƒ   rÔ   rÍ   ræ   z1%s: create_pack: pack finished: %s%s->%s t+%6.3fs)r  r�   r    Ú_write_indexra   rb   r>   rc   rd   rÅ   rÿ   r  r=   Úconfig_stackÚgetr…   rÄ   rÕ   rû   rÈ   r   r  r   rü   r  r  rý   )r#   ÚsuspendrØ   s      r$   rÙ   zNewPack.finishù  sé  € ð 	×ÒÑÔÐØð 	%Ø×"Ò"Ñ$Ô$Ð$ð 4Ð3Ð3ˆÔØ×Ò˜* dÔ&9¸:Ø!ñ	#ô 	#ð 	#à×Ò˜+ tÔ';¸[Ø!ñ	#ô 	#ð 	#à×Ò˜& $¤/°<ÀÑIÔIÐIØ×Ò˜+ tÔ';Ø/°ñ	:ô 	:ð 	:àŒ>Ð%ØÔ×#Ò# DÑ)Ô)Ð)Ø×Ò˜e T¤^Ø2°Gñ=ô =ð =àÔ×ÒØÔ0Ô=×AÒAÐBXÑYÔYð 	 ñ 	[ô 	[ð 	[ð ”9˜wÑ&ˆØð 	.Ø" XÑ-ˆHØÔ×"Ò" 4Ô#3°XÑ>Ô>Ð>Ø ˆŒØ•UÔ&Ð&Ð&åÐFÝ—:’:‘<”< Ô!6Ô!;¸TÔ=MØ�TŸYšY™[œ[¨4¬?Ñ:ñ<ô <ð <ð <ð <ð 'Ð&r%   c                 óè   — | j         d         rdd                     | j         d         ¦  «        }| j                             |¦  «         | j                             |¦  «         g dg| j         dd…<   dS dS )zFlush any current data.r   r%   r   N)rí   rê   rÿ   r  rù   r  )r#   rë   s     r$   rì   zNewPack.flush0  su   € àŒ<˜Œ?ð 	&Ø—H’H˜Tœ\¨!œ_Ñ-Ô-ˆEØÔ×#Ò# EÑ*Ô*Ð*ØŒJ×Ò˜eÑ$Ô$Ð$Ø! 1˜gˆDŒL˜˜˜‰OˆOˆOð		&ð 	&r%   c                 ó    —  |j         ¦   «         S ro   )Ú_external_referencesrÜ   s     r$   rv   zNewPack._get_external_refs8  s   € Ø)ˆuÔ)Ñ+Ô+Ð+r%   c                 ó   — || _         d S ro   )ré   )r#   Úsizes     r$   Úset_write_cache_sizezNewPack.set_write_cache_size;  s   € Ø ˆÔÐÐr%   c           	      ó¸  — |                       || j        ¦  «        }|r| j        }n| j        } |j        ¦   «         }|                     ¦   «         }|                     || j        ¬¦  «        }	|	                     |¦  «         |	 	                    | j
        j                             d¦  «        ¬¦  «         t          |¦  «        | j        |                      |¦  «        <   dt           j        v rYt%          dt&                               ¦   «         || j        j        | j        t&                               ¦   «         | j        z
  ¦  «         |                      |¦  «         dS )zßWrite out an index.

        :param index_type: The type of index to write - e.g. 'revision'.
        :param index: The index object to serialise.
        :param label: What label to give the index e.g. 'revision'.
        rä   r  r  ræ   z.%s: create_pack: wrote %s index: %s%s t+%6.3fsN)r~   r…   rÄ   rŸ   rÙ   Úreadrþ   rö   r  r  r=   r  r  rè   r    rŽ   r   r  r   rü   r  r  rû   rý   r¤   )
r#   rŒ   r
   Úlabelr  r~   r	   Úindex_tempfileÚindex_bytesrÿ   s
             r$   r  zNewPack._write_index>  sQ  € ð —_’_ Z°´Ñ;Ô;ˆ
Øð 	-ØÔ-ˆIˆIàÔ,ˆIØ%˜œ™œˆØ$×)Ò)Ñ+Ô+ˆØ ×2Ò2°:Ø8<¼ð 3ñ Iô Iˆà×Ò˜;Ñ'Ô'Ð'Ø×ÒØÔ0Ô=×AÒAÐBXÑYÔYð 	ñ 	[ô 	[ð 	[å:=¸kÑ:JÔ:JˆÔ˜×*Ò*¨:Ñ6Ô6Ñ7Ø•UÔ&Ð&Ð&åÐCÝ—:’:‘<”< ¨Ô(=Ô(BØÔ#¥T§Y¢Y¡[¤[°4´?Ñ%BñDô Dð Dð 	×)Ò)¨*Ñ5Ô5Ð5Ð5Ð5r%   )rß   N©F)r&   r'   r(   r)   r   rÒ   rj   r  r  rÙ   rì   rv   r$  r  r,   r%   r$   rÞ   rÞ   w  sÈ   € € € € € Ø?Ð?ð\ð \ð \ð \ð|7ð 7ð 7ð.ð .ð .ðQð Qð Qð+ð +ð +ð5<ð 5<ð 5<ð 5<ðn&ð &ð &ð,ð ,ð ,ð!ð !ð !ð6ð 6ð 6ð 6ð 6ð 6r%   rÞ   c                   ó2   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ ZdS )	ÚAggregateIndexaà  An aggregated index for the RepositoryPackCollection.

    AggregateIndex is reponsible for managing the PackAccess object,
    Index-To-Pack mapping, and all indices list for a specific type of index
    such as 'revision index'.

    A CombinedIndex provides an index on a single key space built up
    from several on-disk indices.  The AggregateIndex builds on this
    to provide a knit access layer, and allows having up to one writable
    index within the collection.
    Nc                 ó”   — || _         i | _        t          g |¬¦  «        | _        t	          | j        ||¬¦  «        | _        d| _        dS )zçCreate an AggregateIndex.

        :param reload_func: A function to call if we find we are missing an
            index. Should have the form reload_func() => True if the list of
            active pack files has changed.
        ©Úreload_func)r/  Ú
flush_funcN)Ú_reload_funcÚindex_to_packÚCombinedGraphIndexr?   Ú_DirectPackAccessÚdata_accessÚadd_callback)r#   r/  r0  s      r$   r   zAggregateIndex.__init__m  s^   € ð (ˆÔØˆÔÝ0°ÀÐMÑMÔMˆÔÝ,¨TÔ-?Ø9DØ8BðDñ Dô DˆÔð !ˆÔÐÐr%   c                 ó€   — |                      ¦   «         | j        |<   | j                             d||j        ¦  «         dS )a  Add index to the aggregate, which is an index for Pack pack.

        Future searches on the aggregate index will seach this new index
        before all previously inserted indices.

        :param index: An Index for the pack.
        :param pack: A Pack instance.
        r   N)rj   r2  r?   Úinsert_indexr…   ©r#   r
   ræ   s      r$   Ú	add_indexzAggregateIndex.add_index|  s@   € ð %)×$5Ò$5Ñ$7Ô$7ˆÔ˜5Ñ!àÔ×(Ò(¨¨E°4´9Ñ=Ô=Ð=Ð=Ð=r%   c                 óð   — | j         �t          | ›d| j         ›�¦  «        ‚|                      ||¦  «         | j                             |j        ||                     ¦   «         ¦  «         |j        | _         dS )a  Add an index which is able to have data added to it.

        There can be at most one writable index at any time.  Any
        modifications made to the knit are put into this index.

        :param index: An index from the pack parameter.
        :param pack: A Pack instance.
        Nz& already has a writable index through )r6  r³   r:  r5  Ú
set_writerr  rj   Ú	add_nodesr9  s      r$   Úadd_writable_indexz!AggregateIndex.add_writable_indexŠ  s‚   € ð ÔÐ(Ý à���tÔ(Ð(ð*ñ+ô +ð +ð 	�Š�u˜dÑ#Ô#Ð#àÔ×#Ò# D¤L°%¸×9JÒ9JÑ9LÔ9LÑMÔMÐMØ!œOˆÔÐÐr%   c                 óº   — | j                              ddd¦  «         | j                             ¦   «          | j        j        dd…= | j        j        dd…= d| _        dS )z(Reset all the aggregate data to nothing.N©NN)r5  r<  r2  Úclearr?   Ú_indicesÚ_index_namesr6  ri   s    r$   rA  zAggregateIndex.clear�  sd   € àÔ×#Ò# D¨$°Ñ=Ô=Ð=ØÔ× Ò Ñ"Ô"Ð"ØÔÔ(¨¨¨Ð+ØÔÔ,¨Q¨Q¨QÐ/Ø ˆÔÐÐr%   c                 ó  — | j         |= | j        j                             |¦  «        }| j        j        |= | j        j        |= | j        �?t          |dd¦  «        | j        k    r'd| _        | j                             ddd¦  «         dS dS dS )zwRemove index from the indices used to answer queries.

        :param index: An index from the pack parameter.
        Nr=  r@  )	r2  r?   rB  r
   rC  r6  Úgetattrr5  r<  )r#   r
   Úposs      r$   Úremove_indexzAggregateIndex.remove_index¥  sž   € ð
 Ô˜uÐ%ØÔ!Ô*×0Ò0°Ñ7Ô7ˆØÔÔ(¨Ð-ØÔÔ,¨SÐ1ØÔÐ)Ý˜˜{¨DÑ1Ô1°TÔ5FÒFÐFØ $ˆDÔØÔ×'Ò'¨¨d°LÑAÔAÐAÐAÐAð *Ð)ØFÐFr%   r@  )	r&   r'   r(   r)   r   r:  r>  rA  rG  r,   r%   r$   r,  r,  ^  ss   € € € € € ð
ð 
ð!ð !ð !ð !ð>ð >ð >ð,ð ,ð ,ð&!ð !ð !ðBð Bð Bð Bð Br%   r,  c                   óP   — e Zd ZdZ	 	 dd„Zdd„Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ ZdS )ÚPackerzCreate a pack from packs.Nc                 óv   — || _         || _        || _        d| _        || _        || _        d| _        d| _        dS )a  Create a Packer.

        :param pack_collection: A RepositoryPackCollection object where the
            new pack is being written to.
        :param packs: The packs to combine.
        :param suffix: The suffix to use on the temporary files for the pack.
        :param revision_ids: Revision ids to limit the pack to.
        :param reload_func: A function to call if a pack file/index goes
            missing. The side effect of calling this function should be to
            update self.packs. See also AggregateIndex
        N)ÚpacksÚsuffixrO   Únew_packr=   r1  Ú_revision_keysÚ_text_filter)r#   rÉ   rK  rL  rO   r/  s         r$   r   zPacker.__init__·  sK   € ð ˆŒ
ØˆŒØ(ˆÔàˆŒØ /ˆÔØ'ˆÔð #ˆÔð !ˆÔÐÐr%   c                 ó  — | j         j        �"t          j        d| j        j        ›d�¦  «        ‚| j        �Vt          | j        ¦  «        dk    rdS t          | j        ¦  «        | _        t          d„ | j        D ¦   «         ¦  «        | _	        |€$t          j                             ¦   «         | _        n|| _        	 |                      ¦   «         |€| j                             ¦   «          S S # |€| j                             ¦   «          w w xY w)a|  Create a new pack by reading data from other packs.

        This does little more than a bulk copy of data. One key difference
        is that data with the same item key across multiple packs is elided
        from the output. The new pack is written into the current pack store
        along with its indices, and the name added to the pack names. The
        source packs are not altered and are not required to be in the current
        pack collection.

        :param pb: An optional progress bar to use. A nested bar is created if
            this is None.
        :return: A Pack object, or None if nothing was copied.
        Nzcall to z,.pack() while another pack is being written.r   c              3   ó   K  — | ]}|fV — Œd S ro   r,   )rF   Úrevids     r$   rt   zPacker.pack.<locals>.<genexpr>î  s<   è è € ð /Bð /B¸E°¨xð /Bð /Bð /Bð /Bð /Bð /Br%   )r=   Ú	_new_packr   r   r»   r&   rO   rè   Ú	frozensetÚrevision_keysÚuiÚ
ui_factoryÚnested_progress_barÚpbÚ_create_pack_from_packsrÍ   )r#   rY  s     r$   ræ   zPacker.packÒ  s)  € ð$ Ô Ô*Ð6Ý”/�/à%)¤^Ô%<Ð%<Ð%<ð#?ñ @ô @ð @ð ÔÐ(Ý�4Ô$Ñ%Ô%¨Ò*Ð*à�tå$-¨dÔ.?Ñ$@Ô$@�Ô!Ý%.ð /Bð /BØ/3Ô/@ð/Bñ /Bô /Bñ &Bô &B�Ô"àˆ:Ý”m×7Ò7Ñ9Ô9ˆDŒGˆGàˆDŒGð	#Ø×/Ò/Ñ1Ô1àˆzØ”× Ò Ñ"Ô"Ð"Ð"ð øˆrˆzØ”× Ò Ñ"Ô"Ð"Ð"ð øøøs   Â:C* Ã*Dc                 ón  — | j                              | j         | j        | j         j        j                             ¦   «         ¬¦  «        }|j                             d¬¦  «         |j                             d¬¦  «         |j	                             d¬¦  «         |j
                             d¬¦  «         |S )z)Open a pack for the pack we are creating.©r	  r
  F©Úcombine_backing_indices)r=   Úpack_factoryrL  ÚrepoÚ
controldirÚ_get_file_modera   Úset_optimizerb   r>   rc   ©r#   rM  s     r$   Ú	open_packzPacker.open_packú  s²   € àÔ(×5Ò5°dÔ6KØDHÄKØ@DÔ@UÔ@ZÔ@e×@tÒ@tÑ@vÔ@vð 6ñ xô xˆð
 	Ô×,Ò,ÀUÐ,ÑKÔKÐKØÔ ×-Ò-ÀeÐ-ÑLÔLÐLØÔ×(Ò(ÀÐ(ÑGÔGÐGØÔ ×-Ò-ÀeÐ-ÑLÔLÐLØˆr%   c                 ó*   — t          | j        ¦  «        ‚)z#Copy revision data to the new pack.)ÚNotImplementedErrorÚ_copy_revision_textsri   s    r$   rh  zPacker._copy_revision_texts  s   € å! $Ô";Ñ<Ô<Ð<r%   c                 ó*   — t          | j        ¦  «        ‚)z­Copy the inventory texts to the new pack.

        self._revision_keys is used to determine what inventories to copy.

        Sets self._text_filter appropriately.
        )rg  Ú_copy_inventory_textsri   s    r$   rj  zPacker._copy_inventory_texts  s   € õ " $Ô"<Ñ=Ô=Ð=r%   c                 ó*   — t          | j        ¦  «        ‚ro   )rg  Ú_copy_text_textsri   s    r$   rl  zPacker._copy_text_texts  s   € Ý! $Ô"7Ñ8Ô8Ð8r%   c                 ó*   — t          | j        ¦  «        ‚ro   )rg  rZ  ri   s    r$   rZ  zPacker._create_pack_from_packs  s   € Ý! $Ô">Ñ?Ô?Ð?r%   c           	      ó.  — dt           j        v r†t          dt                               ¦   «         | j        j        j        | j        j	        | j        j
                             ¦   «         t                               ¦   «         | j        j        z
  ¦  «         d S d S )Nræ   z:%s: create_pack: file texts copied: %s%s %d items t+%6.3fs)r   r  r   rü   r  r=   ró   r  rM  rû   r>   r‡   rý   ri   s    r$   Ú_log_copied_textszPacker._log_copied_texts  s~   € Ø•UÔ&Ð&Ð&ÝÐOÝ—:’:‘<”< Ô!6Ô!HÔ!MØ”=Ô,Ø”=Ô+×5Ò5Ñ7Ô7Ý—9’9‘;”; ¤Ô!9Ñ9ñ	;ô ;ð ;ð ;ð ;ð 'Ð&r%   c                 ó*   — |                      ¦   «         S )z¡Return True if new_pack should be used.

        :param new_pack: The pack that has just been created.
        :return: True if the pack should be used.
        )r  rd  s     r$   Ú	_use_packzPacker._use_pack"  s   € ð ×%Ò%Ñ'Ô'Ð'r%   r@  ro   )r&   r'   r(   r)   r   ræ   re  rh  rj  rl  rZ  ro  rq  r,   r%   r$   rI  rI  ´  sµ   € € € € € Ø#Ð#àDHØ!ð!ð !ð !ð !ð6&#ð &#ð &#ð &#ðPð ð ð=ð =ð =ð>ð >ð >ð9ð 9ð 9ð@ð @ð @ð;ð ;ð ;ð(ð (ð (ð (ð (r%   rI  c                   ó|  — e Zd ZU dZee         ed<   ee         ed<   ee         ed<   ee         ed<   d„ Z	d„ Z
d„ Zd	„ Zd
„ Zd„ Z	 d3d„Zd„ Zd„ Zd„ Zd4d„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd5d„Zd„ Zd„ Zd„ Zd„ Z d „ Z!d!„ Z"d6d"„Z#d#„ Z$d$„ Z%d%„ Z&d&„ Z'd7d'„Z(d(„ Z)d)„ Z*d*„ Z+d3d+„Z,d,„ Z-d-„ Z.d.„ Z/d/„ Z0d0„ Z1d1„ Z2d2„ Z3dS )8ÚRepositoryPackCollectionzbManagement of packs within a repository.

    :ivar _names: map of {pack_name: (index_size,)}
    r_  Úresumed_pack_factoryÚnormal_packer_classÚoptimising_packer_classc	                 óD  — || _         || _        || _        || _        || _        || _        || _        ddddddœ| _        g | _        d| _	        i | _
        d| _        d| _        | j        }	t          | j        |	¦  «        | _        t          | j        |	¦  «        | _        t          | j        |	¦  «        | _        t          | j        |	¦  «        | _        | j        | j        | j        | j        g}
|r5t          | j        |	¦  «        | _        |
                     | j        ¦  «         nd| _        d„ |
D ¦   «         }|D ]8}|                     t/          |¦  «                             |g¦  «        ¦  «         Œ9g | _        t4                               | j        j        ¦  «        | _        dS )	ay  Create a new RepositoryPackCollection.

        :param transport: Addresses the repository base directory
            (typically .bzr/repository/).
        :param index_transport: Addresses the directory containing indices.
        :param upload_transport: Addresses the directory into which packs are written
            while they're being created.
        :param pack_transport: Addresses the directory of existing complete packs.
        :param index_builder_class: The index builder class to use.
        :param index_class: The index class to use.
        :param use_chk_index: Whether to setup and manage a CHK index.
        r   r   r   rZ   rU   )rV   rW   rX   rY   rT   Nc                 ó   — g | ]	}|j         ‘Œ
S r,   )r?   )rF   Úagg_idxs     r$   rH   z5RepositoryPackCollection.__init__.<locals>.<listcomp>g  s   € ÐJÐJÐJ°7˜Ô.ÐJÐJÐJr%   )r`  r	   rô   ró   rõ   rò   rÇ   Ú_suffix_offsetsrK  Ú_namesÚ_packs_by_nameÚ_packs_at_loadrS  Ú_flush_new_packr,  Úreload_pack_namesra   rb   r>   rc   rd   rÅ   Úset_sibling_indicesÚsetrw   Ú_resumed_packsrC   ÚLocationStackr  r  )r#   r`  r	   rŸ   rÄ   rg   r  rž   Úuse_chk_indexrì   Úall_indicesÚall_combinedÚcombined_idxs                r$   r   z!RepositoryPackCollection.__init__6  s·  € ð  ˆŒ	Ø"ˆŒØ /ˆÔØ!1ˆÔØ-ˆÔØ$7ˆÔ!Ø'ˆÔØ()°1¸aÈØ()ð +ð  +ˆÔàˆŒ
àˆŒØ ˆÔà"ˆÔàˆŒàÔ$ˆÝ,¨TÔ-CÀUÑKÔKˆÔÝ-¨dÔ.DÀeÑLÔLˆÔÝ(¨Ô)?ÀÑGÔGˆŒÝ-¨dÔ.DÀeÑLÔLˆÔØÔ*¨DÔ,@Ø”¨Ô(<ð>ˆàð 	"Ý+¨DÔ,BÀEÑJÔJˆDŒNØ×Ò˜tœ~Ñ.Ô.Ð.Ð.ð "ˆDŒNð KÐJ¸kÐJÑJÔJˆØ(ð 	>ð 	>ˆLØ×,Ò,Ý�LÑ!Ô!×,Ò,¨l¨^Ñ<Ô<ñ>ô >ð >ð >ð !ˆÔÝ"×0Ò0°´Ô1DÑEÔEˆÔÐÐr%   c                 óL   — d                      | j        j        | j        ¦  «        S )Nz{}({!r}))rº   r»   r&   r`  ri   s    r$   r¼   z!RepositoryPackCollection.__repr__o  s   € Ø× Ò  ¤Ô!8¸$¼)ÑDÔDÐDr%   c                 ó  — |j         | j        v r't          d                     |j         ¦  «        ¦  «        ‚| j                             |¦  «         || j        |j         <   | j                             |j        |¦  «         | j                             |j        |¦  «         | j	                             |j	        |¦  «         | j
                             |j
        |¦  «         | j        �"| j                             |j        |¦  «         dS dS )zpMake a Pack object available to the repository to satisfy queries.

        :param pack: A Pack object.
        z!pack {} already in _packs_by_nameN)r…   r|  r³   rº   rK  rÅ   ra   r:  rb   r>   rc   rd   ©r#   ræ   s     r$   Úadd_pack_to_memoryz+RepositoryPackCollection.add_pack_to_memoryr  sÿ   € ð
 Œ9˜Ô+Ð+Ð+Ý Ø3×:Ò:¸4¼9ÑEÔEñGô Gð GàŒ
×Ò˜$ÑÔÐØ)-ˆÔ˜DœIÑ&ØÔ×%Ò% dÔ&9¸4Ñ@Ô@Ð@ØÔ×&Ò& tÔ';¸TÑBÔBÐBØŒ×!Ò! $¤/°4Ñ8Ô8Ð8ØÔ×&Ò& tÔ';¸TÑBÔBÐBØŒ>Ð%ØŒN×$Ò$ T¤^°TÑ:Ô:Ð:Ð:Ð:ð &Ð%r%   c                 óˆ   — g }|                       ¦   «         D ]*}|                     |                      |¦  «        ¦  «         Œ+|S )z×Return a list of all the Pack objects this repository has.

        Note that an in-progress pack being created is not returned.

        :return: A list of Pack objects for all the packs in the repository.
        )ÚnamesrÅ   Úget_pack_by_name)r#   Úresultr…   s      r$   Ú	all_packsz"RepositoryPackCollection.all_packsƒ  sH   € ð ˆØ—J’J‘L”Lð 	7ð 	7ˆDØ�MŠM˜$×/Ò/°Ñ5Ô5Ñ6Ô6Ð6Ð6Øˆr%   c                 óP   — 	 	 |                       ¦   «         S # t          $ r Y nw xY wŒ&)aÏ  Pack the pack collection incrementally.

        This will not attempt global reorganisation or recompression,
        rather it will just ensure that the total number of packs does
        not grow without bound. It uses the _max_pack_count method to
        determine if autopacking is needed, and the pack_distribution
        method to determine the number of revisions in each pack.

        If autopacking takes place then the packs name collection will have
        been flushed to disk - packing requires updating the name collection
        in synchronisation with certain steps. Otherwise the names collection
        is not flushed.

        :return: Something evaluating true if packing took place.
        )Ú_do_autopackr.   ri   s    r$   Úautopackz!RepositoryPackCollection.autopack�  sE   € ð 	ðØ×(Ò(Ñ*Ô*Ð*øÝ ð ð ð ð �ðøøøð	s   ƒ —
$£$c           	      óÐ  — | j         j                             ¦   «         }t          | j        ¦  «        }|                      |¦  «        |k    rd S |                      |¦  «        }g }|                      ¦   «         D ]4}|                     ¦   «         }|dk    rŒ| 	                    ||f¦  «         Œ5|  
                    ||¦  «        }t          |¦  «        }t          d„ |D ¦   «         ¦  «        }	t          d„ |D ¦   «         ¦  «        }
t          dt          | ¦  «        |||	||
¦  «         |                      || j        | j        ¬¦  «        }t          dt          | ¦  «        ¦  «         |S )Nr   c                 ó8   — g | ]}t          |d          ¦  «        ‘ŒS rJ   )rè   ©rF   Úpos     r$   rH   z9RepositoryPackCollection._do_autopack.<locals>.<listcomp>Â  s"   € ÐBÐBÐB¨B�S  A¤™ZœZÐBÐBÐBr%   c                 ó   — g | ]
}|d          ‘ŒS ©r   r,   r–  s     r$   rH   z9RepositoryPackCollection._do_autopack.<locals>.<listcomp>Ã  s   € Ð AÐ AÐ A¨2  A¤Ð AÐ AÐ Ar%   z}Auto-packing repository %s, which has %d pack files, containing %d revisions. Packing %d files into %d affecting %d revisions©Úpacker_classr/  z$Auto-packing repository %s completed)ra   r?   r‡   rè   r{  Ú_max_pack_countÚpack_distributionr�  rˆ   rÅ   Úplan_autopack_combinationsÚsumr   ÚstrÚ_execute_pack_operationsru  Ú_restart_autopack)r#   Útotal_revisionsÚtotal_packsr�  Úexisting_packsræ   Úrevision_countÚpack_operationsÚnum_new_packsÚnum_old_packsÚnum_revs_affectedr�  s               r$   r’  z%RepositoryPackCollection._do_autopack§  s‘  € àÔ-Ô<×FÒFÑHÔHˆÝ˜$œ+Ñ&Ô&ˆØ×Ò Ñ0Ô0°KÒ?Ð?Ø�4à ×2Ò2°?ÑCÔCÐØˆØ—N’NÑ$Ô$ð 	:ð 	:ˆDØ!×4Ò4Ñ6Ô6ˆNØ Ò"Ð"ð Ø×!Ò! >°4Ð"8Ñ9Ô9Ð9Ð9Ø×9Ò9ØÐ-ñ/ô /ˆå˜OÑ,Ô,ˆÝÐBÐB°/ÐBÑBÔBÑCÔCˆÝÐ AÐ A°Ð AÑ AÔ AÑBÔBÐÝð å Øñô Ø% ¸ØÐ/ñ		1ô 	1ð 	1ð
 ×.Ò.¨ÈTÔMeØ;?Ô;Qð /ñ Sô SˆåÐ5µs¸4±y´yÑAÔAÐAØˆr%   Nc                 ó�  — |D ]Œ\  }}t          |¦  «        dk    rŒ || |d|¬¦  «        }	 |                     ¦   «         }n/# t          $ r" |j        �|j                             ¦   «          ‚ w xY w|€ dS |D ]}|                      |¦  «         ŒŒ�g }	|D ]\  }
}|	                     |¦  «         Œ|                      d|	¬¦  «        }|S )zÙExecute a series of pack operations.

        :param pack_operations: A list of [revision_count, packs_to_combine].
        :param packer_class: The class of packer to use
        :return: The new pack names.
        r   z	.autopackr.  NT)Úclear_obsolete_packsÚobsolete_packs)rè   ræ   r   rM  rÒ   Ú_remove_pack_from_memoryÚextendÚ_save_pack_names)r#   r§  r›  r/  r¦  rK  Úpackerr�  ræ   Úto_be_obsoletedÚ_s              r$   r¡  z1RepositoryPackCollection._execute_pack_operationsÎ  s)  € ð &5ð 	4ð 	4Ñ!ˆN˜Eå�5‰zŒz˜QŠˆØØ!�\ $¨¨{Ø.9ð;ñ ;ô ;ˆFð	ØŸš™œ��øÝ$ð ð ð ð
 ”?Ð.Ø”O×)Ò)Ñ+Ô+Ð+Øðøøøð ˆ~Ø��Øð 4ð 4�Ø×-Ò-¨dÑ3Ô3Ð3Ð3ð4ð ˆØ'ð 	*ð 	*‰HˆAˆuØ×"Ò" 5Ñ)Ô)Ð)Ð)Ø×&Ò&¸DØ6Eð 'ñ Gô Gˆàˆs   ¬AÁ,A-c                 óJ   — | j         �| j                              ¦   «          d S d S ro   )rS  rì   ri   s    r$   r~  z(RepositoryPackCollection._flush_new_packó  s,   € ØŒ>Ð%ØŒN× Ò Ñ"Ô"Ð"Ð"Ð"ð &Ð%r%   c                 óB   — | j         j                             ¦   «          dS )z˜Acquire the mutex around the pack-names index.

        This cannot be used in the middle of a read-only transaction on the
        repository.
        N)r`  Úcontrol_filesÚ
lock_writeri   s    r$   Ú
lock_namesz#RepositoryPackCollection.lock_names÷  s!   € ð 	Œ	Ô×*Ò*Ñ,Ô,Ð,Ð,Ð,r%   c                 óV   — | j         j        j        pt          | j        ¦  «        dk     S )z!Is the collection already packed?r   )r`  Ú_formatÚpack_compressesrè   r{  ri   s    r$   Ú_already_packedz(RepositoryPackCollection._already_packedÿ  s'   € à”IÔ%Ô5ÐO½#¸d¼kÑ:JÔ:JÈQÒ:NÐPÐPr%   Fc                 ó€  — |                       ¦   «          t          | j        ¦  «        }|                      ¦   «         rdS | j        j                             ¦   «         }t          dt          | ¦  «        |||¦  «         	 	 |  	                    |¦  «         n# t          $ r Y Œ$w xY w	 |r|                      ¦   «          dS dS )z!Pack the pack collection totally.NzUPacking repository %s, which has %d pack files, containing %d revisions with hint %r.)Úensure_loadedrè   r{  r¼  ra   r?   r‡   r   r   Ú_try_pack_operationsÚRetryPackOperationsÚ_clear_obsolete_packs)r#   ÚhintÚclean_obsolete_packsr¤  r£  s        r$   ræ   zRepositoryPackCollection.pack  sê   € à×ÒÑÔÐÝ˜$œ+Ñ&Ô&ˆØ×ÒÑ!Ô!ð 	ØˆFØÔ-Ô<×FÒFÑHÔHˆõ 	ð 7Ý8;¸D¹	¼	À;Ø ñ	&ô 	&ð 	&ð	ðØ×)Ò)¨$Ñ/Ô/Ð/Ð/øÝ&ð ð ð Ø�ðøøøààð 	)Ø×&Ò&Ñ(Ô(Ð(Ð(Ð(ð	)ð 	)s   Á?B Â
B"Â!B"c                 ó*  — dg gg}|                       ¦   «         D ]V}|�	|j        |v rI|d         dxx         |                     ¦   «         z  cc<   |d         d                              |¦  «         ŒW|                      || j        | j        ¬¦  «         dS )z\Calculate the pack operations based on the hint (if any), and
        execute them.
        r   Néÿÿÿÿr   rš  )r�  r…   rˆ   rÅ   r¡  rv  Ú_restart_pack_operations)r#   rÂ  r§  ræ   s       r$   r¿  z-RepositoryPackCollection._try_pack_operations  sÁ   € ð
 ˜r˜7˜)ˆØ—N’NÑ$Ô$ð 	4ð 	4ˆDØˆ|˜tœy¨DÐ0Ð0ð   Ô# AÐ&Ð&Ô&¨$×*AÒ*AÑ*CÔ*CÑCÐ&Ð&Ñ&Ø Ô# AÔ&×-Ò-¨dÑ3Ô3Ð3øØ×%Ò% oØ37Ô3OØ26Ô2Oð 	&ñ 	Qô 	Qð 	Qð 	Qð 	Qr%   c                 ó¼  — t          |¦  «        t          |¦  «        k    rg S |                     d¬¦  «         dg gg}t          |¦  «        rÄ|                     d¦  «        \  }}||d         k    r(|dk    r!||d         z  }|dk    r|d= n| |d<   |dk    °!ni|d         dxx         |z  cc<   |d         d                              |¦  «         |d         d         |d         k    r|d= |                     dg g¦  «         t          |¦  «        °Äd}g }|D ]\  }}	||z  }|                     |	¦  «         Œ t          |¦  «        dk    rt          d¦  «        ‚||ggS )zëPlan a pack operation.

        :param existing_packs: The packs to pack. (A list of (revcount, Pack)
            tuples).
        :param pack_distribution: A list with the number of revisions desired
            in each pack.
        T)Úreverser   rÅ  r   zEWe somehow generated an autopack with a single pack file being moved.)rè   ÚsortÚpoprÅ   r¯  r³   )
r#   r¥  r�  r§  Únext_pack_rev_countÚ	next_packÚfinal_rev_countÚfinal_pack_listÚnum_revsÚ
pack_filess
             r$   rž  z3RepositoryPackCollection.plan_autopack_combinations)  sä  € õ ˆ~ÑÔ¥#Ð&7Ñ"8Ô"8Ò8Ð8ØˆIØ×Ò DÐÑ)Ô)Ð)Ø˜r˜7˜)ˆå�.Ñ!Ô!ð 	4ð
 .<×-?Ò-?ÀÑ-BÔ-BÑ*Ð Ø"Ð&7¸Ô&:Ò:Ð:ð *¨AÒ-Ð-Ø'Ð+<¸QÔ+?Ñ?Ð'Ø*¨aÒ/Ð/à-¨aÐ0Ð0ð 1DÐ/CÐ)¨!Ñ,ð *¨AÒ-Ð-øð   Ô# AÐ&Ð&Ô&Ð*=Ñ=Ð&Ð&Ñ&à Ô# AÔ&×-Ò-¨iÑ8Ô8Ð8Ø" 2Ô& qÔ)Ð->¸qÔ-AÒAÐAà)¨!Ð,Ø#×*Ò*¨A¨r¨7Ñ3Ô3Ð3õ3 �.Ñ!Ô!ð 	4ð8 ˆØˆØ$3ð 	/ð 	/Ñ ˆH�jØ˜xÑ'ˆOØ×"Ò" :Ñ.Ô.Ð.Ð.ÝˆÑÔ 1Ò$Ð$Ý ð "Bñ Cô Cð Cð ! /Ð2Ð3Ð3r%   c                 ó¼  — | j                              ¦   «         st          j        | j         ¦  «        ‚| j        €Œi | _        t          ¦   «         | _        |                      ¦   «         D ]Z\  }}}|d                              d¦  «        }|  	                    |¦  «        | j        |<   | j         
                    ||f¦  «         Œ[d}nd}|                      ¦   «          |S )ztEnsure we have read names from disk.

        :return: True if the disk names had not been previously read.
        Nr   ÚasciiTF)r`  Ú	is_lockedr   ÚObjectNotLockedr{  r�  r}  Ú_iter_disk_pack_indexÚdecodeÚ_parse_index_sizesÚaddr�  )r#   r
   rL   Úvaluer…   r�  s         r$   r¾  z&RepositoryPackCollection.ensure_loaded]  sØ   € ð Œy×"Ò"Ñ$Ô$ð 	4ÝÔ(¨¬Ñ3Ô3Ð3ØŒ;ÐØˆDŒKÝ"%¡%¤%ˆDÔØ%)×%?Ò%?Ñ%AÔ%Að 7ð 7Ñ!��s˜EØ˜1”v—}’} WÑ-Ô-�Ø$(×$;Ò$;¸EÑ$BÔ$B�”˜DÑ!ØÔ#×'Ò'¨¨u¨Ñ6Ô6Ð6Ð6ØˆFˆFàˆFà�ŠÑÔÐØˆr%   c                 óZ   — t          d„ |                     d¦  «        D ¦   «         ¦  «        S )zParse a string of index sizes.c              3   ó4   K  — | ]}t          |¦  «        V — Œd S ro   )Úint)rF   Údigitss     r$   rt   z>RepositoryPackCollection._parse_index_sizes.<locals>.<genexpr>v  s(   è è € ÐAÐA V•S˜‘[”[ÐAÐAÐAÐAÐAÐAr%   ó    )ÚtupleÚsplit)r#   rÙ  s     r$   r×  z+RepositoryPackCollection._parse_index_sizest  s+   € åÐAÐA¨u¯{ª{¸4Ñ/@Ô/@ÐAÑAÔAÑAÔAÐAr%   c           
      ó”  — 	 | j         |         S # t          $ r® |                      |d¦  «        }|                      |d¦  «        }|                      |d¦  «        }|                      |d¦  «        }| j        �|                      |dd¬¦  «        }nd}t	          | j        ||||||¦  «        }|                      |¦  «         |cY S w xY w)	z~Get a Pack object by name.

        :param name: The name of the pack - e.g. '123456'
        :return: A Pack object.
        rV   rW   rX   rY   NrT   T)Úis_chk)r|  ÚKeyErrorÚ_make_indexrd   r±   rõ   r‹  )r#   r…   Ú	rev_indexÚ	inv_indexÚ	txt_indexÚ	sig_indexrd   r�  s           r$   rŽ  z)RepositoryPackCollection.get_pack_by_namex  sí   € ð	ØÔ& tÔ,Ð,øÝð 	ð 	ð 	Ø×(Ò(¨¨vÑ6Ô6ˆIØ×(Ò(¨¨vÑ6Ô6ˆIØ×(Ò(¨¨vÑ6Ô6ˆIØ×(Ò(¨¨vÑ6Ô6ˆIØŒ~Ð)Ø ×,Ò,¨T°6À$Ð,ÑGÔG�	�	à �	Ý! $Ô"6¸¸iØ"+¨Y¸	À9ñNô NˆFà×#Ò# FÑ+Ô+Ð+ØˆMˆMˆMð	øøøs   ‚ �B5CÃCc                 ó¬  — t          j        d|¦  «        st          j        | j        |gd¦  «        ‚	 |                      |dd¬¦  «        }|                      |dd¬¦  «        }|                      |dd¬¦  «        }|                      |dd¬¦  «        }| j        �|                      |d
dd¬¦  «        }nd	}|                      |||||| j        | j	        | j
        | |¬¦
  «
        }n@# t          j        $ r.}t          j        | j        |gt          |¦  «        ¦  «        ‚d	}~ww xY w|                      |¦  «         | j                             |¦  «         |S )zˆGet a suspended Pack object by name.

        :param name: The name of the pack - e.g. '123456'
        :return: A Pack object.
        z[a-f0-9]{32}zMalformed write group tokenrV   T)ÚresumerW   rX   rY   NrT   )rê  râ  rÁ   )ÚreÚmatchr   ÚUnresumableWriteGroupr`  rä  rd   rt  ró   rõ   rô   Ú_mod_transportÚ
NoSuchFiler   r‹  r‚  rÅ   )	r#   r…   rå  ræ  rç  rè  rd   r�  Úes	            r$   Ú_resume_packz%RepositoryPackCollection._resume_packŽ  s—  € õ Œx˜¨Ñ-Ô-ð 	Bõ Ô.Ø”	˜D˜6Ð#@ñBô Bð Bð	JØ×(Ò(¨¨v¸dÐ(ÑCÔCˆIØ×(Ò(¨¨v¸dÐ(ÑCÔCˆIØ×(Ò(¨¨v¸dÐ(ÑCÔCˆIØ×(Ò(¨¨v¸dÐ(ÑCÔCˆIØŒ~Ð)Ø ×,Ò,¨T°6À$Ø48ð -ñ :ô :�	�	ð !�	Ø×.Ò.¨t°YÀ	Ø/8¸)ÀTÔE[Ø/3Ô/CÀTÔEZÐ\`Ø9Bð /ñ Dô DˆFˆFøõ Ô(ð 	Jð 	Jð 	JÝÔ.¨t¬y¸4¸&Å#ÀaÁ&Ä&ÑIÔIÐIøøøøð	Jøøøà×Ò Ñ'Ô'Ð'ØÔ×"Ò" 6Ñ*Ô*Ð*Øˆs   ³B1C% Ã%D"Ã4)DÄD"c                 ó  — |                       ¦   «          |j        | j        v r-t          j        d                     |j        | ¦  «        ¦  «        ‚t          |j        ¦  «        | j        |j        <   |                      |¦  «         dS )z£Allocate name in the list of packs.

        :param a_new_pack: A NewPack instance to be added to the collection of
            packs for this repository.
        zPack {!r} already exists in {}N)	r¾  r…   r{  r   r   rº   rß  r    r‹  )r#   Ú
a_new_packs     r$   Úallocatez!RepositoryPackCollection.allocate­  s„   € ð 	×ÒÑÔÐØŒ?˜dœkÐ)Ð)Ý”/Ø0×7Ò7¸
¼ÈÑNÔNñPô Pð På',¨ZÔ-CÑ'DÔ'DˆŒ�J”OÑ$Ø×Ò 
Ñ+Ô+Ð+Ð+Ð+r%   c                 ó^   — |                       | j        dd¦  «                             ¦   «         S )zûIterate over the contents of the pack-names index.

        This is used when loading the list from disk, and before writing to
        detect updates from others during our write operation.
        :return: An iterator of the index contents.
        ú
pack-namesN)rÇ   r	   Úiter_all_entriesri   s    r$   rÕ  z.RepositoryPackCollection._iter_disk_pack_indexº  s0   € ð × Ò  ¤°¸tñ #ô #ß#3Ò#3Ñ#5Ô#5ð	6r%   c                 ó$  — | j         |         }||z   }|r"| j        }|                     |¦  «        j        }n| j        }| j        |         |         }|                      ||||¬¦  «        }	|r$| j        t          j        u rt          j	        |	_
        |	S )Nr›   )rz  ró   ÚstatÚst_sizerô   r{  rÇ   r   ÚBTreeGraphIndexr¡   r¢   )
r#   r…   rL  rê  râ  Úsize_offsetr~   r	   Ú
index_sizer
   s
             r$   rä  z$RepositoryPackCollection._make_indexÄ  s¢   € ØÔ*¨6Ô2ˆØ˜F‘]ˆ
Øð 	8ØÔ.ˆIØ"Ÿš¨
Ñ3Ô3Ô;ˆJˆJàÔ-ˆIØœ TÔ*¨;Ô7ˆJØ×!Ò! )¨Z¸Ø28ð "ñ :ô :ˆàð 	=�dÔ'­;Ô+FÐFÐFÝ"-Ô"<ˆEÔØˆr%   c                 ó^   — |sdS t          |¦  «        }d}|D ]}|t          |¦  «        z  }Œ|S )z¥Return the maximum number of packs to use for total revisions.

        :param total_revisions: The total number of revisions in the
            repository.
        r   r   )r   rÜ  )r#   r£  rÝ  r�  Údigits        r$   rœ  z(RepositoryPackCollection._max_pack_countÓ  sI   € ð ð 	Ø�1Ý�_Ñ%Ô%ˆØˆØð 	!ð 	!ˆEØ•c˜%‘j”jÑ ˆFˆFØˆr%   c                 óN   — t          | j                             ¦   «         ¦  «        S )z)Provide an order to the underlying names.)ry   r{  rP   ri   s    r$   r�  zRepositoryPackCollection.namesá  s   € å�d”k×&Ò&Ñ(Ô(Ñ)Ô)Ð)r%   c                 ó@  — |D �]™}	 	 |j                              |                     ¦   «         d|                     ¦   «         z   ¦  «         nˆ# t          j        $ rv 	 |j                              d¦  «         n# t          j        $ r Y nw xY w|j                              |                     ¦   «         d|                     ¦   «         z   ¦  «         Y nw xY wn:# t          j        t          j	        f$ r}t          d|›�¦  «         Y d}~nd}~ww xY wg d¢}| j        �|                     d¦  «         |D ]k}	 | j                             |j        |z   d|j        z   |z   ¦  «         Œ2# t          j        t          j	        f$ r}t          d|›�¦  «         Y d}~Œdd}~ww xY w�Œ›dS )a×  Move a number of packs which have been obsoleted out of the way.

        Each pack and its associated indices are moved out of the way.

        Note: for correctness this function should only be called after a new
        pack names index has been written without these pack names, and with
        the names of packs that contain the data previously available via these
        packs.

        :param packs: The packs to obsolete.
        :param return: None.
        z../obsolete_packs/z,couldn't rename obsolete pack, skipping it:
N)rW   rY   rX   rV   rT   z-couldn't rename obsolete index, skipping it:
)rg   rÕ   rh   rî  rï  ÚmkdirÚ
FileExistsr   Ú	PathErrorÚTransportErrorr   rd   rÅ   rô   r…   )r#   rK  ræ   rð  ÚsuffixesrL  s         r$   Ú_obsolete_packsz(RepositoryPackCollection._obsolete_packså  sY  € ð ð 	#ñ 	#ˆDððVØÔ'×,Ò,¨T¯^ª^Ñ-=Ô-=Ø-AÀDÇNÂNÑDTÔDTÑ-TñVô Vð Vð Vøå%Ô0ð Vð Vð VðØÔ+×1Ò1Ð2FÑGÔGÐGÐGøÝ)Ô4ð ð ð Ø˜ðøøøàÔ'×,Ò,¨T¯^ª^Ñ-=Ô-=Ø-AÀDÇNÂNÑDTÔDTÑ-TñVô Vð Vð Vð VðVøøøøøõ Ô$¥fÔ&;Ð<ð ð ð å�Ø˜!ðñ ô ð ð ð ð ð ð øøøøðøøøð 8Ð7Ð7ˆHØŒ~Ð)Ø—’ Ñ'Ô'Ð'Ø"ð #ð #�ð#ØÔ)×.Ò.¨t¬y¸6Ñ/AØ/CÀdÄiÑ/OÐRXÑ/XñZô Zð Zð ZøåÔ(­&Ô*?Ð@ð #ð #ð #Ý�FØ˜að"ñ #ô #ð #ð #ð #ð #ð #ð #øøøøð#øøøñ	#ð1	#ð 	#ss   ˆAAÁ
CÁCÁA6Á5CÁ6BÂCÂBÂACÃCÃCÃCÃDÃ/DÄDÄ3.E"Å"FÅ=FÆFc                 ó$  — |dk    rdgS t          t          |¦  «        ¦  «        }g }t          |¦  «        D ]>\  }}d|z  }t          t	          |¦  «        ¦  «        D ]}|                     |¦  «         ŒŒ?t          t          |¦  «        ¦  «        S )z¦Generate a list of the number of revisions to put in each pack.

        :param total_revisions: The total number of revisions in the
            repository.
        r   é
   )Úreversedr   Ú	enumerateÚrangerÜ  rÅ   rz   )r#   r£  rÝ  r�  ÚexponentÚcountr#  rF  s           r$   r�  z*RepositoryPackCollection.pack_distribution  s¡   € ð ˜aÒÐØ�3ˆJÝ�#˜oÑ.Ô.Ñ/Ô/ˆØˆÝ(¨Ñ0Ô0ð 	$ð 	$‰OˆH�eØ˜‘>ˆDÝ�S ™ZœZÑ(Ô(ð $ð $�Ø—’˜dÑ#Ô#Ð#Ð#ð$å•H˜VÑ$Ô$Ñ%Ô%Ð%r%   c                 ó   — | j         |dz   fS )z@Return a tuple with the transport and file name for a pack name.rƒ   )rõ   r‘   s     r$   Ú_pack_tuplez$RepositoryPackCollection._pack_tuple"  s   € àÔ# T¨G¡^Ð3Ð3r%   c                 óà   — | j                              |j        ¦  «         | j                             |j        ¦  «         |                      |¦  «         | j                             |¦  «         dS )zŽRemove pack from the packs accessed by this repository.

        Only affects memory state, until self._save_pack_names() is invoked.
        N)r{  rÊ  r…   r|  Ú_remove_pack_indicesrK  ÚremoverŠ  s     r$   r®  z1RepositoryPackCollection._remove_pack_from_memory&  sc   € ð
 	Œ�Š˜œ	Ñ"Ô"Ð"ØÔ×Ò ¤	Ñ*Ô*Ð*Ø×!Ò! $Ñ'Ô'Ð'ØŒ
×Ò˜$ÑÔÐÐÐr%   c                 óÆ   — t           j        D ]S}|dz   }t          | |¦  «        }|�:t          ||¦  «        }	 |                     |¦  «         Œ@# t          $ r |rY ŒN‚ w xY wŒTdS )z�Remove the indices for pack from the aggregated indices.

        :param ignore_missing: Suppress KeyErrors from calling remove_index.
        r�   N)rS   r‹   rE  rG  rã  )r#   ræ   Úignore_missingrŒ   Ú	attr_nameÚaggregate_indexÚ
pack_indexs          r$   r  z-RepositoryPackCollection._remove_pack_indices0  sš   € õ
 Ô0ð 
	ð 
	ˆJØ" XÑ-ˆIÝ% d¨IÑ6Ô6ˆOØÐ*Ý$ T¨9Ñ5Ô5�
ðØ#×0Ò0°Ñ<Ô<Ð<Ð<øÝð ð ð Ø%ð !Ø ˜Øðøøøð	 +ð
	ð 
	s   ·AÁAÁAc                 óT  — | j                              ¦   «          | j                             ¦   «          | j                             ¦   «          | j                             ¦   «          | j        �| j                             ¦   «          d| _        d| _        g | _        i | _	        d| _
        dS )zClear all cached data.N)ra   rA  rc   r>   rb   rd   rS  r{  rK  r|  r}  ri   s    r$   ÚresetzRepositoryPackCollection.resetA  sž   € ð 	Ô×!Ò!Ñ#Ô#Ð#àÔ×"Ò"Ñ$Ô$Ð$àŒ×ÒÑÔÐàÔ×"Ò"Ñ$Ô$Ð$àŒ>Ð%ØŒN× Ò Ñ"Ô"Ð"àˆŒàˆŒØˆŒ
Ø ˆÔØ"ˆÔÐÐr%   c                 óB   — | j         j                             ¦   «          dS )z.Release the mutex around the pack-names index.N)r`  r¶  Úunlockri   s    r$   Ú_unlock_namesz&RepositoryPackCollection._unlock_namesV  s   € àŒ	Ô×&Ò&Ñ(Ô(Ð(Ð(Ð(r%   c                 ó  — t          ¦   «         }|                      ¦   «         D ]6\  }}}|                     |d                              d¦  «        |f¦  «         Œ7t          |¦  «        }t          ¦   «         }| j                             ¦   «         D ]9\  }}|                     |d                     d„ |D ¦   «         ¦  «        f¦  «         Œ:| j        |z
  }	|| j        z
  }
|                     |	¦  «         | 	                    |
¦  «         ||	|
|fS )aW  Read the pack names from disk, and compare it to the one in memory.

        :return: (disk_nodes, deleted_nodes, new_nodes)
            disk_nodes    The final set of nodes that should be referenced
            deleted_nodes Nodes which have been removed from when we started
            new_nodes     Nodes that are newly introduced
        r   rÒ  rÞ  c              3   ó    K  — | ]	}d |z  V — Œ
dS )s   %dNr,   )rF   r#  s     r$   rt   z<RepositoryPackCollection._diff_pack_names.<locals>.<genexpr>l  s&   è è € Ð @Ð @°$ ¨¡Ð @Ð @Ð @Ð @Ð @Ð @r%   )
r�  rÕ  rØ  rÖ  r{  Úitemsrê   r}  Údifference_updater  )r#   Ú
disk_nodesr
   rL   rÙ  Úorig_disk_nodesÚcurrent_nodesr…   ÚsizesÚdeleted_nodesÚ	new_nodess              r$   Ú_diff_pack_namesz)RepositoryPackCollection._diff_pack_namesZ  s+  € õ ‘U”Uˆ
Ø!%×!;Ò!;Ñ!=Ô!=ð 	<ð 	<ÑˆE�3˜Ø�NŠN˜C œFŸMšM¨'Ñ2Ô2°EÐ:Ñ;Ô;Ð;Ð;Ý˜j™/œ/ˆõ ™œˆØœ;×,Ò,Ñ.Ô.ð 	Cð 	C‰KˆD�%Ø×ÒØ�t—y’yÐ @Ð @¸%Ð @Ñ @Ô @Ñ@Ô@ÐAñCô Cð Cð Cð
 Ô+¨mÑ;ˆà! DÔ$7Ñ7ˆ	ð 	×$Ò$ ]Ñ3Ô3Ð3Ø×Ò˜)Ñ$Ô$Ð$à˜=¨)°_ÐDÐDr%   c                 ód  — g }g }g }t          |¦  «        }|                      ¦   «         D ]:}|j        |vr/|                     |j        ¦  «         |                      |¦  «         Œ;|D ]Å\  }}|                      |¦  «        }	|| j        v rn|	| j        |         k    r\|                      |                      |¦  «        ¦  «         |	| j        |<   |                      |¦  «         |                     |¦  «         Œ‘|	| j        |<   |                      |¦  «         |                     |¦  «         ŒÆ|||fS )a  Given the correct set of pack files, update our saved info.

        :return: (removed, added, modified)
            removed     pack names removed from self._names
            added       pack names added to self._names
            modified    pack names that had changed value
        )Údictr�  r…   rÅ   r®  r×  r{  rŽ  )
r#   r"  ÚremovedÚaddedÚmodifiedÚ	new_namesræ   r…   rÙ  r%  s
             r$   Ú&_syncronize_pack_names_from_disk_nodesz?RepositoryPackCollection._syncronize_pack_names_from_disk_nodes{  sO  € ð ˆØˆØˆå˜Ñ$Ô$ˆ	à—N’NÑ$Ô$ð 	4ð 	4ˆDØŒy 	Ð)Ð)Ø—’˜tœyÑ)Ô)Ð)Ø×-Ò-¨dÑ3Ô3Ð3øà%ð 	#ð 	#‰KˆD�%Ø×+Ò+¨EÑ2Ô2ˆEØ�t”{Ð"Ð"à˜DœK¨Ô-Ò-Ð-ð ×1Ò1°$×2GÒ2GÈÑ2MÔ2MÑNÔNÐNØ(-�D”K Ñ%Ø×)Ò)¨$Ñ/Ô/Ð/Ø—O’O DÑ)Ô)Ð)øð %*�”˜DÑ!Ø×%Ò% dÑ+Ô+Ð+Ø—’˜TÑ"Ô"Ð"Ð"Ø˜˜xÐ'Ð'r%   c                 óÊ  ‡— g Š|                       ¦   «          	 |                      ¦   «         }|                      ¦   «         \  }}}}|D ]/\  }}	|                     |                     d¦  «        f|	¦  «         Œ0| j                             d|                     ¦   «         | j        j	         
                    ¦   «         ¬¦  «         || _        |r%d}
|rd„ |D ¦   «         }
|                      |
¦  «        Š|                      ¦   «          n# |                      ¦   «          w xY w|                      |¦  «         |r#ˆfd„|D ¦   «         }|                      |¦  «         d„ |D ¦   «         S )aN  Save the list of packs.

        This will take out the mutex around the pack names list for the
        duration of the method call. If concurrent updates have been made, a
        three-way merge between the current list and the current in memory list
        is performed.

        :param clear_obsolete_packs: If True, clear out the contents of the
            obsolete_packs directory.
        :param obsolete_packs: Packs that are obsolete once the new pack-names
            file has been written.
        :return: A list of the names saved that were not previously on disk.
        rÒ  rö  rä   Nc                 ó   — h | ]	}|j         ’Œ
S r,   r„   )rF   Úos     r$   rM   z<RepositoryPackCollection._save_pack_names.<locals>.<setcomp>Å  s   € Ð"BÐ"BÐ"B¨a 1¤6Ð"BÐ"BÐ"Br%   c                 ó&   •— g | ]}|j         ‰v¯|‘ŒS r,   r„   )rF   r2  Úalready_obsoletes     €r$   rH   z=RepositoryPackCollection._save_pack_names.<locals>.<listcomp>Ñ  s3   ø€ ð Að Að A AØ!"¤Ð/?Ð!?Ð!?ð  Ø!?Ð!?Ð!?r%   c                 ó   — g | ]
}|d          ‘ŒS r™  r,   )rF   Únew_nodes     r$   rH   z=RepositoryPackCollection._save_pack_names.<locals>.<listcomp>Ô  s   € Ð6Ð6Ð6 �˜”Ð6Ð6Ð6r%   )r¸  rò   r(  Úadd_nodeÚencoder	   Úput_filerÙ   r`  ra  rb  r}  rÁ  r  r/  r  )r#   r¬  r­  Úbuilderr"  r&  r'  r#  r…   rÙ  Úto_preserver4  s              @r$   r°  z)RepositoryPackCollection._save_pack_names¦  s¶  ø€ ð ÐØ�ŠÑÔÐð	!Ø×/Ò/Ñ1Ô1ˆGà $× 5Ò 5Ñ 7Ô 7ñˆZ˜¨	Øð  *ð Bð B‘��eØ× Ò  $§+¢+¨gÑ"6Ô"6Ð!9¸5ÑAÔAÐAÐAØŒN×#Ò# L°'·.².Ñ2BÔ2BØ)-¬Ô)=×)LÒ)LÑ)NÔ)Nð $ñ Pô Pð Pà",ˆDÔØ#ð KØ"�Ø!ð CØ"BÐ"B°>Ð"BÑ"BÔ"B�KØ#'×#=Ò#=¸kÑ#JÔ#JÐ à×ÒÑ Ô Ð Ð øˆD×ÒÑ Ô Ð Ð øøøà×3Ò3°JÑ?Ô?Ð?Øð 	1ðAð Að Að A¨ð Añ Aô AˆNà× Ò  Ñ0Ô0Ð0Ø6Ð6¨IÐ6Ñ6Ô6Ð6s   ™CD ÄDc                 ó¸   — |                       ¦   «         }|rdS |                      ¦   «         \  }}}}|| _        |                      |¦  «        \  }}}|s|s|rdS dS )aK  Sync our pack listing with what is present in the repository.

        This should be called when we find out that something we thought was
        present is now missing. This happens when another process re-packs the
        repository, etc.

        :return: True if the in-memory list of packs has been altered at all.
        TF)r¾  r(  r}  r/  )	r#   Ú
first_readr"  r&  r'  r#  r+  r,  r-  s	            r$   r  z*RepositoryPackCollection.reload_pack_namesÖ  sˆ   € ð ×'Ò'Ñ)Ô)ˆ
Øð 	Ø�4ð !×1Ò1Ñ3Ô3ñ	ˆ�] IØ	ð .ˆÔà×@Ò@ÀÑLÔLñ	ˆ�%Ø	Øð 	�eð 	˜xð 	Ø�4Øˆur%   c                 óz   — |                       ¦   «         s‚ t          | j        dt          j        ¦   «         ¦  «        ‚©z:Reload the pack names list, and restart the autopack code.F)r  r.   r`  Úsysr!   ri   s    r$   r¢  z*RepositoryPackCollection._restart_autopackô  s5   € à×%Ò%Ñ'Ô'ð 	ð Ý˜DœI u­c¬l©n¬nÑ=Ô=Ð=r%   c                 óz   — |                       ¦   «         s‚ t          | j        dt          j        ¦   «         ¦  «        ‚r?  )r  rÀ  r`  r@  r!   ri   s    r$   rÆ  z1RepositoryPackCollection._restart_pack_operationsü  s5   € à×%Ò%Ñ'Ô'ð 	ð Ý! $¤)¨UµC´L±N´NÑCÔCÐCr%   c                 óÞ  — g }| j                              d¦  «        }|€t          ¦   «         }	 |                     d¦  «        }n# t          j        $ r |cY S w xY w|D ]�}t                               |¦  «        \  }}|dk    r|                     |¦  «         ||v rŒ?	 | 	                    |¦  «         ŒV# t          j        t          j        f$ r}t          d|›�¦  «         Y d}~Œˆd}~ww xY w|S )z¸Delete everything from the obsolete-packs directory.

        :return: A list of pack identifiers (the filename without '.pack') that
            were found in obsolete_packs.
        r­  Nú.rƒ   z,couldn't delete obsolete pack, skipping it:
)r	   Úcloner�  Úlist_dirrî  rï  r÷   ÚsplitextrÅ   rÏ   r   r  r  r   )	r#   ÚpreserveÚfoundÚobsolete_pack_transportÚobsolete_pack_filesÚfilenamer…   Úextrð  s	            r$   rÁ  z.RepositoryPackCollection._clear_obsolete_packs  sE  € ð ˆØ"&¤.×"6Ò"6Ð7GÑ"HÔ"HÐØÐÝ‘u”uˆHð	Ø"9×"BÒ"BÀ3Ñ"GÔ"GÐÐøÝÔ(ð 	ð 	ð 	ØˆLˆLˆLð	øøøà+ð 
	 ð 
	 ˆHÝ×(Ò(¨Ñ2Ô2‰IˆD�#Ø�gŠ~ˆ~Ø—’˜TÑ"Ô"Ð"Ø�xÐÐØð Ø'×.Ò.¨xÑ8Ô8Ð8Ð8øÝÔ$¥fÔ&;Ð<ð  ð  ð  Ý�Ø˜1ðñ  ô  ð  ð  ð  ð  ð  ð  øøøøð øøøð ˆs)   ®A ÁAÁAÂB3Â3C*ÃC%Ã%C*c                 óD  — | j                              ¦   «         st          j        | ¦  «        ‚|                      | d| j         j                             ¦   «         ¬¦  «        | _        | j         	                    | j        j        | j        ¦  «         | j
         	                    | j        j
        | j        ¦  «         | j         	                    | j        j        | j        ¦  «         | j        j                             d¬¦  «         | j         	                    | j        j        | j        ¦  «         | j        �j| j         	                    | j        j        | j        ¦  «         | j        j        | j         j        j        _        | j        j                             d¬¦  «         | j
        j        | j         j        j        _        | j        j        | j         j        j        _        | j        j        | j         j        j        _        | j        j        | j         j        j        _        d S )Nrƒ   r\  Fr]  )r`  Úis_write_lockedr   ÚNotWriteLockedr_  ra  rb  rS  ra   r>  rb   r>   rc  rc   rd   r6  Ú	chk_bytesr�   Ú_add_callbackrm   Ú	revisionsÚ
signaturesrl   ri   s    r$   Ú_start_write_groupz+RepositoryPackCollection._start_write_group  sä  € àŒy×(Ò(Ñ*Ô*ð 	.ÝÔ'¨Ñ-Ô-Ð-Ø×*Ò*¨4¸wØ59´YÔ5I×5XÒ5XÑ5ZÔ5Zð +ñ \ô \ˆŒð 	Ô×.Ò.¨t¬~Ô/LØ/3¬~ñ	?ô 	?ð 	?àÔ×/Ò/°´Ô0NØ04´ñ	@ô 	@ð 	@àŒ×*Ò*¨4¬>Ô+DØ+/¬>ñ	;ô 	;ð 	;àŒÔ!×.Ò.ÀuÐ.ÑMÔMÐMØÔ×/Ò/°´Ô0NØ04´ñ	@ô 	@ð 	@àŒ>Ð%ØŒN×-Ò-¨d¬nÔ.FØ.2¬nñ>ô >ð >à7;´~Ô7RˆDŒIÔÔ&Ô4ØŒNÔ$×1Ò1Ø(-ð 2ñ /ô /ð /ð 6:Ô5IÔ5VˆŒ	ÔÔ$Ô2Ø37Ô3FÔ3SˆŒ	ÔÔ"Ô0Ø48Ô4HÔ4UˆŒ	ÔÔ#Ô1Ø/3¬Ô/KˆŒ	ŒÔÔ,Ð,Ð,r%   c                 ó  — | j         �‰t                               ¦   «         5 }|                     t          | dd ¦  «         |                     | j        | j         d¬¦  «         | j                              ¦   «          d d d ¦  «         n# 1 swxY w Y   | j        D ]d}t                               ¦   «         5 }|                     | j        |d¬¦  «         |                     ¦   «          d d d ¦  «         n# 1 swxY w Y   Œe| j        d d …= d S )NrS  T)r  )rS  Ú
contextlibÚ	ExitStackÚcallbackr£   r  rÒ   r‚  )r#   ÚstackÚresumed_packs      r$   Ú_abort_write_groupz+RepositoryPackCollection._abort_write_group;  sŒ  € ð Œ>Ð%Ý×%Ò%Ñ'Ô'ð '¨5Ø—’�w¨¨k¸4Ñ@Ô@Ð@ð
 —’˜tÔ8¸$¼.Ø.2ð ñ 4ô 4ð 4à”×$Ò$Ñ&Ô&Ð&ð'ð 'ð 'ñ 'ô 'ð 'ð 'ð 'ð 'ð 'ð 'øøøð 'ð 'ð 'ð 'ð !Ô/ð 	%ð 	%ˆLÝ×%Ò%Ñ'Ô'ð %¨5à—’˜tÔ8¸,Ø.2ð ñ 4ô 4ð 4à×"Ò"Ñ$Ô$Ð$ð	%ð %ð %ñ %ô %ð %ð %ð %ð %ð %ð %øøøð %ð %ð %ð %øð
 Ô   Ð"Ð"Ð"s$   ¡ABÂB
ÂB
Â32C1Ã1C5	Ã8C5	c                 óX   — | j         D ]}|                      |¦  «         Œ| j         d d …= d S ro   )r‚  r  )r#   rZ  s     r$   Ú_remove_resumed_pack_indicesz5RepositoryPackCollection._remove_resumed_pack_indicesP  s@   € Ø Ô/ð 	4ð 	4ˆLØ×%Ò% lÑ3Ô3Ð3Ð3ØÔ   Ð"Ð"Ð"r%   c                 ó   — g S )z³Detect missing inventories in this write group.

        :returns: list of strs, summarising any problems found.  If the list is
            empty no problems were found.
        r,   ri   s    r$   Ú_check_new_inventoriesz/RepositoryPackCollection._check_new_inventoriesU  s	   € ð ˆ	r%   c                 ó.  ‡	— t          ¦   «         }d| j        j        fd| j        j        fd| j        j        fd| j        j        ffD ]:\  Š	}|                     ¦   «         }|                     ˆ	fd„|D ¦   «         ¦  «         Œ;|r-t          j	        d| j        ›dt          |¦  «        ›d�¦  «        ‚|                      ¦   «         }|r,d	                     |¦  «        }t          j	        d
|z   ¦  «        ‚|                      | j        ¦  «         d}| j                             ¦   «         r=| j                             ¦   «          |                      | j        ¦  «         d | _        d}n | j                             ¦   «          d | _        | j        D ]Q}d | j        |j        <   |                      |¦  «         |                     ¦   «          |                      |¦  «         d}ŒR| j        d d …= |r,|                      ¦   «         }|s|                      ¦   «         S |S g S )NrR  rm   rl   rS  c                 ó   •— g | ]}‰f|z   ‘Œ	S r,   r,   )rF   rL   Úprefixs     €r$   rH   z@RepositoryPackCollection._commit_write_group.<locals>.<listcomp>h  s   ø€ ÐCÐCÐC°C  	¨C¡ÐCÐCÐCr%   zRepository z# has missing compression parent(s) ú ú
z&Cannot add revision(s) to repository: FT)r�  r`  rR  rm   rl   rS  Ú#get_missing_compression_parent_keysr  r   r|   ry   r_  rê   r  rS  r  rÙ   rô  rÒ   r‚  r{  r…   r®  r“  r°  )
r#   Úall_missingÚversioned_filer€   ÚproblemsÚproblems_summaryÚany_new_contentrZ  r�  rb  s
            @r$   Ú_commit_write_groupz,RepositoryPackCollection._commit_write_group_  sQ  ø€ Ý‘e”eˆà˜dœiÔ1Ð2Ø ¤	Ô 5Ð6Ø˜$œ)œ/Ð*Ø˜tœyÔ3Ð4ð	'ð 	Eð 	EÑ"ˆF�Nð %×HÒHÑJÔJˆGØ×ÒÐCÐCÐCÐC¸7ÐCÑCÔCÑDÔDÐDÐDØð 	4ÝÔ&Ð&à”9�9�9�f [Ñ1Ô1Ð1Ð1ð3ñ4ô 4ð 4ð ×.Ò.Ñ0Ô0ˆØð 	MØ#Ÿyšy¨Ñ2Ô2ÐÝÔ&Ø8Ð;KÑKñMô Mð Mà×!Ò! $¤.Ñ1Ô1Ð1ØˆØŒ>×'Ò'Ñ)Ô)ð 	"àŒN×!Ò!Ñ#Ô#Ð#Ø�MŠM˜$œ.Ñ)Ô)Ð)Ø!ˆDŒNØ"ˆOˆOàŒN× Ò Ñ"Ô"Ð"Ø!ˆDŒNØ Ô/ð 	#ð 	#ˆLð .2ˆDŒK˜Ô)Ñ*Ø×)Ò)¨,Ñ7Ô7Ð7Ø×ÒÑ!Ô!Ð!Ø�MŠM˜,Ñ'Ô'Ð'Ø"ˆOˆOØÔ   Ð"Øð 	Ø—]’]‘_”_ˆFØð /ð ×,Ò,Ñ.Ô.Ð.ØˆMØˆ	r%   c                 óz  — d„ | j         D ¦   «         }|                      | j        ¦  «         | j                             ¦   «         rB| j                             d¬¦  «         |                     | j        j        ¦  «         d | _        n | j                             ¦   «          d | _        |                      ¦   «          |S )Nc                 ó   — g | ]	}|j         ‘Œ
S r,   r„   )rF   ræ   s     r$   rH   zARepositoryPackCollection._suspend_write_group.<locals>.<listcomp>�  s   € Ð<Ð<Ð< �$”)Ð<Ð<Ð<r%   T)r  )	r‚  r  rS  r  rÙ   rÅ   r…   rÒ   r]  ©r#   Útokenss     r$   Ú_suspend_write_groupz-RepositoryPackCollection._suspend_write_group�  s¯   € Ø<Ð<¨Ô(;Ð<Ñ<Ô<ˆØ×!Ò! $¤.Ñ1Ô1Ð1ØŒ>×'Ò'Ñ)Ô)ð 	"àŒN×!Ò!¨$Ð!Ñ/Ô/Ð/Ø�MŠM˜$œ.Ô-Ñ.Ô.Ð.Ø!ˆDŒNˆNàŒN× Ò Ñ"Ô"Ð"Ø!ˆDŒNØ×)Ò)Ñ+Ô+Ð+Øˆr%   c                 ó:   — |D ]}|                       |¦  «         Œd S ro   )rñ  )r#   ro  Útokens      r$   Ú_resume_write_groupz,RepositoryPackCollection._resume_write_group�  s2   € Øð 	%ð 	%ˆEØ×Ò˜eÑ$Ô$Ð$Ð$ð	%ð 	%r%   ro   ©NF)FFr*  ©FN)4r&   r'   r(   r)   r   rÞ   Ú__annotations__r¿   rI  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®  r  r  r  r(  r/  r°  r  r¢  rÆ  rÁ  rT  r[  r]  r_  rk  rp  rs  r,   r%   r$   rs  rs  +  s,  € € € € € € ðð ð
 �w”-ÐÐÑØ˜{Ô+Ð+Ð+Ñ+Ø˜fœÐ%Ð%Ñ%Ø! &œ\Ð)Ð)Ñ)ð7Fð 7Fð 7FðrEð Eð Eð;ð ;ð ;ð"
ð 
ð 
ðð ð ð0%ð %ð %ðP .2ð#ð #ð #ð #ðJ#ð #ð #ð-ð -ð -ðQð Qð Qð)ð )ð )ð )ð,Qð Qð Qð 24ð 24ð 24ðhð ð ð.Bð Bð Bðð ð ð,ð ð ð>,ð ,ð ,ð6ð 6ð 6ðð ð ð ðð ð ð*ð *ð *ð+#ð +#ð +#ðZ&ð &ð &ð 4ð 4ð 4ð ð  ð  ðð ð ð ð"#ð #ð #ð*)ð )ð )ðEð Eð EðB)(ð )(ð )(ðV.7ð .7ð .7ð .7ð`ð ð ð<>ð >ð >ðDð Dð Dðð ð ð ð6Lð Lð Lð8#ð #ð #ð*#ð #ð #ð
ð ð ð.ð .ð .ð`ð ð ð%ð %ð %ð %ð %r%   rs  c                   óê   — e Zd ZU dZee         ed<   eed<   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d„Zd„ Zd„ Zd„ Zdd„Zdd„Zd„ Z eej        ej        ¦  «        d„ ¦   «         ZdS )ÚPackRepositorya  Repository with knit objects stored inside pack containers.

    The layering for a KnitPackRepository is:

    Graph        |  HPSS    | Repository public layer |
    ===================================================
    Tuple based apis below, string based, and key based apis above
    ---------------------------------------------------
    VersionedFiles
      Provides .texts, .revisions etc
      This adapts the N-tuple keys to physical knit records which only have a
      single string identifier (for historical reasons), which in older formats
      was always the revision_id, and in the mapped code for packs is always
      the last element of key tuples.
    ---------------------------------------------------
    GraphIndex
      A separate GraphIndex is used for each of the
      texts/inventories/revisions/signatures contained within each individual
      pack file. The GraphIndex layer works in N-tuples and is unaware of any
      semantic value.
    ===================================================

    Ú_commit_builder_classÚ_serializerc                 óJ  — t          j        | |||¦  «         || _        || _        d| _        | j        j        r2t                               |  	                    ¦   «         ¦  «        | _
        nt                               | ¦  «        | _
        | j
                             ¦   «          d S )NT)r   r   ry  rz  Ú_reconcile_fixes_text_parentsrº  Úsupports_external_lookupsr;   ÚCachingParentsProviderÚ _make_parents_provider_unstackedÚ_unstacked_providerÚdisable_cache)r#   rº  Úa_controldirr¶  ry  rz  s         r$   r   zPackRepository.__init__Â  sœ   € åÔ" 4¨°,ÀÑNÔNÐNØ%:ˆÔ"Ø&ˆÔØ-1ˆÔ*ØŒ<Ô1ð 	JÝ',×'CÒ'CØ×5Ò5Ñ7Ô7ñ(9ô (9ˆDÔ$Ð$õ (-×'CÒ'CÀDÑ'IÔ'IˆDÔ$ØÔ ×.Ò.Ñ0Ô0Ð0Ð0Ð0r%   c                 ó¤   — |                       ¦   «         5  d„ | j                             ¦   «         D ¦   «         cddd¦  «         S # 1 swxY w Y   dS )z"See Repository.all_revision_ids().c                 ó   — g | ]
}|d          ‘ŒS r™  r,   rK   s     r$   rH   z4PackRepository._all_revision_ids.<locals>.<listcomp>Ò  s   € Ð<Ð<Ð<˜s�C˜”FÐ<Ð<Ð<r%   N)Ú	lock_readrR  rP   ri   s    r$   Ú_all_revision_idsz PackRepository._all_revision_idsÏ  s•   € à�^Š^ÑÔð 	=ð 	=Ø<Ð< d¤n×&9Ò&9Ñ&;Ô&;Ð<Ñ<Ô<ð	=ð 	=ð 	=ð 	=ñ 	=ô 	=ð 	=ð 	=ð 	=ð 	=ð 	=ð 	=øøøð 	=ð 	=ð 	=ð 	=ð 	=ð 	=s   •#AÁA	ÁA	c                 ó~   — | j         j        j                             ¦   «          | j                             ¦   «          d S ro   )rR  r�   Ú_key_dependenciesrA  r=   r[  ri   s    r$   r[  z!PackRepository._abort_write_groupÔ  s7   € ØŒÔÔ/×5Ò5Ñ7Ô7Ð7ØÔ×0Ò0Ñ2Ô2Ð2Ð2Ð2r%   c                 óŽ   — | j         j        s| j        S t                               t          | j        g| j        ¦  «        ¦  «        S ro   )rº  r}  r€  r;   ÚStackedParentsProviderr   Ú_fallback_repositoriesri   s    r$   Ú_make_parents_providerz%PackRepository._make_parents_providerØ  sO   € ØŒ|Ô5ð 	,ØÔ+Ð+Ý×+Ò+­MØÔ%Ð&¨Ô(Cñ-Eô -Eñ Fô Fð 	Fr%   c                 óÈ   — |                       ¦   «         sd S | j                             ¦   «          | j                             ¦   «          | j                             ¦   «          d S ro   )rÓ  r=   r  r€  r�  Úenable_cacheri   s    r$   Ú_refresh_datazPackRepository._refresh_dataÞ  s^   € Ø�~Š~ÑÔð 	ØˆFØÔ×/Ò/Ñ1Ô1Ð1ØÔ ×.Ò.Ñ0Ô0Ð0ØÔ ×-Ò-Ñ/Ô/Ð/Ð/Ð/r%   c                 ó8   — | j                              ¦   «          d S ro   )r=   rT  ri   s    r$   rT  z!PackRepository._start_write_groupå  s   € ØÔ×0Ò0Ñ2Ô2Ð2Ð2Ð2r%   c                 óâ   — | j                              ¦   «         }| j        j        j                             ¦   «          | j                             ¦   «          | j                             ¦   «          |S ro   )	r=   rk  rR  r�   rˆ  rA  r€  r�  rŽ  )r#   rÂ  s     r$   rk  z"PackRepository._commit_write_groupè  sa   € ØÔ$×8Ò8Ñ:Ô:ˆØŒÔÔ/×5Ò5Ñ7Ô7Ð7ð 	Ô ×.Ò.Ñ0Ô0Ð0ØÔ ×-Ò-Ñ/Ô/Ð/Øˆr%   c                 óŒ   — | j                              ¦   «         }| j        j        j                             ¦   «          d | _        |S ro   )r=   rp  rR  r�   rˆ  rA  Ú_write_grouprn  s     r$   Úsuspend_write_groupz"PackRepository.suspend_write_groupñ  s=   € àÔ&×;Ò;Ñ=Ô=ˆØŒÔÔ/×5Ò5Ñ7Ô7Ð7Ø ˆÔØˆr%   c                 ó  — |                       ¦   «          	 | j                             |¦  «         n(# t          j        $ r |                      ¦   «          ‚ w xY w| j        j        D ]&}| j        j         	                    |j
        ¦  «         Œ'd S ro   )rT  r=   rs  r   rí  r[  r‚  rR  r�   Úscan_unvalidated_indexra   )r#   ro  ræ   s      r$   rs  z"PackRepository._resume_write_groupø  sª   € Ø×ÒÑ!Ô!Ð!ð	ØÔ!×5Ò5°fÑ=Ô=Ð=Ð=øÝÔ+ð 	ð 	ð 	Ø×#Ò#Ñ%Ô%Ð%Øð	øøøð Ô)Ô8ð 	Nð 	NˆDØŒNÔ!×8Ò8¸Ô9LÑMÔMÐMÐMð	Nð 	Ns	   –1 ±%Ac                 óP   — | j         r| j        S | j                             ¦   «         S ro   )Ú_write_lock_countÚ_transactionr¶  Úget_transactionri   s    r$   rš  zPackRepository.get_transaction  s+   € ØÔ!ð 	8ØÔ$Ð$àÔ%×5Ò5Ñ7Ô7Ð7r%   c                 óB   — | j         p| j                             ¦   «         S ro   )r˜  r¶  rÓ  ri   s    r$   rÓ  zPackRepository.is_locked  s   € ØÔ%ÐG¨Ô);×)EÒ)EÑ)GÔ)GÐGr%   c                 ó   — | j         S ro   )r˜  ri   s    r$   rN  zPackRepository.is_write_locked  s   € ØÔ%Ð%r%   Nc                 óú  — |                       ¦   «         }| j        s|rt          j        | ¦  «        ‚| xj        dz  c_        | j        dk    rt                               ¦   «         | _        |s{dt          j        v r| j	        dk    rt          d| ¦  «         d| _	        | j                             ¦   «          | j        D ]}|                     ¦   «          Œ|                      ¦   «          t!          | j        d¦  «        S )ziLock the repository for writes.

        :return: A breezy.repository.RepositoryWriteLockResult.
        r   ÚrelockÚwz%r was write locked againN)rÓ  r˜  r   ÚReadOnlyErrorÚtransactionsÚWriteTransactionr™  r   r  Ú
_prev_lockr   r€  rŽ  r‹  r…  r�  r   r  )r#   rr  Úlockedr`  s       r$   r·  zPackRepository.lock_write  s  € ð
 —’Ñ!Ô!ˆØÔ%ð 	-¨&ð 	-ÝÔ& tÑ,Ô,Ð,ØÐÔ !Ñ#ÐÔØÔ! QÒ&Ð&Ý ,× =Ò =Ñ ?Ô ?ˆDÔØð 	!Ø�5Ô,Ð,Ð,°´ÀCÒ1GÐ1GÝÐ0°$Ñ7Ô7Ð7Ø!ˆDŒOØÔ$×1Ò1Ñ3Ô3Ð3ØÔ3ð !ð !�à—’Ñ Ô Ð Ð Ø×ÒÑ Ô Ð Ý(¨¬°dÑ;Ô;Ð;r%   c                 ó®  — |                       ¦   «         }| j        r| xj        dz  c_        n| j                             ¦   «          |s{dt          j        v r| j        dk    rt          d| ¦  «         d| _        | j         	                    ¦   «          | j
        D ]}|                     ¦   «          Œ|                      ¦   «          t          | j        ¦  «        S )zZLock the repository for reads.

        :return: A breezy.lock.LogicalLockResult.
        r   rž  rs   z%r was read locked again)rÓ  r˜  r¶  r…  r   r  r£  r   r€  rŽ  r‹  r�  r   r  )r#   r¤  r`  s      r$   r…  zPackRepository.lock_read$  sà   € ð
 —’Ñ!Ô!ˆØÔ!ð 	+ØÐ"Ô" aÑ'Ð"Ô"Ð"àÔ×(Ò(Ñ*Ô*Ð*Øð 	!Ø�5Ô,Ð,Ð,°´ÀCÒ1GÐ1GÝÐ/°Ñ6Ô6Ð6Ø!ˆDŒOØÔ$×1Ò1Ñ3Ô3Ð3ØÔ3ð !ð !�Ø—’Ñ Ô Ð Ð Ø×ÒÑ Ô Ð Ý  ¤Ñ-Ô-Ð-r%   c                 ó*   — t          | j        ¦  «        ‚ro   )rg  Úleave_lock_in_placeri   s    r$   r§  z"PackRepository.leave_lock_in_place8  s   € å! $Ô":Ñ;Ô;Ð;r%   c                 ó*   — t          | j        ¦  «        ‚ro   )rg  Údont_leave_lock_in_placeri   s    r$   r©  z'PackRepository.dont_leave_lock_in_place<  s   € å! $Ô"?Ñ@Ô@Ð@r%   Fc                 ó˜   — |                       ¦   «         5  | j                             ||¬¦  «         ddd¦  «         dS # 1 swxY w Y   dS )zºCompress the data within the repository.

        This will pack all the data to a single pack. In future it may
        recompress deltas or do other such expensive operations.
        )rÂ  rÃ  N)r·  r=   ræ   )r#   rÂ  rÃ  s      r$   ræ   zPackRepository.pack@  sµ   € ð �_Š_ÑÔð 	Fð 	FØÔ!×&Ò&ØÐ0Dð 'ñ Fô Fð Fð	Fð 	Fð 	Fñ 	Fô 	Fð 	Fð 	Fð 	Fð 	Fð 	Fð 	Fð 	Føøøð 	Fð 	Fð 	Fð 	Fð 	Fð 	Fs   •?¿AÁAc                 ó¬   — ddl m} |                      ¦   «         5   || |¬¦  «        }|                      ¦   «         cddd¦  «         S # 1 swxY w Y   dS )zReconcile this repository.r   )ÚPackReconciler)ÚthoroughN)Ú	reconciler¬  r·  )r#   rª   r­  r¬  Ú
reconcilers        r$   r®  zPackRepository.reconcileJ  s«   € à-Ð-Ð-Ð-Ð-Ð-Ø�_Š_ÑÔð 	*ð 	*Ø'˜¨°xÐ@Ñ@Ô@ˆJØ×'Ò'Ñ)Ô)ð	*ð 	*ð 	*ð 	*ñ 	*ô 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*øøøð 	*ð 	*ð 	*ð 	*ð 	*ð 	*s   ›!A	Á	AÁAc                 ó*   — t          | j        ¦  «        ‚ro   )rg  Ú_reconcile_pack)r#   Ú
collectionrK  Ú	extensionÚrevsrY  s         r$   r±  zPackRepository._reconcile_packQ  s   € Ý! $Ô"6Ñ7Ô7Ð7r%   c                 ó  — | j         dk    rY| j        �R|                      ¦   «          | j                             ¦   «          d | _        d| _         t          j        d| z  ¦  «        ‚| j         r:| xj         dz  c_         | j         s"| j        }d | _        |                     ¦   «          n| j	         
                    ¦   «          |                      ¦   «         s7| j                             ¦   «          | j        D ]}| 
                    ¦   «          Œd S d S )Nr   r   z6Must end write group before releasing write lock on %s)r˜  r“  Úabort_write_groupr€  r�  r™  r   r   rÙ   r¶  r  rÓ  r‹  )r#   Útransactionr`  s      r$   r  zPackRepository.unlockT  s.  € àÔ! QÒ&Ð&¨4Ô+<Ð+HØ×"Ò"Ñ$Ô$Ð$ØÔ$×2Ò2Ñ4Ô4Ð4Ø $ˆDÔØ%&ˆDÔ"Ý”/ØHØññô ð ð Ô!ð 	(ØÐ"Ô" aÑ'Ð"Ô"ØÔ)ð %Ø"Ô/�Ø$(�Ô!Ø×"Ò"Ñ$Ô$Ð$øàÔ×%Ò%Ñ'Ô'Ð'à�~Š~ÑÔð 	ØÔ$×2Ò2Ñ4Ô4Ð4ØÔ3ð ð �Ø—’‘”��ð	ð 	ðð r%   ro   rt  ) r&   r'   r(   r)   r   r   rv  r   r   r†  r[  rŒ  r�  rT  rk  r”  rs  rš  rÓ  rN  r·  r…  r§  r©  ræ   r®  r±  r   r   ÚLockNotHeldÚ
LockBrokenr  r,   r%   r$   rx  rx  ¢  sª  € € € € € € ðð ð8  Ð :Ô;Ð;Ð;Ñ;ØÐÐÑð1ð 1ð 1ð=ð =ð =ð
3ð 3ð 3ðFð Fð Fð0ð 0ð 0ð3ð 3ð 3ðð ð ðð ð ðNð Nð Nð8ð 8ð 8ðHð Hð Hð&ð &ð &ð<ð <ð <ð <ð,.ð .ð .ð(<ð <ð <ðAð Að AðFð Fð Fð Fð*ð *ð *ð *ð8ð 8ð 8ð €[�Ô# VÔ%6Ñ7Ô7ðð ñ 8Ô7ðð ð r%   rx  c                   óò   — e Zd ZU dZee         ed<   ee         ed<   eed<   dZ	e
ed<   dZe
ed<   dZe
ed	<   eej                 ed
<   ee         ed<   dZe
ed<   dZe
ed<   dZe
ed<   dZe
ed<   dd„Zdd„ZdS )ÚRepositoryFormatPackaÖ  Format logic for pack structured repositories.

    This repository format has:
     - a list of packs in pack-names
     - packs in packs/NAME.pack
     - indices in indices/NAME.{iix,six,tix,rix}
     - knit deltas in the packs, knit indices mapped to the indices.
     - thunk objects to support the knits programming API.
     - a format marker of its own
     - an optional 'shared-storage' flag
     - an optional 'no-working-trees' flag
     - a LockDir lock
    Úrepository_classry  rz  TÚsupports_ghostsFr}  Úsupports_chksr  rž   Ú_fetch_uses_deltasÚfast_deltasÚsupports_funky_charactersÚ%revision_graph_can_have_wrong_parentsc                 óT  — t          d|j        j        ¦  «         g d¢}|                      ¦   «         }d|                     ¦   «         fg}d|                      ¦   «         fg}|                      |||||¦  «         |                      |d¬¦  «        }|                      |||¦  «         |S )a  Create a pack based repository.

        :param a_controldir: bzrdir to contain the new repository; must already
            be initialized.
        :param shared: If true the repository will be initialized as a shared
                       repository.
        zcreating repository in %s.)rÊ   r­  rK  Úuploadrö  rº   T)r‚  Ú_found)	r   r	   r  r  rÙ   Úget_format_stringÚ_upload_blank_contentrñ   Ú_run_post_repo_init_hooks)r#   r‚  ÚsharedÚdirsr:  ÚfilesÚ
utf8_filesrA   s           r$   Ú
initializezRepositoryFormatPack.initialize”  s½   € õ 	Ð+¨\Ô-CÔ-HÑIÔIÐIØ?Ð?Ð?ˆØ×*Ò*Ñ,Ô,ˆØ §¢Ñ 0Ô 0Ð1Ð2ˆØ ×!7Ò!7Ñ!9Ô!9Ð:Ð;ˆ
à×"Ò"Ø˜$  z°6ñ	;ô 	;ð 	;à—Y’Y¨LÀ�YÑFÔFˆ
Ø×&Ò& z°<ÀÑHÔHÐHØÐr%   Nc                 óê   — |st          j        |¦  «        }|�|}n|                     d¦  «        }t          j        |dt
          j        ¦  «        }|                      | ||| j        | j	        ¬¦  «        S )a  See RepositoryFormat.open().

        :param _override_transport: INTERNAL USE ONLY. Allows opening the
                                    repository at a slightly different url
                                    than normal. I.e. during 'upgrade'.
        NÚlock)rº  r‚  r¶  ry  rz  )
r   Úfind_formatÚget_repository_transportr   ÚLockableFilesr   ÚLockDirr¼  ry  rz  )r#   r‚  rÅ  Ú_override_transportrº   Úrepo_transportr¶  s          r$   rñ   zRepositoryFormatPack.open¨  sŽ   € ð ð 	GÝ,Ô8¸ÑFÔFˆFØÐ*Ø0ˆNˆNà)×BÒBÀ4ÑHÔHˆNÝ&Ô4°^Ø5;½W¼_ñNô Nˆà×$Ò$¨TØ2>Ø3@Ø;?Ô;UØ15Ô1Að	 %ñ Cô Cð 	Cr%   r*  ru  )r&   r'   r(   r)   r   rx  rv  r   r   r½  r  r}  r¾  r
   ÚGraphIndexBuilderÚobjectr¿  rÀ  rÁ  rÂ  rÍ  rñ   r,   r%   r$   r»  r»  m  s  € € € € € € ðð ð  ˜>Ô*Ð*Ð*Ñ*ð  Ð :Ô;Ð;Ð;Ñ;ð ÐÐÑà €O�TÐ Ð Ñ à&+Ð˜tÐ+Ð+Ñ+à€M�4ÐÐÑà˜eÔ5Ô6Ð6Ð6Ñ6Ø�f”ÐÐÑØ#Ð˜Ð#Ð#Ñ#Ø€K�ÐÐÑØ&*Ð˜tÐ*Ð*Ñ*Ø26Ð)¨4Ð6Ð6Ñ6ðð ð ð ð(Cð Cð Cð Cð Cð Cr%   r»  c                   ó   — e Zd ZdZdZdZdS )rÀ  z¨Raised when we are packing and we find a missing file.

    Meant as a signaling exception, to tell the RepositoryPackCollection.pack
    code it should try again.
    TzWPack files have changed, reload and try pack again. context: %(context)s %(orig_error)sNr/   r,   r%   r$   rÀ  rÀ  ¾  r0   r%   rÀ  c                   ó>   — e Zd ZdZd
d„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
dS )r4  z:Access to data in one or more packs with less translation.Nc                 óL   — d| _         d| _        || _        || _        || _        dS )a  Create a _DirectPackAccess object.

        :param index_to_packs: A dict mapping index objects to the transport
            and file names for obtaining data.
        :param reload_func: A function to call if we determine that the pack
            files have moved and we need to reload our caches. See
            breezy.repo_fmt.pack_repo.AggregateIndex for more details.
        N)Ú_container_writerr  rB  r1  Ú_flush_func)r#   Úindex_to_packsr/  r0  s       r$   r   z_DirectPackAccess.__init__Î  s1   € ð "&ˆÔØ ˆÔØ&ˆŒØ'ˆÔØ%ˆÔÐÐr%   c                 óT   — | j                              ||g ¦  «        \  }}| j        ||fS )aó  Add raw knit bytes to a storage area.

        The data is spooled to the container writer in one bytes-record per
        raw data item.

        :param key: key of the data segment
        :param size: length of the data segment
        :param raw_data: A bytestring containing the data.
        :return: An opaque index memo For _DirectPackAccess the memo is
            (index, pos, length), where the index field is the write_index
            object supplied to the PackAccess object.
        )rÛ  Úadd_bytes_recordr  )r#   rL   r#  Úraw_dataÚp_offsetÚp_lengths         r$   Úadd_raw_recordz _DirectPackAccess.add_raw_recordÝ  s8   € ð "Ô3×DÒDØ�d˜Bñ ô  Ñˆ�(àÔ! 8¨XÐ6Ð6r%   c                 ó&  — d                      |¦  «        }t          |t          ¦  «        st          dt	          |¦  «        z  ¦  «        ‚g }d}|D ]@\  }}|                     |                      ||||||z   …         g¦  «        ¦  «         ||z  }ŒA|S )aM  Add raw knit bytes to a storage area.

        The data is spooled to the container writer in one bytes-record per
        raw data item.

        :param sizes: An iterable of tuples containing the key and size of each
            raw data segment.
        :param raw_data: A bytestring containing the data.
        :return: A list of memos to retrieve the record later. Each memo is an
            opaque index memo. For _DirectPackAccess the memo is (index, pos,
            length), where the index field is the write_index object supplied
            to the PackAccess object.
        r%   zdata must be plain bytes was %sr   )rê   r¦   rë   r³   r®   rÅ   rã  )r#   Ú	key_sizesrà  r�  rË   rL   r#  s          r$   Úadd_raw_recordsz!_DirectPackAccess.add_raw_recordsî  s·   € ð —8’8˜HÑ%Ô%ˆÝ˜(¥EÑ*Ô*ð 	DÝ Ø1µD¸±N´NÑBñDô Dð DàˆØˆØ"ð 	ð 	‰IˆC�Ø�MŠMØ×#Ò# C¨°¸ÀÈÁÐ9MÔ0NÐ/OÑPÔPñRô Rð Rà�d‰NˆFˆFØˆr%   c                 ó@   — | j         �|                       ¦   «          dS dS )zoFlush pending writes on this access object.

        This will flush any buffered writes to a NewPack.
        N)rÜ  ri   s    r$   rì   z_DirectPackAccess.flush  s-   € ð
 ÔÐ'Ø×ÒÑÔÐÐÐð (Ð'r%   c              #   ó¢  K  — g }d}|D ]D\  }}}||k    r|                      ||f¦  «         Œ$|�|                      ||f¦  «         |}||fg}ŒE|�|                      ||f¦  «         |D ]å\  }}	 | j        |         \  }	}
n9# t          $ r, | j        €‚ t	          |dt          j        ¦   «         ¬¦  «        ‚w xY w	 t                               |	|
|¦  «        }| 	                    ¦   «         D ]\  }} |d¦  «        V — ŒŒ•# t          j        $ r? | j        €‚ t	          |	                     |
¦  «        dt          j        ¦   «         ¬¦  «        ‚w xY wdS )aZ  Get the raw bytes for a records.

        :param memos_for_retrieval: An iterable containing the (index, pos,
            length) memo for retrieving the bytes. The Pack access method
            looks up the pack to use for a given record in its index_to_pack
            map.
        :return: An iterator over the bytes of the records.
        NT)r    r!   F)rÅ   rB  rã  r1  r   r@  r!   ræ   Úmake_readv_readerÚiter_recordsrî  rï  Úabspath)r#   Úmemos_for_retrievalÚrequest_listsÚcurrent_indexr
   rË   ÚlengthÚcurrent_listÚoffsetsr	   ÚpathÚreaderr�  Ú	read_funcs                 r$   Úget_raw_recordsz!_DirectPackAccess.get_raw_records  sò  è è € ð ˆØˆØ':ð 	2ð 	2Ñ#ˆU�F˜FØ Ò%Ð%Ø×#Ò# V¨VÐ$4Ñ5Ô5Ð5Ð5à Ð,Ø!×(Ò(¨-¸Ð)FÑGÔGÐGØ %�Ø!'¨Ð 0Ð1��àÐ$Ø× Ò  -°Ð!>Ñ?Ô?Ð?Ø+ð 	Að 	A‰NˆE�7ðAØ"&¤-°Ô"6‘�	˜4˜4øÝð 
Að 
Að 
Að Ô$Ð,ð Ý'¨Ø8<Ý14´±´ðAñ Aô Að Að
AøøøðAÝ×/Ò/°	¸4ÀÑIÔI�Ø(.×(;Ò(;Ñ(=Ô(=ð *ð *Ñ$�E˜9Ø#˜) D™/œ/Ð)Ð)Ð)Ð)ð*øå!Ô,ð Að Að Að Ô$Ð,ØÝ'¨	×(9Ò(9¸$Ñ(?Ô(?Ø8=Ý14´±´ðAñ Aô Að AðAøøøð%	Að 	As   Á/B Â 6B6Â:AC>Ã>AEc                 ó:   — |�
|| j         |<   || _        || _        dS )z$Set a writer to use for adding data.N)rB  rÛ  r  )r#   Úwriterr
   Útransport_packnames       r$   r<  z_DirectPackAccess.set_writerB  s*   € àÐØ#5ˆDŒM˜%Ñ Ø!'ˆÔØ!ˆÔÐÐr%   c                 óv   — d}| j         €d}n|                       ¦   «         s	|j        sd}|r|j        d         ‚dS )a‚  Try calling the reload function, or re-raise the original exception.

        This should be called after _DirectPackAccess raises a
        RetryWithNewPacks exception. This function will handle the common logic
        of determining when the error is fatal versus being temporary.
        It will also make sure that the original exception is raised, rather
        than the RetryWithNewPacks exception.

        If this function returns, then the calling function should retry
        whatever operation was being performed. Otherwise an exception will
        be raised.

        :param retry_exc: A RetryWithNewPacks exception.
        FNTr   )r1  r    r!   )r#   Ú	retry_excÚis_errors      r$   Úreload_or_raisez!_DirectPackAccess.reload_or_raiseI  s_   € ð ˆØÔÐ$ØˆHˆHØ×"Ò"Ñ$Ô$ð 	 àÔ,ð  ð  �Øð 	(àÔ$ QÔ'Ð'ð	(ð 	(r%   r@  )r&   r'   r(   r)   r   rã  ræ  rì   rõ  r<  rü  r,   r%   r$   r4  r4  Ë  sŒ   € € € € € ØDÐDð&ð &ð &ð &ð7ð 7ð 7ð"ð ð ð4ð ð ð0Að 0Að 0Aðd"ð "ð "ð(ð (ð (ð (ð (r%   r4  )1rë  r@  Útypingr   r   Úglobalsrß   r   r   r   r	   rî  Úbzrr
   r   Ú
decoratorsr   rÏ  r   rA   r   r   r   r   Ú
serializerr   Úvf_repositoryr   r   r   Útracer   r   r   r   r   r.   r2   rS   r±   r¿   rÞ   r,  rI  rs  rx  r»  rÀ  r4  r,   r%   r$   ú<module>r     sƒ  ðð" 
€	€	€	Ø 
€
€
€
Ø Ð Ð Ð Ð Ð à %Ð %Ð %Ð %Ð %Ð %Ø €ˆGˆG‰IŒIð ñ ô ð ð&ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð
ð ð ð ð ð ð %Ð $Ð $Ð $Ð $Ð $ðð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð #Ð "Ð "Ð "Ð "Ð "ðð ð ð ð ð ð ð ð ð ð
ð ð ð ð ð ð ð ð ð ð&ð &ð &ð &ð &˜œñ &ô &ð &ðD
4ð 
4ð 
4ð 
4ð 
4Ð%ñ 
4ô 
4ð 
4ð@ð @ð @ð @ð @Ð2ñ @ô @ð @ð,|Mð |Mð |Mð |Mð |Mñ |Mô |Mð |Mð~-ð -ð -ð -ð -�4ñ -ô -ð -ðBB,ð B,ð B,ð B,ð B,�,ñ B,ô B,ð B,ðJd6ð d6ð d6ð d6ð d6ˆdñ d6ô d6ð d6ðNSBð SBð SBð SBð SBñ SBô SBð SBðlt(ð t(ð t(ð t(ð t(ñ t(ô t(ð t(ðnt%ð t%ð t%ð t%ð t%ñ t%ô t%ð t%ðnHð Hð Hð Hð HÐ3ñ Hô Hð HðVNCð NCð NCð NCð NCÐ?ñ NCô NCð NCðb
4ð 
4ð 
4ð 
4ð 
4Ð+ñ 
4ô 
4ð 
4ðY(ð Y(ð Y(ð Y(ð Y(ñ Y(ô Y(ð Y(ð Y(ð Y(r%   