403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.224
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67922704 ( 67922704)
PHP Version : 8.5.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/lib/python3/dist-packages/breezy/bzr/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/lib/python3/dist-packages/breezy/bzr/__pycache__/versionedfile.cpython-313.pyc
�

p��gQO���SrSSKrSSKrSSKrSSKJr SSKJr SSKJr SSK	J
r
 SSKJr \"\"5S	5 SS
K
JrJr SSK
Jr SSK
Jr SS
KJr SSKJr SSK
Jr \\\\4\4"5r\R9SSS5 \R9SSS5 SHWr\R9S\4SS5 \R9S\4SS5 \R9S\4SS5 \R9S\4SS5 MY "SS \R<5r"S!S"\R@5r!"S#S$5r""S%S&\"5r#"S'S(\"5r$"S)S*\"5r%"S+S,\"5r&"S-S.\"5r'S/r("S0S15r)"S2S35r*"S4S55r+"S6S7\+5r,"S8S95r-"S:S;\-5r."S<S=\-5r/"S>S?\/5r0"S@SA\/5r1"SBSC\15r2SDr3"SESF5r4"SGSH\45r5"SISJ\45r6"SKSL\45r7"SMSN\5r8"SOSP\85r9"SQSR\45r:"SSST5r;SUr<"SVSW5r=SXr>SYr?SZr@S[rA"S\S]5rBg)^z Versioned text file storage api.�N)�copy)�BytesIO)�Any)�adler32�)�lazy_importz�
import fastbencode as bencode

from breezy import (
    multiparent,
    revision,
    urlutils,
    )
from breezy.bzr import (
    groupcompress,
    knit,
    )
)�errors�osutils)�graph)�	transport)�Registry)�	TextMerge�)�index)�knit-annotated-delta-gz�
knit-delta-gzzbreezy.bzr.knit�DeltaAnnotatedToUnannotated)�knit-annotated-ft-gz�
knit-ft-gz�FTAnnotatedToUnannotated)�fulltext�chunked�linesr�DeltaPlainToFullTextr�FTPlainToFullTextr�FTAnnotatedToFullTextr�DeltaAnnotatedToFullTextc��\rSrSrSrSrSrg)�UnavailableRepresentation�Tz\The encoding '%(wanted)s' is not available for key %(key)s which is encoded as '%(native)s'.c�f�[RRU5 X lX0lXlg�N)r	�InternalBzrError�__init__�wanted�native�key)�selfr'r%r&s    �:/usr/lib/python3/dist-packages/breezy/bzr/versionedfile.pyr$�"UnavailableRepresentation.__init__Zs%�����(�(��.�������)r'r&r%N)�__name__�
__module__�__qualname__�__firstlineno__�_fmtr$�__static_attributes__�r+r)rrTs��	&�	�
r+rc��\rSrSrSrSrg)�ExistingContent�az.The content being inserted is already present.r2N)r,r-r.r/r0r1r2r+r)r4r4as��;�Dr+r4c��\rSrSrSrSrSrg)�ContentFactory�ea�Abstract interface for insertion and retrieval from a VersionedFile.

:ivar sha1: None, or the sha1 of the content fulltext.
:ivar size: None, or the size of the content fulltext.
:ivar storage_kind: The native storage kind of this factory. One of
    'mpdiff', 'knit-annotated-ft', 'knit-annotated-delta', 'knit-ft',
    'knit-delta', 'fulltext', 'knit-annotated-ft-gz',
    'knit-annotated-delta-gz', 'knit-ft-gz', 'knit-delta-gz'.
:ivar key: The key of this content. Each key is a tuple with a single
    string in it.
:ivar parents: A tuple of parent keys for self.key. If the object has
    no parent information, None (as opposed to () for an empty list of
    parents).
c�J�SUlSUlSUlSUlSUlg)�Create a ContentFactory.N��sha1�size�storage_kindr'�parents�r(s r)r$�ContentFactory.__init__us&����	���	� ��������r+�r'r?r<r=r>N)r,r-r.r/�__doc__r$r1r2r+r)r7r7es��
�r+r7c�.�\rSrSrSrSSjrSrSrSrg)	�ChunkedContentFactory�~a�Static data content factory.

This takes a 'chunked' list of strings. The only requirement on 'chunked' is
that ''.join(lines) becomes a valid fulltext. A tuple of a single string
satisfies this, as does a list of lines.

:ivar sha1: None, or the sha1 of the content fulltext.
:ivar size: None, or the size of the content fulltext.
:ivar storage_kind: The native storage kind of this factory. Always
    'chunked'
:ivar key: The key of this content. Each key is a tuple with a single
    string in it.
:ivar parents: A tuple of parent keys for self.key. If the object has
    no parent information, None (as opposed to () for an empty list of
    parents).
:ivar chunks_are_lines: Whether chunks are lines.
Nc��X0l[[[U55UlSUlXlX lX@lXPl	g)r:rN)
r<�sum�map�lenr=r>r'r?�_chunks�_chunks_are_lines)r(r'r?r<�chunks�chunks_are_liness      r)r$�ChunkedContentFactory.__init__�s7���	���C��(�)��	�%���������!1�r+c�@�US:XaUR$US:XaSRUR5$US:XaFUR(aUR$[[R
"UR55$[
URXR5e)Nrrr+r)	rK�joinrL�listr
�chunks_to_linesrr'r>�r(r>s  r)�get_bytes_as�"ChunkedContentFactory.get_bytes_as�s{���9�$��<�<��
�Z�
'��8�8�D�L�L�)�)�
�W�
$��%�%��|�|�#���/�/����=�>�>�'����,�@Q�@Q�R�Rr+c�"�US:Xa[UR5$US:XaOUR(a[UR5$[[R"UR55$[URXR5e�Nrr)�iterrKrLr
rSrr'r>rTs  r)�
iter_bytes_as�#ChunkedContentFactory.iter_bytes_as�sj���9�$�����%�%�
�W�
$��%�%��D�L�L�)�)���/�/����=�>�>�'����,�@Q�@Q�R�Rr+)rKrLr'r?r<r=r>r"�	r,r-r.r/rCr$rUrZr1r2r+r)rErE~s���$2�	S�Sr+rEc�*�\rSrSrSrSrSrSrSrg)�FulltextContentFactory�a�Static data content factory.

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

:ivar sha1: None, or the sha1 of the content fulltext.
:ivar storage_kind: The native storage kind of this factory. Always
    'fulltext'.
:ivar key: The key of this content. Each key is a tuple with a single
    string in it.
:ivar parents: A tuple of parent keys for self.key. If the object has
    no parent information, None (as opposed to () for an empty list of
    parents).
c��X0l[U5UlSUlXlX l[
U[5(d[U5eX@l	g)r:rN)
r<rJr=r>r'r?�
isinstance�bytes�	TypeError�_text)r(r'r?r<�texts     r)r$�FulltextContentFactory.__init__�s@���	���I��	�&��������$��&�&��D�/�!��
r+c���XR:XaUR$US:Xa
UR/$US:Xa [R"UR5$[	UR
XR5erX)r>rdr
�split_linesrr'rTs  r)rU�#FulltextContentFactory.get_bytes_as�s`���,�,�,��:�:��
�Y�
&��J�J�<��
�W�
$��&�&�t�z�z�2�2�'����,�@Q�@Q�R�Rr+c���US:Xa[UR/5$US:Xa)[[R"UR55$[	UR
XR5erX)rYrdr
rhrr'r>rTs  r)rZ�$FulltextContentFactory.iter_bytes_as�sT���9�$������%�%�
�W�
$���+�+�D�J�J�7�8�8�'����,�@Q�@Q�R�Rr+)rdr'r?r<r=r>Nr\r2r+r)r^r^�s��
�	�S�Sr+r^c�.�\rSrSrSrSSjrSrSrSrg)	�FileContentFactory��zFile-based content factory.Nc�\�XlX lX0lSUlX@lXPlSUlg)N�fileF)r'r?rpr>r<r=�_needs_reset)r(r'r?�fileobjr<r=s      r)r$�FileContentFactory.__init__�s+�������	�"����	��	�!��r+c��UR(aURRS5 SUlUS:XaURR5$US:Xa)[	[
R"UR55$US:Xa#[	URR55$[URXR5e)NrTrrr)rqrp�seek�readrRr
�
file_iterator�	readlinesrr'r>rTs  r)rU�FileContentFactory.get_bytes_as�s�������I�I�N�N�1�� ����:�%��9�9�>�>�#�#�
�Y�
&���-�-�d�i�i�8�9�9�
�W�
$���	�	�+�+�-�.�.�'����,�@Q�@Q�R�Rr+c��UR(aURRS5 SUlUS:Xa [R"UR5$US:XaUR$[URXR5e)NrTrr)rqrprur
rwrr'r>rTs  r)rZ� FileContentFactory.iter_bytes_as�si������I�I�N�N�1�� ����9�$��(�(����3�3�
�W�
$��9�9��'����,�@Q�@Q�R�Rr+)rqrpr'r?r<r=r>�NNr\r2r+r)rmrm�s��%�"�
S�Sr+rmc�*�\rSrSrSrSrSrSrSrg)�AbsentContentFactory�z�A placeholder content factory for unavailable texts.

:ivar sha1: None.
:ivar storage_kind: 'absent'.
:ivar key: The key of this content. Each key is a tuple with a single
    string in it.
