-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
î:ïNc@@s0dZddlmZdgZddlmZddlmZddlmZddl	m
Z
dZd	ejfd
„ƒYZ
dejfd„ƒYZd
„Zd„Zd„Zd„Zejd„Zejd„Zejd„Zejd„Zdefd„ƒYZdefd„ƒYZd„ZdS(sÖInventory delta serialisation.

See doc/developers/inventory.txt for the description of the format.

In this module the interesting classes are:
 - InventoryDeltaSerializer - object to read/write inventory deltas.
i(tabsolute_importtInventoryDeltaSerializer(terrors(tbasename(t	inventory(t
NULL_REVISIONs!bzr inventory delta v1 (bzr 1.14)tInventoryDeltaErrorcB@seZdZeZRS(s>An error when serializing or deserializing an inventory delta.(t__name__t
__module__t__doc__tTruetinternal_error(((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyR%stIncompatibleInventoryDeltacB@seZdZeZRS(s The delta could not be deserialised because its contents conflict with
    the allow_versioned_root or allow_tree_references flags of the
    deserializer.
    (RRR	tFalseR(((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyR.scC@sdS(sqSerialize the content component of entry which is a directory.
    
    :param entry: An InventoryDirectory.
    tdir((tentry((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt_directory_content6scC@sW|jrd}nd}|j||jf}d|krOtd|jƒ‚nd|S(sgSerialize the content component of entry which is a file.
    
    :param entry: An InventoryFile.
    tYtsMissing size or sha for %st
file%d%s%sN(t
executablet	text_sizet	text_sha1tNoneRtfile_id(Rt
exec_bytest
size_exec_sha((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt
_file_content>s		cC@s<|j}|dkr+td|jƒ‚nd|jdƒS(sjSerialize the content component of entry which is a symlink.
    
    :param entry: An InventoryLink.
    sMissing target for %stlink%stutf8N(tsymlink_targetRRRtencode(Rttarget((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt
_link_contentMs	cC@s3|j}|dkr+td|jƒ‚nd|S(spSerialize the content component of entry which is a tree-reference.
    
    :param entry: A TreeReference.
    s!Missing reference revision for %sttree%sN(treference_revisionRRR(Rt
tree_revision((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt_reference_contentXs
	cC@s||||ƒ}||_|S(s6Convert a dir content record to an InventoryDirectory.(trevision(tcontenttnamet	parent_idRt
last_modifiedt_typetresult((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt
_dir_to_entryds	cC@s^||||ƒ}||_t|dƒ|_|d|_|drQt|_n	t|_|S(s1Convert a dir content record to an InventoryFile.iii(R&tintRRR
RR
(R'R(R)RR*R+R,((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt_file_to_entryls	

	cC@s5||||ƒ}||_|djdƒ|_|S(s2Convert a link content record to an InventoryLink.iR(R&tdecodeR(R'R(R)RR*R+R,((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt_link_to_entryzs	cC@s,||||ƒ}||_|d|_|S(s1Convert a tree content record to a TreeReference.i(R&R#(R'R(R)RR*R+R,((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt_tree_to_entryƒs	
cB@s2eZdZd„Zd„Zd„Zd„ZRS(sSerialize inventory deltas.cC@sJ||_||_itd6td6td6|_|rFt|jd<ndS(sCreate an InventoryDeltaSerializer.

        :param versioned_root: If True, any root entry that is seen is expected
            to be versioned, and root entries can have any fileid.
        :param tree_references: If True support tree-reference entries.
        t	directorytfiletsymlinkstree-referenceN(t_versioned_roott_tree_referencesRRR!t_entry_to_contentR%(tselftversioned_rootttree_references((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt__init__s		
cC@s-t|ƒtk	r(td|fƒ‚nt|ƒtk	rPtd|fƒ‚ndddddg}|j}xP|D]H}|||ƒ}|jtkr°td|dƒ‚n|j|ƒquW|jƒdt|d<d||d	<d
||d<d|j	|j
ƒ|d
<d|j	|jƒ|d<|S(sdReturn a line sequence for delta_to_new.

        Both the versioned_root and tree_references flags must be set via
        require_flags before calling this.

        :param old_name: A UTF8 revision id for the old inventory.  May be
            NULL_REVISION if there is no older inventory and delta_to_new
            includes the entire inventory contents.
        :param new_name: The version name of the inventory we create with this
            delta.
        :param delta_to_new: An inventory delta such as Inventory.apply_delta
            takes.
        :return: The serialized delta as lines.
        sold_name should be str, got %rsnew_name should be str, got %rRs#to_line generated non-str output %riÿÿÿÿsformat: %s
isparent: %s
isversion: %s
isversioned_root: %s
istree_references: %s
i(ttypetstrt	TypeErrort_delta_item_to_linet	__class__RtappendtsorttFORMAT_1t_serialize_boolR6R7(R9told_nametnew_nametdelta_to_newtlinestto_linet
delta_itemtline((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pytdelta_to_lines s*	

		cC@s|r
dSdSdS(Nttruetfalse((R9tvalue((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyREÅscC@sQ|\}}}}|d
krLd|jdƒ}d}d}	t}
d}në|d
krad}nd|jdƒ}|dkr–td|fƒ‚nd|jdƒ}|jpµd}	|j}
|dkr|jr|
|krtd||
|fƒ‚qn|
d
kr!td|ƒ‚n|j|j	|ƒ}d	||||	|
|fS(sConvert delta_item to a line.t/RRRt	deletedsOBad inventory delta: '/' is not a valid newpath (should be '') in delta item %rs&Version present for / in %s (%s != %s)sno version for fileid %ss%s%s%s%s%s%s
N(
RRRtAssertionErrorR)R&R6RR8tkind(R9RKtnew_versiontoldpathtnewpathRRtoldpath_utf8tnewpath_utf8R)R*R'((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyR@Ës8			(RRR	R<RMRER@(((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyRŒs
		%	tInventoryDeltaDeserializercB@s/eZdZeed„Zd„Zd„ZRS(sDeserialize inventory deltas.cC@s||_||_dS(s
Create an InventoryDeltaDeserializer.

        :param versioned_root: If True, any root entry that is seen is expected
            to be versioned, and root entries can have any fileid.
        :param tree_references: If True support tree-reference entries.
        N(t_allow_versioned_roott_allow_tree_references(R9tallow_versioned_roottallow_tree_references((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyR<üs	cC@s7|dkrtS|dkr tStd|fƒ‚dS(NRNROsvalue %r is not a bool(R
R
R(R9RP((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt_deserialize_bools
cC@s4|ddkr<|jddƒd}td|fƒ‚n|jdƒd }|sj|ddtkr„td|dd!ƒ‚nt|ƒdksª|djd	ƒr¹td
ƒ‚n|dd}t|ƒdksí|djd
ƒrütdƒ‚n|dd}t|ƒdks0|djdƒr?tdƒ‚n|j|ddƒ}t|ƒdks||djdƒr‹tdƒ‚n|j|ddƒ}|jrÁ|rÁtdƒ‚ng}t	ƒ}	t
|ƒ}
xtdƒD]}|
jƒqéWx!|
D]}|jddƒ\}
}}}}}|p7d'}||	krYtd|ƒ‚n|	j|ƒ|dkr˜|r˜||kr˜td|ƒ‚n/|dkrÇ|ddkrÇtd|ƒ‚n|jd ƒr|tkrõtd!|ƒ‚q|jstd"ƒ‚qn|
dkr%d'}n?|
d dkrKtd#|
fƒ‚n|
d}
|
jd$ƒ}|dkryd'}n?|d dkrŸtd%|fƒ‚n|d}|jd$ƒ}t|jdƒƒ}|dd&kræd'}nt|||||ƒ}||||f}|j|ƒqW|||||fS((sÏParse the text bytes of a serialized inventory delta.

        If versioned_root and/or tree_references flags were set via
        require_flags, then the parsed flags must match or a BzrError will be
        raised.

        :param bytes: The bytes to parse. This can be obtained by calling
            delta_to_lines and then doing ''.join(delta_lines).
        :return: (parent_id, new_id, versioned_root, tree_references,
            inventory_delta)
        iÿÿÿÿs
islast line not empty: %ris
format: %ssunknown format %risparent: smissing parent: markeriis	version: smissing version: markeri	isversioned_root: smissing versioned_root: markeriistree_references: smissing tree_references: markerisversioned_root not allowedts'duplicate file id in inventory delta %rRQsVersioned root found: %rRt:sspecial revisionid found: %rttreesATree reference found (but header said tree_references: false): %rsTree reference not alloweds+oldpath invalid (does not start with /): %rRs+newpath invalid (does not start with /): %rtdeletedN(trsplitRtsplitRDtlent
startswithR_R[RtsettitertrangetnextRtaddR
R\R0ttuplet_parse_entryRB(R9tbytest	last_lineRItdelta_parent_idtdelta_version_idtdelta_versioned_roottdelta_tree_referencesR,tseen_idst	line_itertiRLRXRYRR)R*R'RVRWt
content_tupleRRK((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pytparse_text_bytessŒ&&&&	
$

		
	
		(RRR	R
R<R_Ry(((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyRZùs
	cC@snitd6td6td6td6}|d}|jdƒrDt‚nt|ƒ}||d|||||ƒS(NRR4tlinkttreeiRQ(R-R/R1R2RgRSR(tpathRR)R*R't
entry_factoryRTR(((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyRnks

	N(R	t
__future__Rt__all__tbzrlibRtbzrlib.osutilsRRtbzrlib.revisionRRDtBzrErrorRRRRR!R%tInventoryDirectoryR-t
InventoryFileR/t
InventoryLinkR1t
TreeReferenceR2tobjectRRZRn(((s:/usr/lib/python2.7/dist-packages/bzrlib/inventory_delta.pyt<module>s(						
	mr

Copyright © 2017 || Recoded By Mr.Bumblebee