-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/xml8.pyc

ó
¦îNc@@sddlmZddlZddlmZmZmZmZddl	m
Z
mZmZm
Z
mZmZmZmZmZddlmZddlmZidd6d	d
6dd6d
d6dd6Zed„ZejdƒZd„Zdefd„ƒYZeƒZdS(i(tabsolute_importN(t
cache_utf8t
lazy_regextrevisionttrace(	tElementt
SubElementt
XMLSerializertencode_and_escapetescape_invalid_charstget_utf8_or_asciitserialize_inventory_flattunpack_inventory_entrytunpack_inventory_flat(tRevision(tBzrErrort'tapost"tquott&tampt<tltt>tgtcC@sb|jdƒ}y||SWn@tk
r]|jdƒs@‚ntt|dƒƒjdƒSXdS(Nit#tutf8(tgrouptKeyErrort
startswithtunichrtinttencode(tmatcht_maptcode((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt
_unescaper3s
s
\&([^;]*);cC@stjt|ƒS(s5Unescape predefined XML entities in a string of data.(t_unescape_retsubR%(tdata((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt
_unescape_xml?st
Serializer_v8cB@sÚeZdZgZdZeZedddgƒZ	dZ
dZej
dƒZd„Zd„Zd„Zed	„Zed
„Zd„Zd„Zd
„Zded„Zdded„Zd„Zd„Zd„ZRS(scThis serialiser adds rich roots.

    Its revision format number matches its inventory number.
    tfilet	directorytsymlinkt8s@file_id="(?P<file_id>[^"]+)".* revision="(?P<revision_id>[^"]+)"cC@sC|jdkrtdƒ‚n|jjdkr?tdƒ‚ndS(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.
        sinv.revision_id is Nonesinv.root.revision is NoneN(trevision_idtNonetAssertionErrortrootR(tselftinv((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt_check_revisions\scC@sc|dkrdS|d}|jƒ|kr_|d}tjd|jƒ|ƒ|j|ƒndS(seCheck 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ø?is0Resizing the inventory entry cache from %d to %d(R0t
cache_sizeRtmuttertresize(R3tinv_sizetentry_cachetrecommended_min_cache_sizetrecommended_cache_size((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt_check_cache_sizegs

	cC@s|j|dƒS(s2Return a list of lines with the encoded inventory.N(twrite_inventoryR0(R3R4((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pytwrite_inventory_to_linesƒscC@s)tjƒ}|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	cStringIOtStringIOR>tgetvalue(R3R4tworkingtsio((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pytwrite_inventory_to_string‡scC@s[g}|j}|j||ƒt|||j|j|ƒ|dk	rW|j|ƒn|S(saWrite inventory to a file.

        :param inv: the inventory to write.
        :param f: the file to write. (May be None if the lines are the desired
            output).
        :param working: If True skip history data - text_sha1, text_size,
            reference_revision, symlink_target.
        :return: The inventory as a list of lines.
        N(tappendt_append_inventory_rootRtroot_idtsupported_kindsR0t
writelines(R3R4tfRCtoutputRF((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyR>‘s
		cC@sŒ|jdk	r'd}t|jƒ}nd}d}|d|j||fƒ|dt|jjƒt|jjƒt|jjƒfƒdS(s$Append the inventory root to output.s revision_id="ts<inventory format="%s"%s%s>
s0<directory file_id="%s name="%s revision="%s />
N(R/R0Rt
format_numR2tfile_idtnameR(R3RFR4trevid1trevid2((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyRG§sc
C@sŸtj}|j}t|tƒr0||ƒ}n|j}|jdk	rT|j}ntdd|j	dd|j
d|d|jd|ƒ}|jdk	r¶|j
dt|jƒƒnd	|_t|d
ƒ}t|jƒd|_d	|_|jrt|dƒ}d	|_|_xg|jD]Y}tj|ƒt|d
ƒ}	d	|	_t|tƒrh||ƒ}n|	j
d|ƒqWn|jr›|j||ƒn|S(sRevision object -> xml treeRt	committert	timestamps%.3fR/tinventory_sha1tformatttimezones
tmessageitparentstrevision_refN(RtdecodeR/t
isinstancetstrRNtrevision_format_numR0RRSRTRURWtsetttextRR	RXttailt
parent_idst
_mod_revisiontcheck_not_reserved_idt
propertiest_pack_revision_properties(
R3trevtdecode_utf8R/RNR2tmsgtpeltst	parent_idtp((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt_pack_revision¶s@					
					
		cC@sst|dƒ}xTt|jjƒƒD]=\}}t|dƒ}|jd|ƒ||_d|_q%Wd|_dS(NRetpropertyRPs
(RtsortedRetitemsR_R`Ra(R3Rgt
under_elementttop_eltt	prop_namet
prop_valuetprop_elt((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyRfÝs"	
cC@st|||ƒS(N(R(R3teltR:treturn_from_cache((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt
_unpack_entryæs	cC@s8t||j|j||ƒ}|jt|ƒ|ƒ|S(sConstruct from XML Element(R
RNRxR=tlen(R3RvR/R:RwR4((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt_unpack_inventoryësc	
C@sY|jdƒ}|j}|jdk	r3|j}n|dk	ra||kratd|ƒ‚qant}td|jdƒdt|jdƒƒd||jdƒƒd|jdƒƒ}|jdƒpÊg}x-|D]%}|j	j
||jdƒƒƒqÔW|j||ƒ|jdƒ}|dkr4d	|_nt
|ƒ|_|jd
ƒ|_|S(sXML Element -> Revision objectRVs%invalid format version %r on revisionRSRTR/RURYRWiRXN(tgetRNR^R0RR
RtfloattfindRbRFt_unpack_revision_propertiesRWR tfindtextRX(	R3RvRVRNt
get_cachedRgRYRltv((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt_unpack_revisionós.	
#cC@s¯|jdƒ}|sdSx|D]‡}|jdkrKtd|jƒ‚n|jdƒ}|j}|dkrxd}n||jkrštd|ƒ‚n||j|<q WdS(s"Unpack properties onto a revision.ReNRns!bad tag under properties list: %rRPRMsrepeated property %r(R}ttagR1R{R`R0Re(R3RvRgt	props_eltRuRPtvalue((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyR~s
		cC@sL|jstd|ƒ‚ni}i}i}|jj}t}|j}xü|D]ô\}}	||ƒ}
|
dkrzqPn|
jddƒ\}}y||}Wn-tk
rÏ||ƒ}
|
||<|
}nXy||}Wn-tk
r
||ƒ}
|
||<|
}nX||f}||t	ƒ||	dkrPt
||<qPqPW|S(s@Core routine for extracting references to texts from inventories.

        This performs the translation of xml lines to revision ids.

        :param line_iterator: An iterator of lines, origin_version_id
        :return: A dictionary mapping text keys ((fileid, revision_id) tuples)
            to whether they were referred to by the inventory of the
            revision_id that they contain. Note that if that revision_id was
            not part of the line_iterator's output then False will be given -
            even though it may actually refer to that key.
        sf_find_text_key_references only supported for branches which store inventory as unnested xml, not on %rROR/iÿÿÿÿN(tsupport_altered_by_hackR1t_file_ids_altered_regextsearchR)t
setdefaultR0RRtFalsetTrue(R3t
line_iteratortresulttunescape_revid_cachetunescape_fileid_cacheRˆtunescapeR‰tlinetline_keyR"ROR/t	unescapedtkey((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt_find_text_key_references#s@	

	






N(t__name__t
__module__t__doc__t	__slots__R0RHR‹R†R_RIRNR^Rtlazy_compileR‡R5R=R?RŠRER>RGRmRfRxRzR‚R~R•(((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyR*Ds.				
		'				(t
__future__RR@tbzrlibRRRRcRtbzrlib.xml_serializerRRRRR	R
RRR
tbzrlib.revisionRt
bzrlib.errorsRt_xml_unescape_mapR%RšR&R)R*t
serializer_v8(((s//usr/lib/python2.7/dist-packages/bzrlib/xml8.pyt<module>s""@

	ÿ0

Copyright © 2017 || Recoded By Mr.Bumblebee