:ivar parents: None.
c�H�SUlSUlSUlXlSUlg)r:N�absentr;�r(r's  r)r$�AbsentContentFactory.__init__	s$����	���	�$�������r+c�J�[SRUR55e�NzyA request was made for key: {}, but that content is not available, and the calling code does not handle if it is missing.��
ValueError�formatr'rTs  r)rU�!AbsentContentFactory.get_bytes_as�"���
6�6<�f�T�X�X�6F�
�	
r+c�J�[SRUR55er�r�rTs  r)rZ�"AbsentContentFactory.iter_bytes_asr�r+rBNr\r2r+r)r~r~�s����
�
r+r~c�$�\rSrSrSrSrSrSrg)�AdapterFactoryi z0A content factory to adapt between key prefix's.c�(�XlX lX0lg)z#Create an adapter factory instance.N)r'r?�_adapted)r(r'r?�adapteds    r)r$�AdapterFactory.__init__#s�������
r+c�X�US;aURU$[URU5$)z(Return a member from the adapted object.)r'r?)�__dict__�getattrr�)r(�attrs  r)�__getattr__�AdapterFactory.__getattr__)s+���%�%��=�=��&�&��4�=�=�$�/�/r+)r�r'r?N)r,r-r.r/rCr$r�r1r2r+r)r�r� s��:� �0r+r�c#�J# �UHnURS:wdMUv� M g7f)z/Adapt a record stream to remove absent records.r�N)r>)�
record_stream�records  r)�
filter_absentr�1s"��������(�*��L� �s�#�	#c�<�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�_MPDiffGeneratori8z3Pull out the functionality for generating mp_diffs.c��Xl[U5UlSUl0Ul0UlSUl0Ul0Ulg�Nr2)	�vf�tuple�ordered_keys�needed_keys�diffs�
parent_map�
ghost_parents�	refcountsrM)r(r��keyss   r)r$�_MPDiffGenerator.__init__;s?����!�$�K��������
������������r+c���[UR5nURRU5nX lURU5nU(a-[R"[U5SUR5e0nURn[5nUR5HGupxU(dMURU5 URU5 UHn	U"U	S5S-XI'M MI URU5 [URRU55Ul
URUR5UlURUR5 XlX@lX4$)a[Find the set of keys we need to request.

This includes all the original keys passed in, and the non-ghost
parents of those keys.

:return: (needed_keys, refcounts)
    needed_keys is the set of all texts we need to extract
    refcounts is a dict of {key: num_children} letting us know when we
        no longer need to cache a given parent text
rr)�setr�r��get_parent_mapr��
differencer	�RevisionNotPresentrR�
setdefault�items�update�difference_update�present_parentsr�r�r�)
r(r�r��missing_keysr�r��just_parents�
_child_key�parent_keys�ps
          r)�_find_needed_keys�"_MPDiffGenerator._find_needed_keysLs@���$�+�+�,���W�W�+�+�K�8�
�$��#�-�-�j�9����+�+�D��,>�q�,A�4�7�7�K�K��	��)�)�
��u��'1�'7�'7�'9�#�J�������,����{�+� ��)�!�Q�/�!�3�	��!�(:�	�&�&�z�2�"�4�7�7�#9�#9�,�#G�H���)�4�4�T�5I�5I�J����%�%�d�&8�&8�9�&��"���%�%r+c���[U5S:�a URRXSU5nOSn[RRX2U5nXPRU'g)z6Compute a single mp_diff, and store it in self._diffs.rN)rJr��_extract_blocks�multiparent�MultiParent�
from_linesr�)r(r'�parent_linesr�left_parent_blocks�diffs      r)�
_compute_diff�_MPDiffGenerator._compute_diffxs[���|��q� �
"&���!8�!8��1�o�u�!U��!%���&�&�1�1��!3�
���
�
�3�r+c�Z�SnXR;a�URRU5nUcSn/nUH�nXPR;aMURUnUS:Xa7URRU5 URRU5nO!US-
URU'URUn[
R"U5nURU5 AM� [
R"U5n	U	nURXU	5 A	XR;aX RU'gg)Nr2r)	r��popr�r�rMr
rS�appendr�)
r(r'�this_chunksr�r�r��refcount�
parent_chunks�p_linesrs
          r)�_process_one_record�$_MPDiffGenerator._process_one_record�s�����/�/�!��/�/�-�-�c�2�K��"� ���L� ���*�*�*���>�>�!�,���q�=��N�N�&�&�q�)�$(�K�K�O�O�A�$6�M�(0�1��D�N�N�1�%�$(�K�K��N�M�!�1�1�-�@���#�#�G�,��#!�$�+�+�K�8�E��K����s�%�8���.�.� �*�K�K���!r+c�<�UR5upURRUSS5HinURS:Xa+[R
"URUR5eURURURS55 Mk g)N�topologicalTr�r)	r�r��get_record_streamr>r	r�r'r�rU)r(r�r�r�s    r)�_extract_diffs�_MPDiffGenerator._extract_diffs�sy��!%�!7�!7�!9����g�g�/�/��]�D�Q�F��"�"�h�.��/�/��
�
�D�G�G�D�D��$�$�V�Z�Z��1D�1D�Y�1O�P�Rr+c��UR5 URRnURVs/sH
o!"U5PM sn$s snfr")r�r�r�r�)r(�dpop�ks   r)�
compute_diffs�_MPDiffGenerator.compute_diffs�s?�������z�z�~�~��!%�!2�!2�3�!2�A��Q��!2�3�3��3s�A	)	rMr�r�r�r�r�r�r�r�N)r,r-r.r/rCr$r�r�r�r�r�r1r2r+r)r�r�8s&��=��"*&�X
�$+�LQ�4r+r�c�&�\rSrSrSr\S5rSrSrSr	Sr
S!S	jrS
rS"Sjr
SrS#S
jrSrSrSrSrSrSrSr\rSrSrSrSrSrSrSrSrS$Sjr S#Sjr!\"RF\"RH4Sjr%S r&g)%�
VersionedFilei�a�Versioned text file storage.

A versioned file manages versions of line-based text files,
keeping track of the originating version for each line.

To clients the "lines" of the file are represented as a list of
strings. These strings will typically have terminal newline
characters, but this is not required.  In particular files commonly
do not have a newline at the end of the file.

Texts are identified by a version-id string.
c�.�[RU5 gr"��revision�check_not_reserved_id��
version_ids r)r��#VersionedFile.check_not_reserved_id�����&�&�z�2r+c�,�[UR5e)z.Copy this versioned file to name on transport.)�NotImplementedError�copy_to)r(�namers   r)r��VersionedFile.copy_to�s��!�$�,�,�/�/r+c�,�[UR5e)a{Get a stream of records for versions.

:param versions: The versions to include. Each version is a tuple
    (version,).
:param ordering: Either 'unordered' or 'topological'. A topologically
    sorted stream has compression parents strictly before their
    children.
:param include_delta_closure: If True then the closure across any
    compression parents will be included (in the data content of the
    stream, not in the emitted records). This guarantees that
    'fulltext' can be used successfully on every record.
:return: An iterator of ContentFactory objects, each of which is only
    valid until the iterator is advanced.
�r�r�)r(�versions�ordering�include_delta_closures    r)r��VersionedFile.get_record_stream�s��"�$�"8�"8�9�9r+c�,�[UR5e)z#Returns whether version is present.)r��has_version�r(r�s  r)r��VersionedFile.has_version�s��!�$�"2�"2�3�3r+c��[e)z�Insert a record stream into this versioned file.

:param stream: A stream of records to insert.
:return: None
:seealso VersionedFile.get_record_stream:
�r��r(�streams  r)�insert_record_stream�"VersionedFile.insert_record_stream��
��"�!r+Nc	
�R�UR5 URUUUUUUUU5$)a�Add a single text on top of the versioned file.

Must raise RevisionAlreadyPresent if the new version is
already present in file history.

Must raise RevisionNotPresent if any of the given parents are
not present in file history.

:param lines: A list of lines. Each line must be a bytestring. And all
    of them except the last must be terminated with \n and contain no
    other \n's. The last line may either contain no \n's or a single
    terminated \n. If the lines list does meet this constraint the add
    routine may error or may succeed - but you will be unable to read
    the data back accurately. (Checking the lines have been split
    correctly is expensive and extremely unlikely to catch bugs so it
    is not done at runtime unless check_content is True.)
:param parent_texts: An optional dictionary containing the opaque
    representations of some or all of the parents of version_id to
    allow delta optimisations.  VERY IMPORTANT: the texts must be those
    returned by add_lines or data corruption can be caused.
:param left_matching_blocks: a hint about which areas are common
    between the text and its left-hand-parent.  The format is
    the SequenceMatcher.get_matching_blocks format.
:param nostore_sha: Raise ExistingContent and do not add the lines to
    the versioned file if the digest of the lines matches this.
:param random_id: If True a random id has been selected rather than
    an id determined by some deterministic process such as a converter
    from a foreign VCS. When True the backend may choose not to check
    for uniqueness of the resulting key within the versioned file, so
    this should only be done when the result is expected to be unique
    anyway.
:param check_content: If True, the lines supplied are verified to be
    bytestrings that are correctly formed lines.
