-=[ Mr. Bumblebee ]=-
_Indonesia_

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

σ
rΐ/Oc@@s«dZddlmZddlZddlmZmZmZddl	m
Z
ddlmZddl
mZddlmZdd	lmZd
ejfd„ƒYZdS(s5MemoryTree object.

See MemoryTree for more details.
i(tabsolute_importN(terrorstmutabletreetrevision(tneeds_read_lock(t	Inventory(tsha_file(tneeds_tree_write_lock(tMemoryTransportt
MemoryTreecB@sUeZdZd„Zd„Zd„Zed„ƒZd„Ze	d„ƒZ
d„Zdd„Z
ddd	„Zd
„Zd„Zed„ƒZd
„Zd„Zed„ƒZd„Zdd„Zd„Zdd„Zed„ƒZd„Zd„Zd„Zd„Zd„Zd„Z ed„ƒZ!e"d„Z#d„Z$e"d„Z%RS( sΣA MemoryTree is a specialisation of MutableTree.

    It maintains nearly no state outside of read_lock and write_lock
    transactions. (it keeps a reference to the branch, and its last-revision
    only).
    cC@s4||_|j|_||_d|_d|_dS(s4Construct a MemoryTree for branch using revision_id.iN(tbranchtbzrdirt_branch_revision_idt_lockstNonet
_lock_mode(tselfR
trevision_id((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt__init__.s
			cC@s
|jjƒS(N(R
tget_config_stack(R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyR6scC@stS(N(tFalse(Rtfilename((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pytis_control_filename9scC@s€xyt|||ƒD]e\}}}|dkr7d}n|dkr\|jj|d|ƒq|jj|d|d|ƒqWdS(sSee MutableTree._add.tfiletkindtfile_idN(tzipRt
_inventorytadd_path(RtfilestidstkindstfRR((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt_add=s"	cC@s|jS(sSee Tree.basis_tree().(t_basis_tree(R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt
basis_treeHscC@s"tj|jƒƒ}t||ƒS(sBCreate a MemoryTree for branch, using the last-revision of branch.(t
_mod_revisiontensure_nullt
last_revisionR	(R
R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pytcreate_on_branchLscC@sdS(sSee MutableTree._gather_kinds.

        This implementation does not care about the file kind of
        missing files, so is a no-op.
        N((RRR((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt
_gather_kindsRscC@s.|dkr|j|ƒ}n|jj|ƒS(sSee Tree.get_file.N(Rtid2patht_file_transporttget(RRtpath((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pytget_fileYscC@s:|dkr|j|ƒ}n|jj|ƒ}t|ƒS(sSee Tree.get_file_sha1().N(RR)R*R+R(RRR,t
stat_valuetstream((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt
get_file_sha1_scC@s
|jdƒS(Nt(tpath2id(R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pytget_root_idfscC@s,|dkrdtdfS|j|jdfS(sSee Tree._comparison_data.N(RRRt
executable(RtentryR,((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt_comparison_datais
cC@sc|j|ƒ}tjj|ƒ\}}|j|ƒ}|jj||ƒ|jj|||ƒdS(N(R2tosR,tsplitR*tmoveRtrename(Rtfrom_reltto_relRtto_dirtto_tailtto_parent_id((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt
rename_oneos
cC@sΕ|j|ƒ}|dkrdS|j|ƒ}|dkr~|jj|ƒ}t|ƒ}|j|j}d}||||fS|dkrš|dddfS|dkr΅tdƒ‚ntdƒ‚dS(	sSee Tree.path_content_summary.tmissingRt	directorytsymlinkssymlink supportsunknown kindN(RANNN(	R2RRR*t	get_bytestlenRR4tNotImplementedError(RR,tidRtbytestsizeR4tsha1((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pytpath_content_summarywscC@s|dkrdS|jS(sSee Tree._file_size.iN(Rt	text_size(RR5R.((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt
_file_size‹scC@s
t|jƒS(s‚See Tree.get_parent_ids.

        This implementation returns the current cached value from
            self._parent_ids.
        (tlistt_parent_ids(R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pytget_parent_ids‘scC@s|jj|ƒS(sSee Tree.has_filename().(R*thas(RR((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pythas_filenamešscC@s|j|jS(N(RR4(RRR,((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt
is_executabležscC@s|j|jS(N(RR(RR((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyR‘scC@sE|j||dƒ|dkr1|j|ƒ}n|jj|ƒ|S(sSee MutableTree.mkdir().RBN(taddRR2R*tmkdir(RR,R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyRU€s
cC@s|jS(sSee MutableTree.last_revision.(R(R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyR&¬scC@se|jd7_y6|jdkrD|jjƒd|_|jƒnWn|jd8_‚nXdS(svLock the memory tree for reading.

        This triggers population of data from the branch for its revision.
        itrN(R
R
t	lock_readRt_populate_from_branch(R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyRW±s
	cC@s†|jd7_yW|jdkrD|jjƒd|_|jƒn!|jdkretj|ƒ‚nWn|jd8_‚nXdS(s"See MutableTree.lock_tree_write().itwRVN(R
R
RWRRXRt
ReadOnlyError(R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pytlock_tree_writeΐs
	
cC@s†|jd7_yW|jdkrD|jjƒd|_|jƒn!|jdkretj|ƒ‚nWn|jd8_‚nXdS(sSee MutableTree.lock_write().iRYRVN(R
R
t
lock_writeRRXRRZ(R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyR\Ξs
	
cC@s|jƒ|jtjkr(g|_n|jg|_td|jjƒƒ|_	t
ƒ|_|jjƒ}x‘|D]™\}}|j	j
|jƒƒ|dkr¨qtn|jdkrΚ|jj|ƒqt|jdkrώ|jj||jj|jƒƒqtt|jƒ‚qtWdS(s+Populate the in-tree state from the branch.R1RBRN(t
_set_basisRR$t
NULL_REVISIONRORRR"tget_revision_idRRR*titer_entries_by_dirRTtcopyRRUtput_fileR-RRFRX(Rtinventory_entriesR,R5((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyRXάs"
cC@s |jj|j|ƒ|ƒdS(s*See MutableTree.put_file_bytes_non_atomic.N(R*t	put_bytesR)(RRRH((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pytput_file_bytes_non_atomicσscC@sg|jdkrTd|_g|_d|_z|jjƒWdd|_d|_Xn|jd8_dS(svRelease a lock.

        This frees all cached state when the last lock context for the tree is
        left.
        iNi(R
RR"RORR
tunlockR(R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyRfχs				
cC@sLxE|D]=}|jj|ƒr2|jj|ƒqtj||ƒ‚qWdS(s*Remove the file ids in file_ids from the current versioned set.

        When a file_id is unversioned, all of its children are automatically
        unversioned.

        :param file_ids: The file ids to stop versioning.
        :raises: NoSuchId if any fileid is not currently versioned.
        N(Rthas_idtremove_recursive_idRtNoSuchId(Rtfile_idsR((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt	unversion	s

cC@sux|D]}tj|ƒqWt|ƒdkrHg|_tj|_n||_|d|_||_|jƒdS(s#See MutableTree.set_parent_trees().iN(R$tcheck_not_reserved_idREROR^Rt_allow_leftmost_as_ghostR](Rtrevision_idstallow_leftmost_as_ghostR((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pytset_parent_idss
		
	cC@sdy|jjj|jƒ|_Wn>tjk
r_|jrY|jjjtj	ƒ|_q`‚nXdS(N(
R
t
repositoryt
revision_treeRR"RtNoSuchRevisionRmR$R^(R((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyR])s	cC@sόt|ƒdkr9g|_|jjjtjƒ|_nΏ|dddkrn|rnt	j
|ddƒ‚ng|D]\}}|^qu|_|dddksΈ|dddkrΦ|jjjtjƒ|_n|dd|_|dd|_dS(s#See MutableTree.set_parent_trees().iisnull:N(REROR
RqRrR$R^R"RRtGhostRevisionUnusableHereR(Rtparents_listRot	parent_idttree((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pytset_parent_trees4s	"(N(&t__name__t
__module__t__doc__RRRRR!R#tstaticmethodR'R(RR-R0R3R6R@RKRMRRPRRRSRRUR&RWR[R\RXReRfRkRRpR]Rx(((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyR	&s>																		
	(R{t
__future__RR7tbzrlibRRRR$tbzrlib.decoratorsRtbzrlib.inventoryRtbzrlib.osutilsRtbzrlib.mutabletreeRtbzrlib.transport.memoryRtMutableInventoryTreeR	(((s5/usr/lib/python2.7/dist-packages/bzrlib/memorytree.pyt<module>s

Copyright © 2017 || Recoded By Mr.Bumblebee