-=[ Mr. Bumblebee ]=-
_Indonesia_
ó
¦îNc @@ s d d l m Z d d l Z d d l m Z m Z m Z m Z d d l m
Z
m Z m Z m
Z
m Z m Z m Z m Z m Z d d l m Z d d l m Z i d d 6d d
6d d 6d
d 6d d 6Z e d „ Z e j d ƒ Z d „ Z d e f d „ ƒ YZ e ƒ Z d S( i ( t absolute_importN( t
cache_utf8t
lazy_regext revisiont trace( t Elementt
SubElementt
XMLSerializert encode_and_escapet escape_invalid_charst get_utf8_or_asciit serialize_inventory_flatt unpack_inventory_entryt unpack_inventory_flat( t Revision( t BzrErrort 't apost "t quott &t ampt <t ltt >t gtc C@ sb | j d ƒ } y | | SWn@ t k
r] | j d ƒ s@ ‚ n t t | d ƒ ƒ j d ƒ SXd S( Ni t #t utf8( t groupt KeyErrort
startswitht unichrt intt encode( t matcht _mapt code( ( s/ /usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt
_unescaper3 s
s
\&([^;]*);c C@ s t j t | ƒ S( s5 Unescape predefined XML entities in a string of data.( t _unescape_ret subR% ( t data( ( s/ /usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt
_unescape_xml? s t
Serializer_v8c B@ sÚ e Z d Z g Z d Z e Z e d d d g ƒ Z d Z
d Z e j
d ƒ Z d „ Z d „ Z d „ Z e d „ Z e d
„ Z d „ Z d „ Z d
„ Z d e d „ Z d d e d „ Z d „ Z d „ Z d „ Z RS( sc This serialiser adds rich roots.
Its revision format number matches its inventory number.
t filet directoryt symlinkt 8s@ file_id="(?P<file_id>[^"]+)".* revision="(?P<revision_id>[^"]+)"c C@ sC | j d k r t d ƒ ‚ n | j j d k r? t d ƒ ‚ n d S( sÉ Extension point for subclasses to check during serialisation.
:param inv: An inventory about to be serialised, to be checked.
:raises: AssertionError if an error has occurred.
s inv.revision_id is Nones inv.root.revision is NoneN( t revision_idt Nonet AssertionErrort rootR ( t selft inv( ( s/ /usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt _check_revisions\ s c C@ sc | d k r d S| d } | j ƒ | k r_ | d } t j d | j ƒ | ƒ | j | ƒ n d S( se Check that the entry_cache is large enough.
We want the cache to be ~2x the size of an inventory. The reason is
because we use a FIFO cache, and how Inventory records are likely to
change. In general, you have a small number of records which change
often, and a lot of records which do not change at all. So when the
cache gets full, you actually flush out a lot of the records you are
interested in, which means you need to recreate all of those records.
An LRU Cache would be better, but the overhead negates the cache
coherency benefit.
One way to look at it, only the size of the cache > len(inv) is your
'working' set. And in general, it shouldn't be a problem to hold 2
inventories in memory anyway.
:param inv_size: The number of entries in an inventory.
Ng ø?i s0 Resizing the inventory entry cache from %d to %d( R0 t
cache_sizeR t muttert resize( R3 t inv_sizet entry_cachet recommended_min_cache_sizet recommended_cache_size( ( s/ /usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt _check_cache_sizeg s
c C@ s | j | d ƒ S( s2 Return a list of lines with the encoded inventory.N( t write_inventoryR0 ( R3 R4 ( ( s/ /usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt write_inventory_to_linesƒ s c C@ s) t j ƒ } | j | | | ƒ | j ƒ S( sà Just call write_inventory with a StringIO and return the value.
:param working: If True skip history data - text_sha1, text_size,
reference_revision, symlink_target.
( t cStringIOt StringIOR>