:return: The text sha1, the number of bytes in the text, and an opaque
         representation of the inserted version which can be provided
         back to future add_lines calls in the parent_texts dictionary.
)�_check_write_ok�
_add_lines�	r(r�r?r�parent_texts�left_matching_blocks�nostore_sha�	random_id�
check_contents	         r)�	add_lines�VersionedFile.add_lines�s:��`	
����������� ����	
�		
r+c	�,�[UR5e)z*Helper to do the class specific add_lines.�r�rr�s	         r)r��VersionedFile._add_lines*s��"�$�.�.�1�1r+c	
�R�UR5 URUUUUUUUU5$)z�Add lines to the versioned file, allowing ghosts to be present.

This takes the same parameters as add_lines and returns the same.
)r��_add_lines_with_ghosts�	r(r�r?rr�r�rrr�s	         r)�add_lines_with_ghosts�#VersionedFile.add_lines_with_ghosts8s;��	
�����*�*�������� �	
�		
r+c	�,�[UR5e)z2Helper to do class specific add_lines_with_ghosts.)r�r
r	s	         r)r�$VersionedFile._add_lines_with_ghostsSs��"�$�"<�"<�=�=r+c�,�[UR5e)z'Check the versioned file for integrity.�r��check�r(�progress_bars  r)r�VersionedFile.checkas��!�$�*�*�-�-r+c�l�UH.n[U[5(aM[R"S5e g�zACheck that lines being added to a versioned file are not unicode.rN)rarbr	�BzrBadParameterUnicode�r(r�lines   r)�_check_lines_not_unicode�&VersionedFile._check_lines_not_unicodees*���D��d�E�*�*��3�3�G�<�<�r+c�T�UH"nSUSS;dM[R"S5e g�z>Check that the lines really are full lines without inline EOL.�
N���r�r	�BzrBadParameterContainsNewliners   r)�_check_lines_are_lines�$VersionedFile._check_lines_are_linesk�+���D���S�b�	�!��;�;�G�D�D�r+c�,�[UR5e)zHGet a text description of the data encoding in this file.

:since: 0.90
)r��get_format_signaturer@s r)r%�"VersionedFile.get_format_signatureqs��
"�$�";�";�<�<r+c���[5nURU5 URU5nUHnURX45 M [URU55n[
[X RU555n/nUH{nXdnX4V	s/sHo�U;dM
XiPM n
n	[U
5S:�aURXJSU5nOSnUR[RRX�U55 M} U$![an[R
"X@5UeSnAff=fs sn	f![an[R
"X@5UeSnAff=f)z0Create multiparent diffs for specified versions.Nr)r�r�r��KeyErrorr	r��dict�zip�_get_lf_split_line_listrJr�r�r�r�r�)r(�version_ids�
knit_versionsr�r��err��targetr�r?r�s            r)�make_mpdiffs�VersionedFile.make_mpdiffsxso����
����[�)��(�(��5�
�%�J�
I��$�$�Z�%;�<�&��D�/�/�
�>�?�
��S��(D�(D�]�(S�T�U����%�J��&�F�	
I�&0�&<��&<��]�@R�H�E�H�&<����7�|�a��%)�%9�%9���
�F�&�"�&*�"��L�L��'�'�2�2�6�DV�W�
�%&�*���7�
I��/�/�
�A�q�H��
I�����
I�
�/�/�
�A�q�H��
I�sG�D�D:�	D5�&D5�.D:�
D2�D-�-D2�5D:�:
E �E�E c��gr"r2�r(r��sourcer/s    r)r��VersionedFile._extract_blocks����r+c
�^�0n[R5m/nUH)upEpgURU5 TRXtU5 M+ [	5nUH!up�pjURU4SjU55 M# [	UR
U55n[X�RU55Hup�TRX�/5 M [UTRU55HruupEpgn
[U5S:Xa<[URSTRUS5R555nOSnUR!UUU
UUS9u nnUX$'Mt UR'U5nUH'unnnn
UUU:wdM[(R*"U5e g!["a UR%UUU
UUS9u nnNjf=f)��Add mpdiffs to this VersionedFile.

Records should be iterables of version, parents, expected_sha1,
mpdiff. mpdiff should be a MultiParent instance.
c3�X># �UHnTRU5(aMUv� M! g7fr"�r���.0r��mpvfs  �r)�	<genexpr>�,VersionedFile.add_mpdiffs.<locals>.<genexpr>��!����!S�Z��t�?O�?O�PQ�?R�!�!�Z���*�	*rrN�r�)r��MultiMemoryVersionedFiler��add_diffr�r�r�r*r+�add_version�
get_line_listrJrR�get_matching_blocks�get_diff�	num_linesr
r�r�	get_sha1sr	�VersionedFileInvalidChecksum)r(�records�
vf_parentsr��version�
parent_ids�_expected_sha1�mpdiff�needed_parents�_version�_mpdiffr��	parent_idrr��_�version_text�sha1s�_parent_ids�
expected_sha1r=s                    @r)�add_mpdiffs�VersionedFile.add_mpdiffs�s�����
��3�3�5����;B�7�G���O�O�G�$��M�M�&�:�6�<C����=D�9�H�.��!�!�!S�Z�!S�S�>E��d�1�1�.�A�B�� #��9�9�/�J�!
��I�
���U�r�2�!
�EH��T�'�'��1�E
�@�9�W�.�5��:��!�#�'+��.�.��4�=�=��A��7�A�A�C��(�$�(,�$�
�%)�%?�%?�����)=�&@�&�"��1�l�"#/�J��;E
�<���x�(��<C�8�G�[�-����g��.��9�9�'�B�B�=D��'�	
�&*�^�^�����)=�&4�&�"��1�l�	
�s�;F�!F=�<F=c�B�SRURU55$)zpReturn version contents as a text string.

Raises RevisionNotPresent if version is not present in
file history.
r+�rQ�	get_linesr�s  r)�get_text�VersionedFile.get_text�s���x�x����z�2�3�3r+c�n�UVs/sH#nSRURU55PM% sn$s snf)z�Return the texts of listed versions as a list of strings.

Raises RevisionNotPresent if version is not present in
file history.
r+r^)r(r,�vs   r)�	get_texts�VersionedFile.get_texts�s/��6A�A�[���������*�+�[�A�A��As�*2c�,�[UR5e)zvReturn version contents as a sequence of lines.

Raises RevisionNotPresent if version is not present in
file history.
)r�r_r�s  r)r_�VersionedFile.get_lines�s��"�$�.�.�1�1r+c�~�URU5Vs/sHn[U5R5PM sn$s snfr")rdrrx)r(r,�ts   r)r+�%VersionedFile._get_lf_split_line_list�s2��04���{�0K�L�0K�1���
�$�$�&�0K�L�L��Ls�#:c�,�[UR5e)z�Return a list of all ancestors of given version(s). This
will not include the null revision.

Must raise RevisionNotPresent if any of the given versions are
not present in file history.
)r��get_ancestry�r(r,s  r)rl�VersionedFile.get_ancestry�s��"�$�"3�"3�4�4r+c�,�[UR5e)aReturn a list of all ancestors of given version(s). This
will not include the null revision.

Must raise RevisionNotPresent if any of the given versions are
not present in file history.

Ghosts that are known about will be included in ancestry list,
but are not explicitly marked.
)r��get_ancestry_with_ghostsrms  r)rp�&VersionedFile.get_ancestry_with_ghostss��"�$�"?�"?�@�@r+c�,�[UR5e)z�Get a map of the parents of version_ids.

:param version_ids: The version ids to look up parents for.
:return: A mapping from version id to parents.
�r�r�rms  r)r��VersionedFile.get_parent_maps��"�$�"5�"5�6�6r+c��[URU/5U5$![an[R"X5UeSnAff=f)z�Return version names for parents of version_id.

Will raise RevisionNotPresent if version_id is not present
in the history.

Ghosts that are known about will be included in the parent list,
but are not explicitly marked.
N)rRr�r(r	r�)r(r�r.s   r)�get_parents_with_ghosts�%VersionedFile.get_parents_with_ghostssJ��	E���+�+�Z�L�9�*�E�F�F���	E��+�+�J�=�1�D��	E�s� �
A�A�Ac�,�[UR5e)z�Return a list of (version-id, line) tuples for version_id.

:raise RevisionNotPresent: If the given version is
not present in file history.
�r��annotater�s  r)rz�VersionedFile.annotate$s��"�$�-�-�0�0r+c�,�[UR5e)a�Iterate over the lines in the versioned file from version_ids.

This may return lines from other versions. Each item the returned
iterator yields is a tuple of a line and a text version that that line
is present in (not introduced in).

Ordering of results is in whatever order is most suitable for the
underlying storage format.

If a progress bar is supplied, it may be used to indicate progress.
The caller is responsible for cleaning up progress bars (because this
is an iterator).

NOTES: Lines are normalised: they will all have \n terminators.
       Lines are returned in arbitrary order.

:return: An iterator over (line, version_id).
)r��'iter_lines_added_or_present_in_versions)r(r,�pbs   r)r}�5VersionedFile.iter_lines_added_or_present_in_versions,s��&"�$�"N�"N�O�Or+c�4�[[R5e)aReturn pseudo-annotation indicating how the two versions merge.

This is computed between versions a and b and their common
base.

Weave lines present in none of them are skipped entirely.

Legend:
killed-base Dead in base revision
killed-both Killed in each revision
killed-a    Killed in a
killed-b    Killed in b
unchanged   Alive in both a and b (possibly created in both)
new-a       Created in a
new-b       Created in b
ghost-a     Killed in a, unborn in b
ghost-b     Killed in b, unborn in a
irrelevant  Not in either revision
)r�r��
plan_merge)r(�ver_a�ver_b�bases    r)r��VersionedFile.plan_mergeAs��("�-�":�":�;�;r+c�<�[XU5R5S$�Nr)�PlanWeaveMerge�merge_lines�r(�plan�a_marker�b_markers    r)�weave_merge�VersionedFile.weave_mergeWs���d�h�7�C�C�E�a�H�Hr+r2�NNNFT)NNFTNr"r|)'r,r-r.r/rC�staticmethodr�r�r�r�r�rr�r
rrrr!r%r0r�r[r`�
get_stringrdr_r+rlrpr�rvrzr}r�r�A_MARKER�B_MARKERr�r1r2r+r)r�r��s�����3��3�0�:�"4�"��!����:
�x2�&����!�
�6>�.�=�E�=�'�R�6C�p4��J�B�2�M�5�
A�7�E�1�P�*<�.'�/�/�)�:L�:L�Ir+r�c�n�\rSrSrSrSrSSjrSSjrSrSr	S	r
S
rSSjrSr
S
rg)� RecordingVersionedFilesDecoratori]z�A minimal versioned files that records calls made on it.

Only enough methods have been added to support tests using it to date.

:ivar calls: A list of the calls made; can be reset at any time by
    assigning [] to it.
c��Xl/Ulg)zCreate a RecordingVersionedFilesDecorator decorating backing_vf.

