| Server IP : 172.67.207.176 / Your IP : 216.73.216.47 Web Server : Apache System : Linux infong-es77 4.4.400-icpu-108 #2 SMP Wed Feb 11 10:12:42 UTC 2026 x86_64 User : u67207989 ( 1351568) PHP Version : 8.4.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/breezy/bzr/__pycache__/ |
Upload File : |
a
�*�^4 � @ s� d Z ddlmZ ddlmZ G dd� de�ZG dd� dej�Ze� Z e �
d d
d� e �
dd
d� e �
ddd� e �
ddd� e �
ddd� e �
ddd� dS )z!Inventory/revision serialization.� )�absolute_import� )�registryc @ s` e Zd ZdZdZdd� Zdd� Zdd� Zdd
d�Zddd
�Z dd� Z
dd� Zdd� Zdd� Z
d S )�
Serializerz5Inventory and revision serialization/deserialization.Fc C s t | j��dS )z�Write inventory to a file.
Note: this is a *whole inventory* operation, and should only be used
sparingly, as it does not scale well with large trees.
N)�NotImplementedError�write_inventory)�self�inv�f� r �7/usr/lib/python3/dist-packages/breezy/bzr/serializer.pyr s zSerializer.write_inventoryc C s t | j��dS )a� Produce a simple bytestring chunk representation of an inventory.
Note: this is a *whole inventory* operation, and should only be used
sparingly, as it does not scale well with large trees.
The requirement for the contents of the string is that it can be passed
to read_inventory_from_lines and the result is an identical inventory
in memory.
N)r �write_inventory_to_chunks�r r r r r r
% s
z$Serializer.write_inventory_to_chunksc C s t | j��dS )a~ Produce a simple lines representation of an inventory.
Note: this is a *whole inventory* operation, and should only be used
sparingly, as it does not scale well with large trees.
The requirement for the contents of the string is that it can be passed
to read_inventory_from_lines and the result is an identical inventory
in memory.
N)r �write_inventory_to_linesr r r r r 1 s
z#Serializer.write_inventory_to_linesNc C s t | j��dS )a| Read bytestring chunks into an inventory object.
:param lines: The serialized inventory to read.
:param revision_id: If not-None, the expected revision id of the
inventory. Some serialisers use this to set the results' root
revision. This should be supplied for deserialising all
from-repository inventories so that xml5 inventories that were
serialised without a revision identifier can be given the right
revision id (but not for working tree inventories where users can
edit the data without triggering checksum errors or anything).
:param entry_cache: An optional cache of InventoryEntry objects. If
supplied we will look up entries via (file_id, revision_id) which
should map to a valid InventoryEntry (File/Directory/etc) object.
:param return_from_cache: Return entries directly from the cache,
rather than copying them first. This is only safe if the caller
promises not to mutate the returned inventory entries, but it can
make some operations significantly faster.
N)r �read_inventory_from_lines)r �lines�revision_idZentry_cacheZreturn_from_cacher r r r = s z$Serializer.read_inventory_from_linesc C s t | j��dS )zSee read_inventory_from_lines.N)r �read_inventory)r r
r r r r r S s zSerializer.read_inventoryc C s t | j��d S �N)r �write_revision_to_string�r Zrevr r r r W s z#Serializer.write_revision_to_stringc C s t | j��d S r )r �write_revision_to_linesr r r r r Z s z"Serializer.write_revision_to_linesc C s t | j��d S r )r �
read_revision)r r
r r r r ] s zSerializer.read_revisionc C s t | j��d S r )r �read_revision_from_string)r Z
xml_stringr r r r ` s z$Serializer.read_revision_from_string)NNF)N)�__name__�
__module__�__qualname__�__doc__Zsquashes_xml_invalid_charactersr r
r r r r r r r r r r r r s �
r c @ s e Zd ZdZdS )�SerializerRegistryzRegistry for serializer objectsN)r r r r r r r r r d s r �5zbreezy.bzr.xml5Z
serializer_v5�6zbreezy.bzr.xml6Z
serializer_v6�7zbreezy.bzr.xml7Z
serializer_v7�8zbreezy.bzr.xml8Z
serializer_v8�9zbreezy.bzr.chk_serializerZchk_serializer_255_bigpageZ10Zchk_bencode_serializerN)r Z
__future__r � r �objectr ZRegistryr Zformat_registryZ
register_lazyr r r r �<module> s L��