:param backing_vf: The versioned file to answer all methods.
N��_backing_vf�calls)r(�
backing_vfs  r)r$�)RecordingVersionedFilesDecorator.__init__fs��
&����
r+Nc	��URRSUUUUUUUU4	5 URRUUUUUUUU5$)Nr)r�r�r�r�	r(r'r?rr�r�r�rrs	         r)r�*RecordingVersionedFilesDecorator.add_linesnsi��	
�
�
��������$����

�	
����)�)����� ����	
�		
r+c	��URRSUUUUUU45 URRUUUUUU5$)N�add_content)r�r�r�r��r(�factoryr�r�r�rrs       r)r��,RecordingVersionedFilesDecorator.add_content�s]��	
�
�
������$����
�
	
����+�+��� ����

�	
r+c�8�URR5 gr")r�rr@s r)r�&RecordingVersionedFilesDecorator.check�s������� r+c��URRS[U545 URR	U5$)Nr�)r�r�rr�r��r(r�s  r)r��/RecordingVersionedFilesDecorator.get_parent_map�s5���
�
���+�T�$�Z�8�9����.�.�t�4�4r+c��URRS[U5X#45 URR	XU5$)Nr�)r�r�rRr�r�)r(r��
sort_orderr�s    r)r��2RecordingVersionedFilesDecorator.get_record_stream�sC���
�
���
 �$�t�*�j�P�	
����1�1��3�
�	
r+c��URRS[U545 URR	U5$)NrJ)r�r�rr�rJr�s  r)rJ�*RecordingVersionedFilesDecorator.get_sha1s�s4���
�
���;��T�
�3�4����)�)�$�/�/r+c��URRS[U545 URR	XS9$)N�#iter_lines_added_or_present_in_keys)r~)r�r�rr�r��r(r�r~s   r)r��DRecordingVersionedFilesDecorator.iter_lines_added_or_present_in_keys�s8���
�
���@�$�t�*�M�N����C�C�D�C�P�Pr+c�l�URRS5 URR5$)N)r�)r�r�r�r�r@s r)r��%RecordingVersionedFilesDecorator.keys�s)���
�
���)�$����$�$�&�&r+r�r�r")r,r-r.r/rCr$rr�rr�r�rJr�r�r1r2r+r)r�r�]sX�����!����!
�L�!����
�:!�5�
�0�Q�'r+r�c�$�\rSrSrSrSrSrSrg)�OrderingVersionedFilesDecoratori�z�A VF that records calls, and returns keys in specific order.

:ivar calls: A list of the calls made; can be reset at any time by
    assigning [] to it.
c�:�[RX5 X lg)a�Create a RecordingVersionedFilesDecorator decorating backing_vf.

:param backing_vf: The versioned file to answer all methods.
:param key_priority: A dictionary defining what order keys should be
    returned from an 'unordered' get_record_stream request.
    Keys with lower priority are returned first, keys not present in
    the map get an implicit priority of 0, and are returned in
    lexicographical order.
N)r�r$�
_key_priority)r(r��key_prioritys   r)r$�(OrderingVersionedFilesDecorator.__init__�s��	)�1�1�$�C�)�r+c#�2^# �TRRS[U5X#45 US:Xa=U4Sjn[XS9H)nTRRU/SU5Shv�N M+ gTRRXU5Shv�N gN.N7f)Nr��	unorderedc�@>�TRRUS5U4$r�)r��get)r'r(s �r)�sort_key�COrderingVersionedFilesDecorator.get_record_stream.<locals>.sort_key�s!����*�*�.�.�s�A�6��<�<r+)r')r�r�rR�sortedr�r�)r(r�r�r�r�r's`     r)r��1OrderingVersionedFilesDecorator.get_record_stream�s������
�
���
 �$�t�*�j�P�	
���$�
=�
�d�1���+�+�=�=��E�;�(=����2�
�'�'�9�9��"7��
�
�	�
�s$�A!B�$B�%(B�
B�B�B)r�N)r,r-r.r/rCr$r�r1r2r+r)r�r��s���*�r+r�c�$�\rSrSrSrSrSrSrg)�	KeyMapperi�z?KeyMappers map between keys and underlying partitioned storage.c�,�[UR5e)z�Map key to an underlying storage identifier.

:param key: A key tuple e.g. (b'file-id', b'revision-id').
:return: An underlying storage identifier, specific to the partitioning
    mechanism.
)r�rIr�s  r)rI�
KeyMapper.map�s��"�$�(�(�+�+r+c�,�[UR5e)z�Map a partitioned storage id back to a key prefix.

:param partition_id: The underlying partition id.
:return: As much of a key (or prefix) as is derivable from the partition
    id.
)r��unmap�r(�partition_ids  r)r��KeyMapper.unmap�s��"�$�*�*�-�-r+r2N�r,r-r.r/rCrIr�r1r2r+r)r�r��s��I�,�.r+r�c�$�\rSrSrSrSrSrSrg)�ConstantMapperi	z,A key mapper that maps to a constant result.c��Xlg)z>Create a ConstantMapper which will return result for all maps.N��_result)r(�results  r)r$�ConstantMapper.__init__s���r+c��UR$��See KeyMapper.map().r�r�s  r)rI�ConstantMapper.maps���|�|�r+r�N)r,r-r.r/rCr$rIr1r2r+r)r�r�	s��6��r+r�c�$�\rSrSrSrSrSrSrg)�URLEscapeMapperiz�Base class for use with transport backed storage.

This provides a map and unmap wrapper that respectively url escape and
unescape their outputs and inputs.
c�J�[RURU55$r�)�urlutils�quote�_mapr�s  r)rI�URLEscapeMapper.maps���~�~�d�i�i��n�-�-r+c�J�UR[RU55$)�See KeyMapper.unmap().)�_unmapr��unquoter�s  r)r��URLEscapeMapper.unmap s���{�{�8�+�+�L�9�:�:r+r2Nr�r2r+r)r�r�s���.�;r+r�c�$�\rSrSrSrSrSrSrg)�PrefixMapperi%zqA key mapper that extracts the first component of a key.

This mapper is for use with a transport based backend.
c�*�USRS5$)r�r�utf-8)�decoder�s  r)r��PrefixMapper._map+s���1�v�}�}�W�%�%r+c�&�URS54$�r�r�)�encoder�s  r)r��PrefixMapper._unmap/s���#�#�G�,�.�.r+r2N)r,r-r.r/rCr�r�r1r2r+r)r�r�%s���
&�/r+r�c�0�\rSrSrSrSrSrSrSrSr	g)	�HashPrefixMapperi4z}A key mapper that combines the first component of a key with a hash.

This mapper is for use with a transport based backend.
c��URUS5nSR[U5S-URS55$)r�rz	{:02x}/{}rr�)�_escaper�rr�)r(r'�prefixs   r)r��HashPrefixMapper._map:s9�����c�!�f�%���!�!�'�&�/�D�"8�&�-�-��:P�Q�Qr+c��U$)zNo escaping needed here.r2)r(r�s  r)r��HashPrefixMapper._escape?s���
r+c�l�UR[R"U55RS54$r�)�	_unescaper
�basenamer�r�s  r)r��HashPrefixMapper._unmapCs*�����w�/�/��=�>�E�E�g�N�P�Pr+c��U$)z*No unescaping needed for HashPrefixMapper.r2�r(r�s  r)r��HashPrefixMapper._unescapeGs���r+r2N)
r,r-r.r/rCr�r�r�r�r1r2r+r)r�r�4s���
R�
�Q�r+r�c�4�\rSrSrSr\"S5rSrSrSr	g)�HashEscapedPrefixMapperiLzsCombines the escaped first component of a key with a hash.

This mapper is for use with a transport based backend.
s)abcdefghijklmnopqrstuvwxyz0123456789-_@,.c���[U5Vs/sH;nX R;=(a [U5=(d SRU5PM= nnSR	U5RS5$s snf)z�Turn a key element into a filesystem safe string.

This is similar to a plain urlutils.quote, except
it uses specific safe characters, so that it doesn't
have to translate a lot of valid file ids.
z%{:02x}��ascii)�	bytearray�_safe�chrr�rQr�)r(r��c�rs    r)r��HashEscapedPrefixMapper._escapeTsk���v�&�
�&���:�:�o�
)�3�q�6�C�y�/?�/?��/B�C�&�	
�
��w�w�q�z� � ��)�)��	
s�AA2c�,�[RU5$)z/Escaped names are easily unescaped by urlutils.)r�r�r�s  r)r��!HashEscapedPrefixMapper._unescapeds������)�)r+r2N)
r,r-r.r/rCrrr�r�r1r2r+r)r�r�Ls���

�B�C�E�*� *r+r�c�^^�UU4SjnU$)z�Create a ThunkedVersionedFiles factory.

This will create a callable which when called creates a
ThunkedVersionedFiles on a transport, using mapper to access individual
versioned files, and versioned_file_factory to create each individual file.
c�">�[UTTS5$)Nc��g)NTr2r2r+r)�<lambda>�?make_versioned_files_factory.<locals>.factory.<locals>.<lambda>ss��tr+)�ThunkedVersionedFiles)r�mapper�versioned_file_factorys ��r)r��-make_versioned_files_factory.<locals>.factoryqs���$��-�v�|�
�	
r+r2)rrr�s`` r)�make_versioned_files_factoryris���
�
�Nr+c���\rSrSrSrSSjrSSjrSrSrSSjr	\
S	5rS
rSr
SrS
rSrSrSr\R(rSrSrSSjrSrSrSr\R8rSrSrSr g)�VersionedFilesiya�Storage for many versioned files.

This object allows a single keyspace for accessing the history graph and
contents of named bytestrings.

Currently no implementation allows the graph of different key prefixes to
intersect, but the API does allow such implementations in the future.

The keyspace is expressed via simple tuples. Any instance of VersionedFiles
may have a different length key-size, but that size will be constant for
all texts added to or retrieved from it. For instance, breezy uses
instances with a key-size of 2 for storing user files in a repository, with
the first element the fileid, and the second the version of that file.

The use of tuples allows a single code base to support several different
uses with only the mapping logic changing from instance to instance.

:ivar _immediate_fallback_vfs: For subclasses that support stacking,
    this is a list of other VersionedFiles immediately underneath this
    one.  They may in turn each have further fallbacks.
Nc	�,�[UR5e)a�Add a text to the store.

:param key: The key tuple of the text to add. If the last element is
    None, a CHK string will be generated during the addition.
:param parents: The parents key tuples of the text to add.
:param lines: A list of lines. Each line must be a bytestring. And all
    of them except the last must be terminated with \n and contain no
    other \n's. The last line may either contain no \n's or a single
    terminating \n. If the lines list does meet this constraint the add
    routine may error or may succeed - but you will be unable to read
    the data back accurately. (Checking the lines have been split
    correctly is expensive and extremely unlikely to catch bugs so it
    is not done at runtime unless check_content is True.)
:param parent_texts: An optional dictionary containing the opaque
    representations of some or all of the parents of version_id to
    allow delta optimisations.  VERY IMPORTANT: the texts must be those
    returned by add_lines or data corruption can be caused.
:param left_matching_blocks: a hint about which areas are common
    between the text and its left-hand-parent.  The format is
    the SequenceMatcher.get_matching_blocks format.
:param nostore_sha: Raise ExistingContent and do not add the lines to
    the versioned file if the digest of the lines matches this.
:param random_id: If True a random id has been selected rather than
    an id determined by some deterministic process such as a converter
    from a foreign VCS. When True the backend may choose not to check
    for uniqueness of the resulting key within the versioned file, so
    this should only be done when the result is expected to be unique
    anyway.
:param check_content: If True, the lines supplied are verified to be
    bytestrings that are correctly formed lines.
:return: The text sha1, the number of bytes in the text, and an opaque
         representation of the inserted version which can be provided
         back to future add_lines calls in the parent_texts dictionary.
rr�s	         r)r�VersionedFiles.add_lines�s��Z"�$�.�.�1�1r+c�,�[UR5e)aAdd a text to the store from a chunk iterable.

:param key: The key tuple of the text to add. If the last element is
    None, a CHK string will be generated during the addition.
:param parents: The parents key tuples of the text to add.
:param chunk_iter: An iterable over bytestrings.
:param parent_texts: An optional dictionary containing the opaque
    representations of some or all of the parents of version_id to
    allow delta optimisations.  VERY IMPORTANT: the texts must be those
    returned by add_lines or data corruption can be caused.
:param left_matching_blocks: a hint about which areas are common
    between the text and its left-hand-parent.  The format is
    the SequenceMatcher.get_matching_blocks format.
:param nostore_sha: Raise ExistingContent and do not add the lines to
    the versioned file if the digest of the lines matches this.
:param random_id: If True a random id has been selected rather than
    an id determined by some deterministic process such as a converter
    from a foreign VCS. When True the backend may choose not to check
    for uniqueness of the resulting key within the versioned file, so
    this should only be done when the result is expected to be unique
    anyway.
:param check_content: If True, the lines supplied are verified to be
    bytestrings that are correctly formed lines.
:return: The text sha1, the number of bytes in the text, and an opaque
         representation of the inserted version which can be provided
         back to future add_lines calls in the parent_texts dictionary.
)r�r�r�s       r)r��VersionedFiles.add_content�s��H"�$�"2�"2�3�3r+c
�^�0n[R5m/nUH)upEpgURU5 TRXtU5 M+ [	5nUH!up�pjURU4SjU55 M# UR
USS5HAnURS:XaMTRURS5UR/5 MC [UTRU55H�uup�p�n[U
5S:Xa<[URSTR!U
S5R#555nOSnUR%UU
UUUS	9unnnUU:wa[&R("W5eUX,'M� g)
r8c3�X># �UHnTRU5(aMUv� M! g7fr"r:r;s  �r)r>�-VersionedFiles.add_mpdiffs.<locals>.<genexpr>�r@rAr�Tr�rrrNrB)r�rCr�rDr�r�r�r>rErUr'r*rFrJrRrGrHrIrr	rK)r(rLrMr�rNrOrPrQrRrSrTr�r'r�rZrr��version_sha1rVrWr=s                    @r)r[�VersionedFiles.add_mpdiffs�s�����
��3�3�5����;B�7�G���O�O�G�$��M�M�&�:�6�<C����=D�9�H�.��!�!�!S�Z�!S�S�>E��,�,�^�[�$�O�F��"�"�h�.�����V�0�0��9�6�:�:�r�J�P�AD��T�'�'��1�A
�<�5�S�}�u��;��1�$�'+��.�.��4�=�=��Q��8�B�B�D��(�$�(,�$�,0�N�N�����%9�-;�-�)�L�!�\��}�,��9�9�'�B�B�*�J�O�)A
r+c�,�[UR5e)�xReturn a list of (version-key, line) tuples for the text of key.

:raise RevisionNotPresent: If the key is not present.
ryr�s  r)rz�VersionedFiles.annotates��
"�$�-�-�0�0r+c�,�[UR5e)a�Check this object for integrity.

:param progress_bar: A progress bar to output as the check progresses.
:param keys: Specific keys within the VersionedFiles to check. When
    this parameter is not None, check() becomes a generator as per
    get_record_stream. The difference to get_record_stream is that
    more or deeper checks will be performed.
:return: None, or if keys was supplied a generator as per
    get_record_stream.
rrs  r)r�VersionedFiles.checks��"�$�*�*�-�-r+c�.�[RU5 gr"r�r�s r)r��$VersionedFiles.check_not_reserved_id$r�r+c��g)z�Clear whatever caches this VersionedFile holds.

This is generally called after an operation has been performed, when we
don't expect to be using this versioned file again soon.
Nr2r@s r)�clear_cache�VersionedFiles.clear_cache(s�r+c�h�UH,nUR[LdM[R"S5e gr)�	__class__rbr	rrs   r)r�'VersionedFiles._check_lines_not_unicode/s)���D��~�~�U�*��3�3�G�<�<�r+c�T�UH"nSUSS;dM[R"S5e grrrs   r)r!�%VersionedFiles._check_lines_are_lines5r#r+c�>�[U5n0nU(arURU5nURU5 [[RRUR
555nURU5 U(aMr[R"U5nU$�z4Get a KnownGraph instance with the ancestry of keys.)
r�r�r��	itertools�chain�
from_iterable�valuesr��
_mod_graph�
KnownGraph)r(r��pendingr��this_parent_map�kgs      r)�get_known_graph_ancestry�'VersionedFiles.get_known_graph_ancestry;s����d�)���
��"�1�1�'�:�O����o�.��)�/�/�7�7��8N�8N�8P�Q�R�G��%�%�j�1�	�g�
�
"�
"�:�
.���	r+c�,�[UR5e)��Get a map of the parents of keys.

:param keys: The keys to look up parents for.
:return: A mapping from keys to parents. Absent keys are absent from
    the mapping.
rsr�s  r)r��VersionedFiles.get_parent_mapHs��"�$�"5�"5�6�6r+c�,�[UR5e)a�Get a stream of records for keys.

:param keys: The keys to include.
:param ordering: Either 'unordered' or 'topological'. A topologically
    sorted stream has compression parents strictly before their
    children.
:param include_delta_closure: If True then the closure across any
    compression parents will be included (in the opaque data).
:return: An iterator of ContentFactory objects, each of which is only
    valid until the iterator is advanced.
r�)r(r�r�r�s    r)r�� VersionedFiles.get_record_streamQs��"�$�"8�"8�9�9r+c�,�[UR5e)z�Get the sha1's of the texts for the given keys.

:param keys: The names of the keys to lookup
:return: a dict from key to sha1 digest. Keys of texts which are not
    present in the store are not present in the returned
    dictionary.
)r�rJr�s  r)rJ�VersionedFiles.get_sha1s_s��"�$�.�.�1�1r+c�,�[UR5e)a�Return an iterable of keys of missing compression parents.

Check this after calling insert_record_stream to find out if there are
any missing compression parents.  If there are, the records that
depend on them are not able to be inserted safely. The precise
behaviour depends on the concrete VersionedFiles class in use.

Classes that do not support this will raise NotImplementedError.
)r��#get_missing_compression_parent_keysr@s r)rC�2VersionedFiles.get_missing_compression_parent_keysks��"�$�"J�"J�K�Kr+c��[e)��Insert a record stream into this container.

:param stream: A stream of records to insert.
:return: None
:seealso VersionedFile.get_record_stream:
r�r�s  r)r��#VersionedFiles.insert_record_streamwr�r+c�,�[UR5e)�Iterate over the lines in the versioned files from keys.

This may return lines from other keys. Each item the returned
iterator yields is a tuple of a line and a text version that that line
is present in (not introduced in).

Ordering of results is in whatever order is most suitable for the
underlying storage format.

If a progress bar is supplied, it may be used to indicate progress.
The caller is responsible for cleaning up progress bars (because this
is an iterator).

Notes:
 * Lines are normalised by the underlying store: they will all have \n
   terminators.
 * Lines are returned in arbitrary order.

:return: An iterator over (line, key).
)r�r�r�s   r)r��2VersionedFiles.iter_lines_added_or_present_in_keys�s��*"�$�"J�"J�K�Kr+c�,�[UR5e)z:Return a iterable of the keys for all the contained texts.)r�r�r@s r)r��VersionedFiles.keys�s��!�$�)�)�,�,r+c�8�[X5nUR5$)z,Create multiparent diffs for specified keys.)r�r�)r(r��	generators   r)r0�VersionedFiles.make_mpdiffs�s��$�T�0�	��&�&�(�(r+c��SSKJn U"U5$)Nr)�	Annotator)rzrQ)r(rQs  r)�
get_annotator�VersionedFiles.get_annotator�s��(����r+c��gr"r2r3s    r)r��VersionedFiles._extract_blocks�r6r+c��/nURH3nURU5 URUR55 M5 U$)z�Return the whole stack of fallback versionedfiles.

This VersionedFiles may have a list of fallbacks, but it doesn't
necessarily know about the whole stack going down, and it can't know
at open time because they may change after the objects are opened.
)�_immediate_fallback_vfsr��extend�_transitive_fallbacks)r(�
all_fallbacks�a_vfss   r)rY�$VersionedFiles._transitive_fallbacks�sF���
��1�1�E�� � ��'�� � ��!<�!<�!>�?�2��r+r2r�r")!r,r-r.r/rCrr�r[rzrr�r�r'rr!r9r�r�rJr�_has_key_from_parent_map�__contains__rCr�r�r�r0rR�_missing_keys_from_parent_mapr�r�rYr1r2r+r)rrys����6�!����-2�d�!����$4�L)+�V1�.��3��3��=�E��7�:�2��1�1�L�
L�"�L�.-�)�
�
�6�6�L��r+rc��\rSrSrSrSrSSjrSSjrSrSSjr	S	r
S
rSrSr
S
rSrSrSrSSjrSrSrSrg)ri�aAStorage for many versioned files thunked onto a 'VersionedFile' class.

This object allows a single keyspace for accessing the history graph and
contents of named bytestrings.

Currently no implementation allows the graph of different key prefixes to
intersect, but the API does allow such implementations in the future.
c�4�XlX lX0lX@lg)zCreate a ThunkedVersionedFiles.N)�
_transport�
_file_factory�_mapper�
_is_locked)r(r�file_factoryr�	is_lockeds     r)r$�ThunkedVersionedFiles.__init__�s��#��)����#�r+Nc�x�URS5nURURURUUUUUSS9$)z!See VersionedFiles.add_content().rT�r�r�r�rr)rUrr'r?)r(r�r�r�r�rrs       r)r��!ThunkedVersionedFiles.add_content�sJ���$�$�W�-���~�~��K�K��O�O��%�!5�#����	
�		
r+c	
�"�URRU5n	USn
UVs/sHo�SPM	 nnURU	5nURU
UUUUUUUS9$s snf![a URU
UUUUUUUS9s$f=f![Raq URR[R"U	55 URU
UUUUUUUS9s$![a URU
UUUUUUUS9ss$f=ff=f)zSee VersionedFiles.add_lines().rrj)rdrI�_get_vfr
r�r�_mod_transport�
NoSuchFilerb�mkdirr
�dirname)
r(r'r?rr�r�r�rr�pathr��parentr�s
             r)r�ThunkedVersionedFiles.add_lines�sh���|�|����$����W�
�,3�4�G�&�"�:�G��4�
�\�\�$�
��/	�
��/�/����!-�)=� +�'�"/�0�	�	��	5��'�

��|�|����!-�)=� +�'�"/�$�	�	�

���(�(�	��O�O�!�!�'�/�/�$�"7�8�
��/�/����!-�)=� +�'�"/�0�	�	��'�

��|�|����!-�)=� +�'�"/�$�	�	�

��	�sN�A�A#�# B�B	�B�B	�	AD�
C%�"D�% D
�D�	D
�
Dc���USSnURRU5nURU5nURUS5n/nUHupxUR	X'4-U45 M U$)r Nr)rdrIrmrzr�)	r(r'r�rrr��originsr��originrs	         r)rz�ThunkedVersionedFiles.annotateso��
�S�b����|�|����'��
�\�\�$�
���+�+�c�"�g�&����#�L�F��M�M�6�I�-�t�4�5�$��
r+c��UR5Hup4UR5 M UbURUSS5$g)zSee VersionedFiles.check().Nr�T)�_iter_all_componentsrr�)r(rr��_prefixr�s     r)r�ThunkedVersionedFiles.check-sB��
 �4�4�6�K�G��H�H�J�7����)�)�$��T�B�B�r+c�F^
�URU5n0nUR5Hxum
nURRT
5nUR	U5nURU5nUR5H!up�[
U
4SjU	55UT
U4-'M# Mz U$)r<c3�0># �UHnTU4-v� M
 g7fr"r2�r<rsr�s  �r)r>�7ThunkedVersionedFiles.get_parent_map.<locals>.<genexpr>Es����0�5<�6�F�f�Y�&�W�s�)�_partition_keysr�rdrIrmr�r�)r(r��prefixesr��suffixesrrr�r�r'r?r�s          @r)r��$ThunkedVersionedFiles.get_parent_map7s�����'�'��-���� (��� 0��F�H��<�<�#�#�F�+�D����d�#�B��*�*�8�4�J� *� 0� 0� 2���*/�0�5<�0�+��v����'�!3�	!1��
r+c��UR5(d[R"U5eURXRSSS9$)NTc��gr"r2r2r+r)r
�/ThunkedVersionedFiles._get_vf.<locals>.<lambda>Ns��$r+)�create�	get_scope)rer	�ObjectNotLockedrcrb)r(rrs  r)rm�ThunkedVersionedFiles._get_vfJsC����� � ��(�(��.�.��!�!��/�/�$�,�"�
�	
r+c�n�0nUH,nURUSS/5nURUS5 M. U$)z,Turn keys into a dict of prefix:suffix_list.Nr)r�r�)r(r�r�r'�prefix_keyss     r)r��%ThunkedVersionedFiles._partition_keysQsB�����C� �+�+�C���H�b�9�K����s�2�w�'���
r+c���[UR[5(a URRS5/nS/nO�[	5nUR
R
5H5n[RRU5upVURU5 M7 [U5nUVs/sHoPRRU5PM nn[X5$s snfr�)rardr�rIr�rb�iter_files_recursive�osrr�splitext�addrRr�r*)r(�pathsr��relpaths�quoted_relpathrr�exts       r)�_iter_all_prefixes�(ThunkedVersionedFiles._iter_all_prefixesYs����d�l�l�N�3�3��\�\�%�%�b�)�*�E��t�H��u�H�"&�/�/�"F�"F�"H���G�G�,�,�^�<�	�����T�"�#I���N�E�=B�C�U�T���*�*�4�0�U�H�C��5�#�#��Ds�,$Cc#�L^# �[U5nURU5HzumpEUVs/sHof4PM nnURXBU5HLnURb$[	U4SjUR55UlTUR
-UlUv� MN M| gs snf7f)z'See VersionedFiles.get_record_stream().Nc3�.># �UH
nTU-v� M g7fr"r2rs  �r)r>�:ThunkedVersionedFiles.get_record_stream.<locals>.<genexpr>ss����*X��v�6�F�?��s�)r��
_iter_keys_vfr�r?r�r')	r(r�r�r�r�r��suffixr�r�s	        @r)r��'ThunkedVersionedFiles.get_record_streamhs������d�|��$(�$6�$6�t�$<� �F�H�08�9��f�	��H�9��.�.��$9����>�>�-�%*�*X����*X�%X�F�N�#�f�j�j�0��
���
�%=��9�s�'B$�B�A.B$c#��# �URU5nUR5H7up4URRU5nUR	U5nX4U4v� M9 g7fr")r�r�rdrIrm)r(r�r�r�r�rrr�s       r)r��#ThunkedVersionedFiles._iter_keys_vfwsV����'�'��-�� (��� 0��F��<�<�#�#�F�+�D����d�#�B��B�&�&�!1�s�AA c��0nURU5H7up4nURU5nUR5HupxX�X74-'M M9 U$)zSee VersionedFiles.get_sha1s().)r�rJr�)	r(r�rXr�r�r��vf_sha1sr�r<s	         r)rJ�ThunkedVersionedFiles.get_sha1s~sV����$(�$6�$6�t�$<� �F�b��|�|�H�-�H� (��� 0���,0�f�y�(�)�!1�%=��r+c�L�UH�nURSSnURSSnURbURVs/sHoUSSPM	 nnOSn[XFU5nURR	U5nURU5n	U	R
U/5 M� gs snf)rFNr)r'r?r�rdrIrmr�)
r(r�r�r�r'rsr?�thunk_recordrrr�s
          r)r��*ThunkedVersionedFiles.insert_record_stream�s����F��Z�Z���_�F��*�*�R�S�/�C��~�~�)�5;�^�^�D�^�6�"�#�;�^��D����)�#��?�L��<�<�#�#�F�+�D����d�#�B��#�#�\�N�3���Es�B!c#�# �URU5H)up4nURU5HupgXcU4-4v� M M+ g7f)rIN)r�r})r(r�r~r�r�r�rrNs        r)r��9ThunkedVersionedFiles.iter_lines_added_or_present_in_keys�sI���*%)�$6�$6�t�$<� �F�b�!#�!K�!K�H�!U�
���g�Z�/�/�/�"V�%=�s�AAc#�f# �UR5HupX RU54v� M g7fr")r�rm)r(rrr�s   r)rz�*ThunkedVersionedFiles._iter_all_components�s,��� �3�3�5�L�D��,�,�t�,�,�,�6�s�/1c��[5nUR5H0up#UR5HnURX$4-5 M M2 U$)zSee VersionedFiles.keys().)r�rzr�r�)r(r�r�r�r�s     r)r��ThunkedVersionedFiles.keys�sF������3�3�5�J�F��+�+�-���
�
�6�I�-�.�(�6��
r+)rcrerdrb)NNNFr�r|r")r,r-r.r/rCr$r�rrzrr�rmr�r�r�r�rJr�r�rzr�r1r2r+r)rr�sx���$��!���

�4�!����?�B�C��&
��
$�
�'��4�,0�2-�r+rc�&�\rSrSrSrSrSrSrg)�VersionedFilesWithFallbacksi�c�,�[UR5e)z?Return a clone of this object without any fallbacks configured.)r��without_fallbacksr@s r)r��-VersionedFilesWithFallbacks.without_fallbacks�s��!�$�"8�"8�9�9r+c�,�[UR5e)znAdd a source of texts for texts not present in this knit.

:param a_versioned_files: A VersionedFiles object.
)r��add_fallback_versioned_files)r(�a_versioned_filess  r)r��8VersionedFilesWithFallbacks.add_fallback_versioned_files�s��
"�$�"C�"C�D�Dr+c��URRU5up#UR5H<nU(d O4URRU5upVURU5 UnM> [R
"U5nU$r/)�_index�
find_ancestryrYr�r4r5)r(r�r�r��fallback�f_parent_map�f_missing_keysr8s        r)r9�4VersionedFilesWithFallbacks.get_known_graph_ancestry�ss��#'�;�;�#<�#<�T�#B� �
��2�2�4�H���-5�_�_�-J�-J�<�-X�*�\����l�+�)�L�5��
"�
"�:�
.���	r+r2N)r,r-r.r/r�r�r9r1r2r+r)r�r��s��:�E�
r+r�c�J�\rSrSrSrSrSSjrSSjrSrSr	S	r
S
rSrg)
�_PlanMergeVersionedFilei�a�A VersionedFile for uncommitted and committed texts.

It is intended to allow merges to be planned with working tree texts.
It implements only the small part of the VersionedFiles interface used by
PlanMerge.  It falls back to multiple versionedfiles for data not stored in
_PlanMergeVersionedFile itself.

:ivar: fallback_versionedfiles a list of VersionedFiles objects that can be
    queried for missing texts.
c��Xl/Ul0Ul0Ul[R
"UR5/Ulg)z~Create a _PlanMergeVersionedFile.

:param file_id: Used with _PlanMerge code which is not yet fully
    tuple-keyspace aware.
N)�_file_id�fallback_versionedfiles�_parents�_linesr4�DictParentsProvider�
_providers)r(�file_ids  r)r$� _PlanMergeVersionedFile.__init__�s8�� �
�')��$���
����%�9�9�$�-�-�H�I��r+Nc�&�SSKJn Uc"U"XXR45R5$[	U"XXR45R55n[	U"XXR45R55nURXV5$)zSee VersionedFile.plan_merge.r)�
_PlanMerge)�merger�r�r�rR�_subtract_plans)r(r�r�r�r��old_plan�new_plans       r)r��"_PlanMergeVersionedFile.plan_merge�sz��&��<��e�D�=�=�2B�C�N�N�P�P��
�5��}�}�6F�G�R�R�T�U���
�5��
�
�7G�H�S�S�U�V���)�)�(�=�=r+c��SSKJn [R"U5nU"XXR4U5R5nUcU$U"XXR4U5R5nUR
[U5[U55$)Nr)�
_PlanLCAMerge)r�r�r4�Graphr�r�r�rR)r(r�r�r�r�rr�r�s        r)�plan_lca_merge�&_PlanMergeVersionedFile.plan_lca_merges���)�� � ��&�� ��$��� 0�%�
�
�*�,�	��<��O� ���
�
�/��
�
�*�,�	��,�,�T�(�^�T�(�^�L�Lr+c�n�URURURURS55$)Nr)rr'r?rU)r(r�s  r)r��#_PlanMergeVersionedFile.add_contents-���~�~��K�K����'�*>�*>�w�*G�
�	
r+c��[U[5(d[U5e[R	US5(d[S5eUc[S5eUc[S5e[U5URU'X0RU'g)z�See VersionedFiles.add_lines.

Lines are added locally, not to fallback versionedfiles.  Also, ghosts
are permitted.  Only reserved ids are permitted.
rzOnly reserved ids may be usedNzParents may not be NonezLines may not be None)rar�rcr��is_reserved_idr�r�r�)r(r'r?rs    r)r�!_PlanMergeVersionedFile.add_liness|���#�u�%�%��C�.� ��&�&�s�2�w�/�/��<�=�=��?��6�7�7��=��4�5�5�"�7�^��
�
�c�� ���C�r+c	#��# �[U5nUHQnXPR;dMURUnURUnURU5 [	XWSUSS9v� MS UR
HWnUR
USS5H4n	U	RS:XaMURU	R5 U	v� M6 U(aMW g UHn[U5v� M g7f)NT)rNr�r�)
r�r�r��removerEr�r�r>r'r~)
r(r�r�r�r6r'rr?�
versionedfiler�s
          r)r��)_PlanMergeVersionedFile.get_record_stream&s�����d�)���C��k�k�!����C�(���-�-��,�����s�#�+��$������"�9�9�M�'�9�9�'�;�PT�U���&�&�(�2���N�N�6�:�:�.� �L�V��7��:��C�&�s�+�+��s�C#�B C#�C#c���[U5n0n[RU;a2UR[R5 SU[R'URSSUR
-UlUR
[R"UR5RU55 UR5H up4US:XdM
[R4X#'M" U$)�"See VersionedFiles.get_parent_map.r2Nr)r�r��
NULL_REVISIONr�r�r�r�r4�StackedParentsProviderr�r�)r(r�r�r'r?s     r)r��&_PlanMergeVersionedFile.get_parent_map=s���
�4�y�����!�!�T�)��K�K��.�.�/�-/�F�8�)�)�*��/�/�"�1�-��0L�0L�L����
�
��-�-�d�o�o�>�M�M�d�S�	
�#�L�L�N�L�C��"�}�'�5�5�7���+��
r+)r�r�r�r�r�r")
r,r-r.r/rCr$r�r�r�rr�r�r1r2r+r)r�r��s,��	�J� >�M�
�
!�",�.r+r�c�Z�\rSrSrSr\R\R4SjrSr	Sr
Srg)r�iQz�Weave merge that takes a plan as its input.

This exists so that VersionedFile.plan_merge is implementable.
Most callers will want to use WeaveMerge instead.
c�R�[R"XU5 [U5Ulgr")rr$rRr�r�s    r)r$�PlanWeaveMerge.__init__Xs�����4�8�4���J��	r+c#�t^^^^# �/m/mS=mmUUUU4SjnURH�up#US:XaU"5Shv�N /m/mS=mmUS:XaU(aU/4v� M7M9US:XaSmTRU5 MTUS:XaSmTRU5 MoUS:XaSmTRU5 M�US:XaSmTRU5 M�US	:XaS=mmTRU5 M�US
:XaS=mmTRU5 M�US:XaS=mmM�US;dM�[U5e U"5Shv�N gN�N7f)
NFc3�># �T(dT(dgT(a
T(dT4v� gT(a
T(dT4v� gTT:XaT4v� gTT4v� g7fr"r2)�ch_a�ch_b�lines_a�lines_bs����r)�outstanding_struct�8PlanWeaveMerge._merge_struct.<locals>.outstanding_structasC�����7���d��j� ��d��j� ��G�#��j� ���(�(�s�AA�	unchanged�killed-aT�killed-b�new-a�new-b�conflicted-a�conflicted-b�killed-both)�
irrelevant�ghost-a�ghost-b�killed-base)r�r��AssertionError)r(r��staterr�r�r�r�s    @@@@r)�
_merge_struct�PlanWeaveMerge._merge_struct\s[�����������t�	)�	)�  �9�9�K�E���#�-�/�/�/�����#�#��t���#�� �6�)�O���*�$������t�$��*�$������t�$��'�!������t�$��'�!������t�$��.�(�"�"��t����t�$��.�(�"�"��t����t�$��-�'�#�"��t�� S�S�(��/�/�G%�H&�'�'�'�C0�B	(�s(�3D8�D4�CD8�D8�.D6�/D8�6D8c��/nURH>up#US;aURU5 MUS;dM&[SRU55e U$)z)Construct a BASE file from the plan text.)r�r�r�r�)r�r�r�r�r�r�r�r�zUnknown state: {})r�r�r�r�)r(�
base_linesr�rs    r)�base_from_plan�PlanWeaveMerge.base_from_plan�sa���
��9�9�K�E��L�L��!�!�$�'��	!�	�`)�)<�)C�)C�E�)J�K�K�m%�n�r+)r�N)r,r-r.r/rCrr�r�r$r�rr1r2r+r)r�r�Qs*���'0�&8�&8�9�CU�CU��9(�v:r+r�c�N�\rSrSrSr\R\R4SjrSr	g)�
WeaveMergei�zEWeave merge that takes a VersionedFile and two versions as its input.c�R�URX#5n[RXXE5 gr")r�r�r$)r(r�r�r�r�r�r�s       r)r$�WeaveMerge.__init__�s$���'�'��5������H�?r+r2N)
r,r-r.r/rCr�r�r�r$r1r2r+r)rr�s��O� �(�(��(�(�
	@r+rc�X^�\rSrSrSrU4SjrSSjrSrSrSr	Sr
SS	jrS
rU=r
$)�VirtualVersionedFilesi�z�Dummy implementation for VersionedFiles that uses other functions for
obtaining fulltexts and parent maps.

This is always on the bottom of the stack and uses string keys
(rather than tuples) internally.
c�:>�[TU]5 XlX lg)z�Create a VirtualVersionedFiles.

:param get_parent_map: Same signature as Repository.get_parent_map.
:param get_lines: Should return lines for specified key or None if
                  not available.
N)�superr$�_get_parent_map�
_get_lines)r(r�r_r*s   �r)r$�VirtualVersionedFiles.__init__�s���	����-��#�r+c��g)zQSee VersionedFiles.check.

:note: Always returns True for VirtualVersionedFiles.
Tr2)r(�progressbars  r)r�VirtualVersionedFiles.check�s��
r+c�,�[UR5e)zOSee VersionedFiles.mpdiffs.

:note: Not implemented for VirtualVersionedFiles.
)r�r[)r(rLs  r)r[�!VirtualVersionedFiles.add_mpdiffs�s��
"�$�"2�"2�3�3r+c	��URSU55R5nUVVs0sHup4U4[SU55_M snn$s snnf)r�c3�(# �UHuov� M
 g7fr"r2)r<r�s  r)r>�7VirtualVersionedFiles.get_parent_map.<locals>.<genexpr>s���*>���!�1��s�c3�&# �UHo4v� M	 g7fr"r2)r<r�s  r)r>rs���,�!�Q�D�!�s�)r
r�r�)r(r��parent_viewr�rcs     r)r��$VirtualVersionedFiles.get_parent_mapsM���*�*�*>��*>�>�D�D�F��9D�E������e�,�!�,�,�,��E�E��Es� Ac��0nUHOunURU5nUcM[U[5(d[e[R
"U5X#4'MQ U$)zSee VersionedFiles.get_sha1s.)rrarRr�r
�sha_strings)r(r��retr�rs     r)rJ�VirtualVersionedFiles.get_sha1s	sU�����D�Q��O�O�A�&�E�� �!�%��.�.�(�(�#�/�/��6��D�	���
r+c	#�# �[U5HhunURU5nUbA[U[5(d[e[	U4S[
R"U5USS9v� MZ[U45v� Mj g7f)z%See VersionedFiles.get_record_stream.NT)r<rMrN)rRrrar�rEr
rr~)r(r�r�r�r�rs      r)r��'VirtualVersionedFiles.get_record_streamst�����J�D�Q��O�O�A�&�E�� �!�%��.�.�(�(�+��D�� �,�,�U�3� �%)���+�A�4�0�0��s�A9A;c#�# �[U5HDununUbURSU[U55 URU5HnXT4v� M
 MF g7f)z<See VersionedFile.iter_lines_added_or_present_in_versions().NzFinding changed lines)�	enumerater�rJr)r(r�r~�ir'�ls      r)r��9VirtualVersionedFiles.iter_lines_added_or_present_in_keys%sM���"�4��I�A�v���~��	�	�1�1�c�$�i�@��_�_�S�)���h��*�)�s�AA)rr
r")r,r-r.r/rCr$rr[r�rJr�r�r1�
__classcell__)r*s@r)rr�s1����	$��4�F�
	�1�"�r+rc�8�\rSrSrSrSrSSjrSrSrg)	�NoDupeAddLinesDecoratori.z\Decorator for a VersionedFiles that skips doing an add_lines if the key
is already present.
c��Xlgr"��_store)r(�stores  r)r$� NoDupeAddLinesDecorator.__init__3s���r+Nc	�X�U(a[S5eUSc[R"U5n	SU	-4nOSn	XRR	U/5;a5U	c[R"U5n	U	[[
[U55S4$URRUUUUUUUUS9$)z�See VersionedFiles.add_lines.

This implementation may return None as the third element of the return
value when the original store wouldn't.
zONoDupeAddLinesDecorator.add_lines does not implement the nostore_sha behaviour.rNssha1:rj)	r�r
rr(r�rHrIrJr)
r(r'r?rr�r�r�rrr<s
          r)r�!NoDupeAddLinesDecorator.add_lines6s��� �%�)��
��r�7�?��&�&�u�-�D��d�?�$�C��D��+�+�,�,�c�U�3�3��|��*�*�5�1����S��e�_�-�t�3�3��{�{�$�$����%�!5�#��'�%�	
�		
r+c�.�[URU5$r")r�r()r(r�s  r)r��#NoDupeAddLinesDecorator.__getattr__`s���t�{�{�D�)�)r+r'r�)	r,r-r.r/rCr$rr�r1r2r+r)r%r%.s(�����!����(
�T*r+r%c�X�URS5nUSURS5nX!S-4$)z�Strip of a record kind from the front of network_bytes.

:param network_bytes: The bytes of a record.
:return: A tuple (storage_kind, offset_of_remaining_bytes)
rNrr)�findr�)�
network_bytes�line_endr>s   r)� network_bytes_to_kind_and_offsetr3ds8���!�!�%�(�H� ��(�+�2�2�7�;�L��A��%�%r+c�$�\rSrSrSrSrSrSrg)�NetworkRecordStreamioz8A record_stream which reconstitures a serialised stream.c���Xl[[R[R
[R
[R
[R
[RS.Ulg)z�Create a NetworkRecordStream.

:param bytes_iterator: An iterator of bytes. Each item in this
    iterator should have been obtained from a record_streams'
    record.get_bytes_as(record.storage_kind) call.
)rzgroupcompress-blockrrrrzknit-delta-closureN)�_bytes_iterator�fulltext_network_to_record�
groupcompress�network_block_to_records�knit�knit_network_to_record�knit_delta_closure_to_records�
_kind_factory)r(�bytes_iterators  r)r$�NetworkRecordStream.__init__rsM�� .��2�#0�#I�#I��5�5�!�8�8�$(�$?�$?�'+�'B�'B�"&�"D�"D�
��r+c#�# �URH.n[U5up#URU"X!U5Shv�N M0 gN	7f)zRRead the stream.

:return: An iterator as per VersionedFiles.get_record_stream().
N)r7r3r>)r(rbr>r2s    r)rv�NetworkRecordStream.read�sB���
�)�)�E�%E�e�%L�"�L��)�)�,�7��X�V�V�V�*�V�s�6A�A�
A)r7r>N)r,r-r.r/rCr$rvr1r2r+r)r5r5os��B�
�$Wr+r5c���[R"SXUS-5unXS-US-U-n[RU5upVUS:XaSnXS-U-Sn[	XVSU5/$)z,Convert a network fulltext record to record.�!L��nilN)�struct�unpack�bencode�bdecode_as_tupler^)�kindrbr2�meta_len�record_metar'r?rs        r)r8r8�sy���-�-��e�x�!�|�&D�E�K�X��1��x�!�|�h�'>�?�K��+�+�K�8�L�C��&������\�H�,�.�/�H�"�3��x�@�A�Ar+c�B�[R"S[U55$)NrD)rG�packrJ)rbs r)�_length_prefixrP�s���;�;�t�S��Z�(�(r+c��URcSnO/[URVs/sHn[U5PM sn5n[RURU45nUR	S5nS[U5UU4-$s snf)NrFrsfulltext
%s%s%s)r?r�rIr'rUrP)r�r?r�rM�record_contents     r)�record_to_fulltext_bytesrS�s~��
�~�~�����6�>�>�:�>�a��q��>�:�;���/�/�6�:�:�w�"7�8�K��(�(��4�N���{�#���"����;s�Bc	�f�SSKJn 0nUR5HHnUSn[U[5(d[U5S:XaSnOUSnX%R
U5 MJ /n[U5H%nUR[U"X%555 M' U$![a	 U/X%'M�f=f)z�Sort and group the keys in parent_map into groupcompress order.

groupcompress is defined (currently) as reverse-topological order, grouped
by the key prefix.

:return: A sorted-list of keys
r)�	topo_sortrrr+)�tsortrUr�rarbrJr�r(r�rX�reversed)r�rU�per_prefix_map�itemr'r��present_keyss       r)�sort_groupcompressr[�s���"��N�� � �"���1�g���c�5�!�!�S��X��]��F���V�F�	,��"�)�)�$�/�#��L���(�����H�Y�~�/E�%F�G�H�)����
�	,�&*�V�N�"�	,�s�B�B0�/B0c�N�\rSrSrS
SjrSrSrSrSrSr	Sr
S	rS
rSr
g)�_KeyRefsi�c�N�0UlU(a[5UlgSUlgr")�refsr��new_keys)r(�track_new_keyss  r)r$�_KeyRefs.__init__�s����	���E�D�M� �D�Mr+c��UR(aURR5 UR(aURR5 ggr")r_�clearr`r@s r)rd�_KeyRefs.clear�s3���9�9��I�I�O�O���=�=��M�M���!�r+c���UH$nURUnURU5 M& UR	U5 g![a [5=o@RU'NKf=fr")r_r(r�r��add_key)r(r'r_�
referenced�	needed_bys     r)�add_references�_KeyRefs.add_references�s_���J�
:� �I�I�j�1�	�
�M�M�#���	
���S���	�
:�47�E�9�	�I�I�j�1�
:�s�=�"A"�!A"c��UR$r")r`r@s r)�get_new_keys�_KeyRefs.get_new_keys�s���}�}�r+c�6�URR5$r")r_r�r@s r)�get_unsatisfied_refs�_KeyRefs.get_unsatisfied_refs�s���y�y�~�~��r+c�@�URU	g![a gf=fr")r_r(r�s  r)�_satisfy_refs_for_key�_KeyRefs._satisfy_refs_for_key�s$��	��	�	�#����	��	�s�
�
�c�x�URU5 URbURRU5 ggr")rsr`r�r�s  r)rg�_KeyRefs.add_key�s1���"�"�3�'��=�=�$��M�M���c�"�%r+c�8�UHnURU5 M gr")rs)r(r�r's   r)�satisfy_refs_for_keys�_KeyRefs.satisfy_refs_for_keys�s���C��&�&�s�+�r+c��[[RRURR555$r")r�r0r1r2r_r3r@s r)�
get_referrers�_KeyRefs.get_referrers�s)���9�?�?�0�0����1A�1A�1C�D�E�Er+)r`r_N)F)r,r-r.r/r$rdrjrmrprsrgrxr{r1r2r+r)r]r]�s0��!�"�	�� ��#�,�Fr+r])CrCr0r�rGr�ior�typingr�zlibrr�globalsrr	r
rr4rrn�registryr
�	textmergerrr��str�adapter_registry�
register_lazy�target_storage_kindr#r�BzrErrorr4r7rEr^rmr~r�r�r�r�r�r�r�r�r�r�r�r�rrrr�r�r�rrr%r3r5r8rPrSr[r]r2r+r)�<module>r�s���"'��	�
�����%���I��� �"�*��!���E�#�s�(�O�S�0�1�3�����0��!��
���*����
<���"�"�	�-�.����
�"�"�	�*�+�->�@S���"�"�	�!4�5����
�"�"�	"�$7�8��"��<�*
�� 7� 7�
�<�f�o�o�<���2/S�N�/S�d)S�^�)S�X S�� S�F
�>�
�B0�^�0�"�4�4�D`I�`I�F
j'�j'�Z&�&F�&�R.�.�,	�Y�	�
;�i�
;� /�?�/����0*�.�*�:
� |�|�~	H�N�H�V�.��2r�n�r�j@�Y�@�F@��@�H�N�H�V3*�3*�l&�W�W�>B�)���<3F�3Fr+

Youez - 2016 - github.com/yon3zu
LinuXploit