-=[ Mr. Bumblebee ]=-
_Indonesia_

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


Oc@@sdZddlmZddlmZeedddlmZddlm	Z	m
Z
mZddlm
Z
mZmZmZddlmZmZmZmZmZmZdd	lmZd
efdYZdefd
YZdefdYZdefdYZdeefdYZdeefdYZde fdYZ!de fdYZ"de fdYZ#defdYZ$de$fdYZ%d e$fd!YZ&ej'e$ej'e%ej'e&e(e(d"Z)d#Z*d$Z+d%S(&s0Repository formats built around versioned files.i(tabsolute_import(tlazy_imports
import itertools

from bzrlib import (
    check,
    config as _mod_config,
    debug,
    fetch as _mod_fetch,
    fifo_cache,
    gpg,
    graph,
    inventory_delta,
    lru_cache,
    osutils,
    revision as _mod_revision,
    serializer as _mod_serializer,
    static_tuple,
    symbol_versioning,
    tsort,
    ui,
    versionedfile,
    vf_search,
    )

from bzrlib.recordcounter import RecordCounter
from bzrlib.revisiontree import InventoryRevisionTree
from bzrlib.testament import Testament
from bzrlib.i18n import gettext
(terrors(tneeds_read_locktneeds_write_locktonly_raises(t	InventorytInventoryDirectorytROOT_IDt
entry_factory(t
CommitBuildertInterRepositorytMetaDirRepositorytRepositoryFormatMetaDirt
RepositorytRepositoryFormat(tmuttertVersionedFileRepositoryFormatcB@s2eZdZeZeZeZeZdZe	Z
RS(sDBase class for all repository formats that are VersionedFiles-based.t	unordered(t__name__t
__module__t__doc__tTruetsupports_full_versioned_filestsupports_versioned_directoriestsupports_unreferenced_revisionst_commit_inv_deltast_fetch_ordertFalset_fetch_uses_deltas(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRRstVersionedFileCommitBuildercB@seZdZeZeZeeeeeedZdZ	dZ
dZdZdZ
dZdZd	Zd
ZdZdZd
ZdZdZedZdZRS(sJCommit builder implementation for versioned files based repositories.
    c

C@stt|j|||||||||		y|jd}
Wntk
r[tj}
nX|
|_td|_
g|_tj
|jj|_t|_t|_dS(Ni(tsuperRt__init__tparentst
IndexErrort
_mod_revisiont
NULL_REVISIONtbasis_delta_revisionRtNonet
new_inventoryt_basis_deltatgrapht
HeadsCachet	get_graphtheadst"_VersionedFileCommitBuilder__headsRt_any_changest_recording_deletes(tselft
repositoryR!tconfig_stackt	timestampttimezonet	committertrevpropstrevision_idtlossytbasis_id((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR ps


			cC@s
t|_dS(sTell the commit builder that deletes are being notified.

        This enables the accumulation of an inventory delta; for the resulting
        commit to be valid, deletes against the basis MUST be recorded via
        builder.record_delete().
        N(RR/(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytwill_record_deletesscC@s|jS(sReturn True if any entries were changed.

        This includes merge-only changes. It is the core for the --unchanged
        detection in commit.

        :return: True if any changes have occured.
        (R.(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytany_changessc
C@sZ|jjsdS|jjjs1tjdng|jD]}|f^q;}|jjjj	|}t
g|D]}||krr|^qr}tt|jj}g|D]}d|df^q}g}xg|r=|r=|j
}	|	j|jj}
|jj}|
j|}|j||jj}qW|rVtjdndS(sREnsure that appropriate inventories are available.

        This only applies to repositories that are stacked, and is about
        enusring the stacking invariants. Namely, that for any revision that is
        present, we either have all of the file content, or we have the parent
        inventory and the delta file content.
        NsyCannot commit directly to a stacked branch in pre-2a formats. See https://bugs.launchpad.net/bzr/+bug/375013 for details.tinventoriesis9Unable to fill in parent inventories for a stacked branch(R1t_fallback_repositoriest_formatt
supports_chksRtBzrErrorR!R<t_indextget_parent_maptsettlisttreversedtpopt_get_sourcet	_get_sinktget_stream_for_missing_keystinsert_stream_without_locking(
R0tptparent_keyst
parent_maptpktmissing_parent_keystfallback_repostmissing_keyst
resume_tokenst
fallback_repotsourcetsinktstream((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_ensure_fallback_inventoriess* 	cC@s|j|dtjd|jd|jd|jd|d|jd|jd|j}|j	|_
|jjd	t
jkrt||j}|j}|jjtj|j||jn|jj||j|jj|jS(
s\Make the actual commit.

        :return: The revision id of the recorded revision.
        scommit messageR3R4R5tmessagetinventory_sha1R7t
propertiestcreate_signatures(t_validate_unicode_textR#tRevisiont
_timestampt	_timezonet
_committertinv_sha1t_new_revision_idt	_revpropsR!t
parent_idst
_config_stacktgett_mod_configtSIGN_ALWAYSt	Testamentt
revision_treet
as_short_textR1tstore_revision_signaturetgpgtGPGStrategyt
_add_revisionRWtcommit_write_group(R0RXtrevt	testamentt	plaintext((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytcommits(							


cC@s|jjdS(s.Abort the commit that is being built.
        N(R1tabort_write_group(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytabortscC@sC|jdkr*|jj|j|_nt|j|j|jS(sWReturn the tree that was just committed.

        After calling commit() this can be called to get a
        RevisionTree representing the newly committed tree. This is
        preferred to calling Repository.revision_tree() because that may
        require deserializing the inventory, while we already have a copy in
        memory.
        N(R'R&R1t
get_inventoryRbtInventoryRevisionTree(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRjs
		cC@s|jdkrH|j}|jj||j|j|j\|_}np|jj	dkrt
d|jjtt
ddn|j|j_|jj|j|j|j|_|jS(sTell the builder that the inventory is finished.

        :return: The inventory id in the repository, which can be used with
            repository.get_inventory.
        sGRoot entry should be supplied to record_entry_contents, as of bzr 0.10.tN(R'R&R%R1tadd_inventory_by_deltaR(RbR!RatroottAssertionErrortaddRRR7t
add_inventory(R0R9t_((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytfinish_inventorys			cC@s|j|_dS(sHelper for record_entry_contents.

        :param ie: An entry being added.
        :param parent_invs: The inventories of the parent revisions of the
            commit.
        :param tree: The tree that is being committed.
        N(Rbtrevision(R0tietparent_invsttree((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_check_rootscC@srt|jdkr$tjntd|jddd}|j|_|j	j
dd|j|fdS(sEnforce an appropriate root object change.

        This is called once when record_iter_changes is called, if and only if
        the root was not in the delta calculated by record_iter_changes.

        :param tree: The tree which is being committed.
        it	directoryRyN(tlenR!RtRootMissingR	tpath2idR&RbRR(tappendtfile_id(R0Rtentry((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_require_root_changes	cC@s|j|js;d||j|f}|jj||S|||jkr|j|j||j|f}|jj||SdSdS(s/Get a delta against the basis inventory for ie.N(thas_idRR&R(Rtid2path(R0Rt	basis_invtpathtresult((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt
_get_delta#s!cC@s
|j|S(sCalculate the graph heads for revision_ids in the graph of file_id.

        This can use either a per-file graph or a global revision graph as we
        have an identity relationship between the two graphs.
        (R-(R0Rtrevision_ids((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_heads4scC@s|jstdn|jS(sReturn the complete inventory delta versus the basis inventory.

        This has been built up with the calls to record_delete and
        record_entry_contents. The client must have already called
        will_record_deletes() to indicate that they will be generating a
        complete delta.

        :return: An inventory delta, suitable for use with apply_delta, or
            Repository.add_inventory_by_delta, etc.
        s recording deletes not activated.(R/R|R((R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytget_basis_delta<s	cC@sG|jstdn|d|df}|jj|t|_|S(sRecord that a delete occured against a basis tree.

        This is an optional API - when used it adds items to the basis_delta
        being accumulated by the commit builder. It cannot be called unless the
        method will_record_deletes() has been called to inform the builder that
        a delta is being supplied.

        :param path: The path of the thing deleted.
        :param file_id: The file id that was deleted.
        s recording deletes not activated.N(R/R|R&R(RRR.(R0RRtdelta((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt
record_deleteKs		cC@s}|jjdkrF|jdk	r0tjn|j|||n|jdkrb|d}n	|j}|dkr|j	j
jrtdn|jj
|y|d}Wn tk
rtdd}nX|jdk	r|jrd|dkrd|j|jr2|j|j||j|f}nd||j|f}|jj||tdfS|j|jkrtd||jfndtdfSn|j|}	|j|j|	j}
g}xp|D]h}|j|jr||jj}
|
|
kr@|j||jj|
j||jjq@qqWt}t|dkret}n|s|	|d}|j|jks|j|jkrt}qn|s||jkrt}qnd}|dkrz|d	dkrt d
n|s|j!|d	krt}q|j"|dkr||j|_|j#|_#|j"|_"|j!|_!|j$|||tdfS|j"}n|rd}n|d	|_!|j%|j|\}}z|j&}Wd|j'Xy:|j(|j|||\|_"|_#|j"|f}Wq+tj)k
rv|j|_|j#|_#|j"|_"|j!|_!|j$|||tdfSXn|d
kr|s|j|_|j$|||tdfS|j(|jd|dn[|dkrf|d}|s||j*krt}qn|sA|j|_|j*|_*|j$|||tdfS||_*|j(|jd|dn|dkr|s|d|j+krt}qn|s|j+|_+|j|_|j$|||tdfS|d|_+|j+dkrtd|fn|j(|jd|dntd|j|_|j,t-j.ksU|dkrat|_/n|j$|||t|fS(sZRecord the content of ie from tree into the commit if needed.

        Side effect: sets ie.revision when unchanged

        :param ie: An inventory entry present in the commit.
        :param parent_invs: The inventories of the parent revisions of the
            commit.
        :param path: The path the entry is at in the tree.
        :param tree: The tree which contains this entry and should be used to
            obtain content.
        :param content_summary: Summary data from the tree about the paths
            content - stat, length, exec, sha/link target. This is only
            accessed when the entry has a revision of None - that is when it is
            a candidate to commit.
        :return: A tuple (change_delta, version_recorded, fs_hash).
            change_delta is an inventory_delta change for this entry against
            the basis tree of the commit, or None if no change occured against
            the basis tree.
            version_recorded is True if a new version of the entry has been
            recorded. For instance, committing a merge where a file was only
            changed on the other side will return (delta, False).
            fs_hash is either None, or the hash details for the path (currently
            a tuple of the contents sha1 and the statvalue returned by
            tree.get_file_with_stat()).
        istree-references#Missing repository subtree support.troot_idRys_Impossible situation, a skipped inventory entry (%r) claims to be modified in this commit (%r).itfileis%Files must not have executable = NoneiNRtsymlinks+invalid content_summary for nested tree: %rsunknown kind(0R'R{R&t	parent_idRRRRtkindR1R>tsupports_tree_referencetNotImplementedErrorR}R"Rt_versioned_rootRRRR(RRRbR|tparent_candidatesRtkeystremoveRRtnamet
ValueErrort
executablet	text_sha1t	text_sizeRtget_file_with_stattreadtcloset_add_text_to_weavetExistingContenttsymlink_targettreference_revisionR%R#R$R.(R0RRRRtcontent_summaryRRRtparent_candidate_entriesthead_setR,tinvtold_revtstoretparent_entrytfingerprinttnostore_shatfile_objt
stat_valuettexttcurrent_link_target((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytrecord_entry_contents]s
	


!			
! 
	
c%
c@si}i}t}yt|jj|j}Wntjk
rg}x}|jD]n}	y|j|jj|	WqTtjk
r|st	j
}t}n|j|jjt	j
qTXqTWnX|r|d}
n|jjt	j
}
|
j}t
|jdkrq||jdkr9|r9tdnx;|dD]&}x|jj|D]	}
|
ddkryq]n|
d|kr-|
ddk	r||
d}|j|
djg||
d<i||j6|
d|
dj6||
d<qf|
djg||
d<i|
d|
dj6||
d<q]||
dj|
dj|
d||
d|
dj<q]WqDWni}i}xc|D][}
|
dddk	r||
djg}ng}|
|j|
d|f||
d<qWt|t|}x|D]}y||}Wntjk
r*qX||j||j|ftttf|j|jf|j|jf|j|jf|j|jff}
|
||f||<qWt}|j}|j}xP|jD]B\}
}|
ddr|
dd}|
d}||||
dd|
dd}|j|
dt|}g}x7|D]/}||krU|j||j|qUqUWt}t
|dkr4|j|d}|r|j|dd}nd}|dkrt}q:|j|jks"|j|jks"|j|jkr+t}q:t}nt}|d	krP|
d
dr`t|_n	t|_|r|j|jkr|j}nd}|j ||
dd\} }!z| j!}"Wd| j"XyG|j#||"||\|_|_$||
dd|j|!ffVWqtj%k
rLt}|j$|_$|j|_qXnW|dkr|j&||_'|r|j'|j'krt}q|j#|
dd
|dn|dkr
|rt}q|
ddd
ks|jj(r|j#|
dd
|dqn|dkr|jj)j*s@tj+|j,|jn|j-|
d}#|#|_.|rz|j.|#krzt}q|j#|
dd
|dnt/d||s||_q|j|_nd}|
dd}$|j|
dd|$|
d|f|$d
krt}qqWd|_0t
|dkrD|t	j
kset
|dkrq|t	j
krqt|_1n|s|j2|n||_3dS(sbRecord a new tree via iter_changes.

        :param tree: The tree to obtain text contents from for changed objects.
        :param basis_revision_id: The revision id of the tree the iter_changes
            has been generated against. Currently assumed to be the same
            as self.parents[0] - if it is not, errors may occur.
        :param iter_changes: An iter_changes iterator with the changes to apply
            to basis_revision_id. The iterator must not include any items with
            a current kind of None - missing items must be either filtered out
            or errored-on before record_iter_changes sees the item.
        :param _entry_factory: Private method to bind entry_factory locally for
            performance.
        :return: A generator of (file_id, relpath, fs_hash) tuples for use with
            tree._observed_sha1.
        is5arbitrary basis parents not yet supported with mergesiiiiiiRiNRRyRstree-referencesunknown kind %r(4RRDR1trevision_treesR!RtNoSuchRevisionRRjR#R$Rtroot_inventoryRt	Exceptiont_make_deltaR&RRfRCtNoSuchIdRRRRRR(RbtvaluesRRRRRRRRRtget_symlink_targetRtsupports_rich_rootR>RtUnsupportedOperationt
add_referencetget_reference_revisionRR|R'R.RR%(%R0Rtbasis_revision_idtiter_changest_entry_factoryt
merged_idstparent_entriestghost_basistrevtreesR7t
basis_treeRtrevtreetchangetbasis_entrytchangesthead_candidatetunchanged_mergedRt	seen_roott	inv_deltatmodified_revthead_candidatesRRRR,tcarried_overtparent_entry_revsRtcarry_over_possibleRRRRRtnew_path((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytrecord_iter_changes2s*		
		
 #(

		


				 #		# 		%
	!!cC@s]tg|D]}||f^q
}|jjj||jf||d|d|jdd!S(NRt	random_idii(ttupleR1ttextst	_add_textRbtrandom_revid(R0Rtnew_textR!RtparentRL((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRCs%(RRRRtsupports_record_entry_contentsRRR&R R:R;RWRtRvRjRRRRRRRRR	RR(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRfs.				
	#					
						tVersionedFileRootCommitBuildercB@s&eZdZeZdZdZRS(s/This commitbuilder actually records the root idcC@sdS(sHelper for record_entry_contents.

        :param ie: An entry being added.
        :param parent_invs: The inventories of the parent revisions of the
            commit.
        :param tree: The tree that is being committed.
        N((R0RRR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRPscC@sdS(sEnforce an appropriate root object change.

        This is called once when record_iter_changes is called, if and only if
        the root was not in the delta calculated by record_iter_changes.

        :param tree: The tree which is being committed.
        N((R0R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRYs(RRRRRRR(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRJs		tVersionedFileRepositorycB@seZdZeZdZeejej	dZ
dZdZd:edZedZd:dZdZd	Zd
ZdZdZed
ZdZd:ed:dZed:d:dZd:d:d:d:d:edZedZedZedZ edZ!edZ"dZ#e$dZ%dZ&dZ'dZ(dZ)d:dZ*dZ+d:d:dZ,d Z-d:d!Z.d"Z/d#Z0ed$Z1d:d%Z2d&Z3d'Z4d(Z5d)Z6ed*Z7ed+Z8d,Z9d-Z:d.Z;ed/Z<ed0Z=d1Z>d:d:d2Z?ed3Z@ed4ZAed5ZBd:d6ZCd7ZDd8ZEd9ZFRS(;skRepository holding history for one or more branches.

    The repository holds and retrieves historical information including
    revisions and file history.  It's normally accessed only by the Branch,
    which views a particular line of development through that history.

    The Repository builds on top of some byte storage facilies (the revisions,
    signatures, inventories, texts and chk_bytes attributes) and a Transport,
    which respectively provide byte storage and a means to access the (possibly
    remote) disk.

    The byte storage facilities are addressed via tuples, which we refer to
    as 'keys' throughout the code base. Revision_keys, inventory_keys and
    signature_keys are all 1-tuples: (revision_id,). text_keys are two-tuples:
    (file_id, revision_id). chk_bytes uses CHK keys - a 1-tuple with a single
    byte string made up of a hash identifier and a hash value.
    We use this interface because it allows low friction with the underlying
    code that implements disk indices, network encoding and other parts of
    bzrlib.

    :ivar revisions: A bzrlib.versionedfile.VersionedFiles instance containing
        the serialised revisions for the repository. This can be used to obtain
        revision graph information or to access raw serialised revisions.
        The result of trying to insert data into the repository via this store
        is undefined: it should be considered read-only except for implementors
        of repositories.
    :ivar signatures: A bzrlib.versionedfile.VersionedFiles instance containing
        the serialised signatures for the repository. This can be used to
        obtain access to raw serialised signatures.  The result of trying to
        insert data into the repository via this store is undefined: it should
        be considered read-only except for implementors of repositories.
    :ivar inventories: A bzrlib.versionedfile.VersionedFiles instance containing
        the serialised inventories for the repository. This can be used to
        obtain unserialised inventories.  The result of trying to insert data
        into the repository via this store is undefined: it should be
        considered read-only except for implementors of repositories.
    :ivar texts: A bzrlib.versionedfile.VersionedFiles instance containing the
        texts of files and directories for the repository. This can be used to
        obtain file texts or file graphs. Note that Repository.iter_file_bytes
        is usually a better interface for accessing file texts.
        The result of trying to insert data into the repository via this store
        is undefined: it should be considered read-only except for implementors
        of repositories.
    :ivar chk_bytes: A bzrlib.versionedfile.VersionedFiles instance containing
        any data the repository chooses to store or have indexed by its hash.
        The result of trying to insert data into the repository via this store
        is undefined: it should be considered read-only except for implementors
        of repositories.
    :ivar _transport: Transport for file access to repository, typically
        pointing to .bzr/repository.
    cC@s|jjs'tj|j|jn|j||jrM|jn|jj	||j
j|j
|jj|j|j
j|j
|jj|j|jdk	r|jj|jndS(spAdd a repository to use for looking up data not held locally.

        :param repository: A repository.
        N(R>tsupports_external_lookupsRtUnstackableRepositoryFormattbaset_check_fallback_repositoryt	is_lockedt	lock_readR=RRtadd_fallback_versioned_filesR<t	revisionst
signaturest	chk_bytesR&(R0R1((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytadd_fallback_repositorys

cC@s9tt|j|jjdkr5|jjndS(Ni(RRtunlockt
control_filest_lock_countt_inventory_entry_cachetclear(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRscC@s|js"td|fntj||jdkpJ|j|ksitd|j|fn|jdkrtjn|j	|||S(slAdd the inventory inv to the repository as revision_id.

        :param parents: The revision ids of the parents that revision_id
                        is known to have and are in the repository already.

        :returns: The validator(which is a sha1 digest, though what is sha'd is
            repository format specific) of the serialized inventory.
        s%r not in write groupsCMismatch between inventory revision id and insertion revid (%r, %r)N(
tis_in_write_groupR|R#tcheck_not_reserved_idR7R&R{RRt_add_inventory_checked(R0R7RR!((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR~s	
cC@s+|jj|}|j|||dtS(sAdd inv to the repository after checking the inputs.

        This function can be overridden to allow different inventory styles.

        :seealso: add_inventory, for the contract.
        t
check_content(t_serializertwrite_inventory_to_linest_inventory_add_linesR(R0R7RR!t	inv_lines((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRscC@s|js"td|fntj||j|}|jzK|dkrc|j}n|j|||_	|j
||||fSWd|jXdS(sAdd a new inventory expressed as a delta against another revision.

        See the inventory developers documentation for the theory behind
        inventory deltas.

        :param basis_revision_id: The inventory id the delta was created
            against. (This does not have to be a direct parent.)
        :param delta: The inventory delta (see Inventory.apply_delta for
            details).
        :param new_revision_id: The revision id that the inventory is being
            added for.
        :param parents: The revision ids of the parents that revision_id is
            known to have and are in the repository already. These are supplied
            for repositories that depend on the inventory graph for revision
            graph access, as well as for those that pun ancestry with delta
            compression.
        :param basis_inv: The basis inventory if it is already known,
            otherwise None.
        :param propagate_caches: If True, the caches for this inventory are
          copied to and updated for the result if possible.

        :returns: (validator, new_inv)
            The validator(which is a sha1 digest, though what is sha'd is
            repository format specific) of the serialized inventory, and the
            resulting inventory.
        s%r not in write groupN(RR|R#RRjRR&Rtapply_deltaR7R~R(R0RRtnew_revision_idR!Rtpropagate_cachesR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRzs


	cC@sUg|D]}|f^q}|jj|f||d|d}|jjj|S(s;Store lines in inv_vf and return the sha1 of the inventory.Ri(R<t	add_linest_accesstflush(R0R7R!tlinesRRR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR	s

cC@stj||jj|fgsg|dkrItj||jq|j|||j|_	n%|f}|jj
|g||_	|j|dS(sAdd rev to the revision store as revision_id.

        :param revision_id: the revision id to use.
        :param rev: The revision object.
        :param inv: The inventory for the revision. if None, it will be looked
                    up in the inventory storer
        N(R#RR<RBR&RtWeaveRevisionNotPresentR~RdRYt	get_sha1sRo(R0R7RqRtkey((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytadd_revisions

		cC@sZ|jj|}|jf}td|jD}|jj||tj|dS(Ncs@s|]}|fVqdS(N((t.0R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pys	<genexpr>.s(	Rtwrite_revision_to_stringR7RRdRRtosutilstsplit_lines(R0RRRR!((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRo+scC@s5tjj}z|j||Wd|jXdS(sCheck the inventories found from the revision scan.
        
        This is responsible for verifying the sha1 of inventories and
        creating a pending_keys set that covers data referenced by inventories.
        N(tuit
ui_factorytnested_progress_bart_do_check_inventoriestfinished(R0tcheckertbar((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_check_inventories1sc
C@sd}itd6td6td6}ddg}t|j}|jtddd|j}i|_xa|D]Y}|ddkr|d|kr|jjd|fn||dj|dqwW|drdd}	xs|j	j
d|dD]X}
|
jd	kr0|jjd
|
jfq|j
d|
||	|d
|
j}	qW|d=ndS|jtddx;|js|ds|dr|j}i|_xQ|D]I}|d|kr|jjd|fn||dj|dqWx|D]}||rd}	xt||j
d||D]^}
|
jd	krv|jjd||
jfqA|j
||
||	||f|
j}	qAWt||<PqqWqWdS(sHelper for _check_inventories.iRR<Risunknown key type %riRtabsentsMissing inventory {%s}NsMissing %s {%s}(sinventories(RCRtpending_keystupdatetgettextt
_report_itemsRR}R&R<tchecktstorage_kindRt
_check_recordtgetattr(R0RRtrevnoRtkindstcounttcurrent_keysRtlast_objecttrecordR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR=sT$		
 
 	

		


&	!
c
C@sC|dkr|jd}|j||jd}|dk	r|j|}xr|D]7\}	}
}}|dkrzqVn|j|||qVWn0x-|jD]\}
}|j|||qW|jjr?|Snh|dkr|j	j
d|jfn?|dkr"|j|||n|j	j
d||jfdS(	s)Check a single text from this repository.R<itfulltextRs%unsupported key type chk_bytes for %sRsunknown key type %s for %sN(Rt_deserialise_inventorytget_bytes_asR&RRtiter_entriesR>tfast_deltasRRt_check_text(
R0RR(RR't	item_datatrev_idRRtold_pathRRR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR!vs*
			cC@s|jdkrH|j|j}tj|}ttt|}n*|jd}tj|}t|}|r||dkr|jj	d|j
||d|dfndS(sCheck a single text.tchunkedR)is:sha1 mismatch: %s has sha1 %s expected %s referenced by %siN(R R+Rtsha_stringstsumtmapRt
sha_stringRRR(R0R(RR/tchunkstsha1tlengthtcontent((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR.s	cC@s+g}|j}|j|}|jS(swCheck every revision id in revision_ids to see if we have it.

        Returns a set of the present revisions.
        (R+RBR(R0RRR)RM((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt _eliminate_revisions_not_presentscC@sqtt|j||||j|_|jj|_t|_t|_t|_	t
jd|_t|_
dS(sInstantiate a VersionedFileRepository.

        :param _format: The format of the repository on disk.
        :param controldir: The ControlDir of the repository.
        :param control_files: Control files to use for locking, etc.
        i
iNi((RRR t
_transportRRt_reconcile_does_inventory_gcRt_reconcile_fixes_text_parentst_reconcile_backsup_inventoryt
fifo_cachet	FIFOCacheRt_safe_to_return_from_cache(R0R>ta_bzrdirR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR s
			cC@s|d	k	r'|d	k	r'tdn|jrEtjdn|j|r|d	kr|j|r|d	k	rtj|r|j	|ndgfSt
j||}|d	k	rt|dt
rtjd|n|jd|d|d|S(
sFetch the content required to construct revision_id from source.

        If revision_id is None and fetch_spec is None, then all content is
        copied.

        fetch() may not be used when the repository is in a write group -
        either finish the current write group before using fetch, or use
        fetch before starting the write group.

        :param find_ghosts: Find and copy revisions in the source that are
            ghosts in the target (and not reachable directly by walking out to
            the first-present revision in target from revision_id).
        :param revision_id: If specified, all the content needed for this
            revision ID will be copied to the target.  Fetch will determine for
            itself which content needs to be copied.
        :param fetch_spec: If specified, a SearchResult or
            PendingAncestryResult that describes which revisions to copy.  This
            allows copying multiple heads at once.  Mutually exclusive with
            revision_id.
        s2fetch_spec and revision_id are mutually exclusive.s%May not fetch while in a write group.itsupports_fetch_specsfetch_spec not supported for %rR7tfind_ghostst
fetch_specN(R&R|RRtInternalBzrErrorthas_same_locationt_has_same_fallbacksR#tis_nulltget_revisionRRfR"RRtfetch(R0RTR7RERFtinter((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRLs(
cC@sJtt|j||}|jjrFt|jj|d<n|S(sSee Repository.gather_stats().R(RRtgather_statstuser_transporttlistableRRR(R0trevidt
committersR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRNsc

C@s]|jr(|jjr(tjdn|j|||||||||		}
|j|
S(sObtain a CommitBuilder for this repository.

        :param branch: Branch to commit to.
        :param parents: Revision ids of the parents of the new revision.
        :param config_stack: Configuration stack to use.
        :param timestamp: Optional timestamp recorded for commit.
        :param timezone: Optional timezone for timestamp.
        :param committer: Optional committer to set for commit.
        :param revprops: Optional dictionary of revision properties.
        :param revision_id: Optional revision id.
        :param lossy: Whether to discard data that can not be natively
            represented, when pushing to a foreign VCS
        syCannot commit directly to a stacked branch in pre-2a formats. See https://bugs.launchpad.net/bzr/+bug/375013 for details.(R=R>R?RR@t_commit_builder_clasststart_write_group(R0tbranchR!R2R3R4R5R6R7R8R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytget_commit_builders	
c@s|jjstS|js.tdnt|jjj}|jt	j
|jj}|jd|D}|j
|t|dkrtS|std|DS|jjj}|j|td|jD}|j|}t}x7|jD])\}	|jfd|	DqW|jj|}
|j
|
|sqtStd|D}|S(sReturn the keys of missing inventory parents for revisions added in
        this write group.

        A revision is not complete if the inventory delta for that revision
        cannot be calculated.  Therefore if the parent inventories of a
        revision are not present, the revision is incomplete, and e.g. cannot
        be streamed by a smart server.  This method finds missing inventory
        parents for revisions added in this write group.
        snot in a write groupcs@s|]}|dVqdS(iN((RR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pys	<genexpr>5sics@s|]\}d|fVqdS(R<N((RR0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pys	<genexpr>;scs@s|]}|dVqdS(iN((Rtr((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pys	<genexpr>Dsc3@s|]}|fVqdS(N((Rt
version_id(R(s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pys	<genexpr>Iscs@s|]\}d|fVqdS(R<N((RR0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pys	<genexpr>Rs(R>RRCRR|RRAtget_missing_parentstdiscardR#R$R<RBtdifference_updateRt_key_dependenciestsatisfy_refs_for_keyst	frozensett
get_referrerstfileids_altered_by_revision_idst	iteritemsRR(R0tcheck_for_missing_textsR!tunstacked_inventoriestpresent_inventoriestkey_depst	referrerstfile_idst
missing_textstversion_idst
present_textsRQ((Rs8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytget_missing_parent_inventoriess8


	
cC@s{|jjg|D]}|f^q}t}tj|krS|jtjn|jg|D]}|d^q`|S(sProbe to find out the presence of multiple revisions.

        :param revision_ids: An iterable of revision_ids.
        :return: A set of the revision_ids that were present.
        i(RRBRCR#R$R}R(R0RR0RMRR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt
has_revisionsUs		$cC@s|j|gdS(sV'reconcile' helper routine that allows access to a revision always.

        This variant of get_revision does not cross check the weave graph
        against the revision one as get_revision does: but it should only
        be used by reconcile, or reconcile-alike commands that are correcting
        or testing the revision graph.
        i(t_get_revisions(R0R7((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytget_revision_reconcileds	cC@s
|j|S(sGet many revisions at once.
        
        Repositories that need to check data on every revision read should 
        subclass this method.
        (Rm(R0R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt
get_revisionsoscC@sli}xH|j|D]7\}}|dkrCtj||n|||<qWg|D]}||^qXS(s<Core work logic to get many revisions without sanity checks.N(t_iter_revisionsR&RR(R0RtrevsRQRq((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRmxsc
c@s|dkr|j}nCx@|D]8}|s?t|tr"tjd|d|q"q"Wg|D]}|f^qe}|jj|dt}xd|D]\}|j	d}|j
dkr|dfVq|jd}|jj
|}	||	fVqWdS(sIterate over revision objects.

        :param revision_ids: An iterable of revisions to examine. None may be
            passed to request all revisions known to the repository. Note that
            not all repositories can find unreferenced revisions; for those
            repositories only referenced ones will be returned.
        :return: An iterator of (revid, revision) tuples. Absent revisions (
            those asked for but not available) are returned as (revid, None).
        R7RURiRR)N(R&tall_revision_idst
isinstancet
basestringRtInvalidRevisionIdRtget_record_streamRRR R+Rtread_revision_from_string(
R0RR0RRRVR(RQRRq((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRps



cC@s&|jj|fdtj|dS(sStore a signature text for a revision.

        :param revision_id: Revision id of the revision
        :param signature: Signature text.
        N((RRRR(R0R7t	signature((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytadd_signature_textscC@s\|jj}|j}tjj}z#|jj|j|d|SWd|j	XdS(s`Find the text key references within the repository.

        :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. The inventory texts from all present
            revision ids are assessed to generate this report.
        tpbN(
RRR<RRRRt_find_text_key_referencest#iter_lines_added_or_present_in_keysR(R0t
revision_keystwRz((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytfind_text_key_referencess		cc@s|jj|dt}xg|D]_}|jdkr|jd}|jd}tj|}x|D]}||fVqfWqqWdS(sGet a line iterator of the sort needed for findind references.

        Not relevant for non-xml inventory repositories.

        Ghosts in revision_keys are ignored.

        :param revision_keys: The revision keys for the inventories to inspect.
        :return: An iterator over (inventory line, revid) for the fulltexts of
            all of the xml inventories specified by revision_keys.
        RRR2iN(R<RvRR R+RRtchunks_to_lines(R0RRVR(R7RQR	tline((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_inventory_xml_lines_for_keyss


c
C@st|jj|j}|j|}t|jj|j|}||}i}|j}x/|D]'}	||	dtj|	dqnW|S(sHelper routine for fileids_altered_by_revision_ids.

        This performs the translation of xml lines to revision ids.

        :param line_iterator: An iterator of lines, origin_version_id
        :param revision_keys: The revision ids to filter for. This should be a
            set or other type which supports efficient __contains__ lookups, as
            the revision key from each parsed line will be looked up in the
            revision_keys filter.
        :return: a dictionary mapping altered file-ids to an iterable of
            revision_ids. Each altered file-ids has the exact revision_ids that
            altered it listed explicitly.
        ii(RCRR{titerkeyst_find_parent_keys_of_revisionsRt
setdefaultR}(
R0t
line_iteratorR}tseenRLtparent_seentnew_keysRRR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt'_find_file_ids_from_xml_inventory_liness
	
%cC@sR|jj|}t}t|j|j|j||jtj	|S(sSimilar to _find_parent_ids_of_revisions, but used with keys.

        :param revision_keys: An iterable of revision_keys.
        :return: The parents of all revision_keys that are not already in
            revision_keys
        (
RRBRCR5Rt
itervaluesR[RZR#R$(R0R}RMRL((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs	
cC@sDtd|D}|p"|j}|j|j|dd|S(sFind the file ids and versions affected by revisions.

        :param revisions: an iterable containing revision ids.
        :param _inv_weave: The inventory weave from this repository or None.
            If None, the inventory weave will be opened automatically.
        :return: a dictionary mapping altered file-ids to an iterable of
            revision_ids. Each altered file-ids has the exact revision_ids that
            altered it listed explicitly.
        cs@s|]}|fVqdS(N((RRQ((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pys	<genexpr>sRzN(RCR<RR|R&(R0Rt
_inv_weavet
selected_keysR~((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR`s
cc@si}x'|D]\}}}||||f<q
Wxm|jj|dtD]S}|jdkrtj|jd|jdn||j|jdfVqIWdS(s,Iterate through file versions.

        Files will not necessarily be returned in the order they occur in
        desired_files.  No specific order is guaranteed.

        Yields pairs of identifier, bytes_iterator.  identifier is an opaque
        value supplied by the caller as part of desired_files.  It should
        uniquely identify the file version in the caller's context.  (Examples:
        an index number or a TreeTransform trans_id.)

        bytes_iterator is an iterable of bytestrings for the file.  The
        kind of iterable and length of the bytestrings are unspecified, but for
        this implementation, it is a list of bytes produced by
        VersionedFile.get_record_stream().

        :param desired_files: a list of (file_id, revision_id, identifier)
            triples
        RRiiR2N(RRvRR RtRevisionNotPresentRR+(R0t
desired_filest	text_keysRR7t
callable_dataR(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytiter_files_bytess#cC@s|dkr0|j}|j|j}n|dkrK|j}ntjj}z|j|||SWd|j	XdS(s^Generate a new text key index for the repository.

        This is an expensive function that will take considerable time to run.

        :return: A dict mapping text keys ((file_id, revision_id) tuples) to a
            list of parents, also text keys. When a given key has no parents,
            the parents list will be [NULL_REVISION].
        N(
R&R+RBRrRRRRt_do_generate_text_key_indexR(R0ttext_key_referencest	ancestorsR)Rz((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_generate_text_key_index!s	c
@s3tj|}t}i}x|D]}t||<q%Wt|}i}	xO|jD]A\}
}|s}|j|
n||
dj|
|
|	|
<q[W~i}tjtj|}
t	j
}tjd}d}t||d}d}|j
td||xt|D]}||||d|!}|sHPnx|D]}||}x||D]}
|j
td||d7}gx|D]}|
d|f}y|||k}Wntk
rt}d}nX|ry||}Wn-tk
r*|j|j}|||<nXy||
d}Wn ttjfk
r_d}nX|dk	r|
d|jf}qd}n|dk	rj|	|qqW|
j}t|}|jdfd|gkr|g}n|||
<qjWqOWqWx|D]}
|g||
<qW|S(s:Helper for _generate_text_key_index to avoid deep nesting.ii
isCalculating text parentsRc@s
j|S(N(tindex(tx(tcandidate_parents(s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt<lambda>sN(ttsortt	topo_sortRCRRaR}R)tGraphtDictParentsProviderR#R$t	lru_cachetLRUCacheRRtxrangetKeyErrorRR&RjRRRRRR,RDtsort(R0RRRztrevision_ordertinvalid_keysR}R7t
text_countttext_key_cachettext_keytvalidt
text_indext
text_graphR$tinventory_cachet
batch_sizetbatch_counttprocessed_textstoffsettto_queryRdRtparent_text_keytcheck_parentRRtparent_headstnew_parents((Rs8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR8s	
	







	
cc@sHx|j||D]}|VqW~x|j|D]}|Vq5WdS(sGet an iterable listing the keys of all the data introduced by a set
        of revision IDs.

        The keys will be ordered so that the corresponding items can be safely
        fetched and inserted in that order.

        :returns: An iterable producing tuples of (knit-kind, file-id,
            versions).  knit-kind is one of 'file', 'inventory', 'signatures',
            'revisions'.  file-id is None unless knit-kind is 'file'.
        N(t_find_file_keys_to_fetcht_find_non_file_keys_to_fetch(R0Rt	_files_pbR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytitem_keys_introduced_bys
	c	c@s|j}|j||}d}t|}xZ|jD]L\}}|dk	rn|jtd||n|d7}d||fVq:WdS(NisFetch textsiR(R<R`RRaR&RR(	R0RRztinv_wRgR%tnum_file_idsRtaltered_versions((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs	
cc@sdd|fVt|jjg|D]}|f^q!}tg|D]\}|^qF}|j|dd|fVdd|fVdS(Nt	inventoryRR(R&RCRRBtintersection_update(R0RRWtrevisions_with_signatures((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs"
cC@s|j|gjS(s$Get Inventory object by revision id.(titer_inventoriestnext(R0R7((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRwscc@swd|kstj|kr*tdnxF|j||D]2\}}|dkrjtj||n|Vq=WdS(sGet many inventories by revision_ids.

        This will buffer some or all of the texts used in constructing the
        inventories in memory, but will only parse a single inventory at a
        time.

        :param revision_ids: The expected revision ids of the inventories.
        :param ordering: optional ordering, e.g. 'topological'.  If not
            specified, the order of revision_ids will be preserved (by
            buffering if necessary).
        :return: An iterator of inventories.
        s"cannot get null revision inventoryN(R&R#R$Rt_iter_inventoriesRR(R0RtorderingRRQ((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs
cc@s^|j||}xE|D]=\}}|dkr?d|fVq|j|||fVqWdS(s*single-document based inventory iteration.N(t_iter_inventory_xmlsR&R*(R0RRtinv_xmlsRR7((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs
cc@sm|dkrt}d}nt}g|D]}|f^q(}|sGdS|rht|}|j}n|jj||t}i}	x|D]}
|
jdkr|
jd}|r||	|
j	<qdj
||
j	dfVnd|
j	dfV|rxe||	kra|	j|}dj
||dfVy|j}Wqtk
r]d}PqXqWqqWdS(NRRR2Ryi(
R&RRtiterRR<RvR R+RtjoinRFt
StopIteration(R0RRtorder_as_requestedR7Rtkey_itertnext_keyRVttext_chunksR(R7((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs8	

cC@sV|jj||d|jd|j}|j|krRtd|j|fn|S(sTransform the xml into an inventory object.

        :param revision_id: The expected revision id of the inventory.
        :param xml: A serialised inventory.
        tentry_cachetreturn_from_cachesrevision id mismatch %s != %s(Rtread_inventory_from_stringRRBR7R|(R0R7txmlR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR*s	cC@s
|jjS(N(Rt
format_num(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytget_serializer_formatscC@sL|j|gd}|j\}}|dkrHtj||n|S(s%Get serialized inventory as a string.RN(RRR&RR(R0R7RR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_get_inventory_xmls
cC@s]tj|}|tjkr:t|tddtjS|j|}t|||SdS(s|Return Tree for a revision on this branch.

        `revision_id` may be NULL_REVISION for the empty tree revision.
        RN(R#tensure_nullR$RxRR&Rw(R0R7R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRj"scc@s8|j|}x"|D]}t|||jVqWdS(sReturn Trees for revisions in this repository.

        :param revision_ids: a sequence of revision-ids;
          a revision-id may not be None or 'null:'
        N(RRxR7(R0RR<R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR2s
cc@sG|j|}x1|D])}|j|}t|||jVqWdS(sRReturn Tree for a revision on this branch with only some files.

        :param revision_ids: a sequence of revision-ids;
          a revision-id may not be None or 'null:'
        :param file_ids: if not None, the result is filtered
          so that only those file-ids, their parents and their
          children are included.
        N(RtfilterRxR7(R0RRgR<Rtfiltered_inv((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_filtered_revision_trees<s	
cC@sg}i}xU|D]M}|tjkr5d||<q|dkrPtdq|j|fqWxh|jj|jD]N\\}}|rtg|D]\}|^q||<q}tjf||<q}W|S(s/See graph.StackedParentsProvider.get_parent_maps!get_parent_map(None) is not valid(N(	R#R$R&RRRRBRaR(R0Rt
query_keysRR7RLtparent_revid((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRBLs

%#cC@sMtj}g|D]}||j^q}|jj|}tj|S(sNReturn the known graph for a set of revision ids and their ancestors.
        (tstatic_tupletStaticTupletinternRtget_known_graph_ancestryR)tGraphThunkIdsToKeys(R0Rtsttr_idR}tknown_graph((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRbs	%cC@stj|jS(s+Return the graph walker for text revisions.(R)RR(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytget_file_graphkscC@st}x0|jj|jD]}|j|q%W|j|}|j|}|j|}tj||t	||}|S(s6Convert a set of revision ids to a graph SearchResult.(
RCR+RBRRtintersectiont
differencet	vf_searchtSearchResultR(R0t
result_settresult_parentsR!t
included_keyst
start_keystexclude_keysR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytrevision_ids_to_search_resultps	cC@st|d|d|S(sReturn an object suitable for checking versioned files.
        
        :param text_key_references: if non-None, an already built
            dictionary mapping text keys ((fileid, revision_id) tuples)
            to whether they were referred to by the inventory of the
            revision_id that they contain. If None, this will be
            calculated.
        :param ancestors: Optional result from
            self.get_graph().get_parent_map(self.all_revision_ids()) if already
            available.
        RR(t_VersionedFileChecker(R0RR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_get_versioned_file_checker}s
	cC@sL|j|s$tj||ndt|jj|fgk}|S(sAQuery for a revision signature for revision_id in the repository.i(thas_revisionRRRRRB(R0R7tsig_present((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pythas_signature_for_revision_ids
cC@s[|jj|fgdt}|j}|jdkrNtj||n|jdS(s Return the text for a signature.RRR)(RRvRRR RRR+(R0R7RVR(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytget_signature_textscC@s&tj|d|}|j||S(Nt
check_repo(RtVersionedFileCheck(R0Rt
callback_refsRR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_checks
cc@s|jstn|j}|dkr?|jd}nx|D]y\}}|dkran|j|fg}td||fD}t|j}||krF|||fVqFqFWdS(smFind revisions with different parent lists in the revision object
        and in the index graph.

        :param revisions_iterator: None, or an iterator of (revid,
            Revision-or-None). This iterator controls the revisions checked.
        :returns: an iterator yielding tuples of (revison-id, parents-in-index,
            parents-in-revision).
        cs@s|]}|dVqdS(iN((RR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pys	<genexpr>sN(RR|RR&RpRBRRd(R0trevisions_iteratortvfRQRRMtparents_according_to_indextparents_according_to_revision((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt#_find_inconsistent_revision_parentss			cC@s.t|j}|r*tjdndS(Ns'Revision knit has inconsistent parents.(RDRRt
BzrCheckError(R0tinconsistencies((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt(_check_for_inconsistent_revision_parentsscC@s
t|S(s1Return a sink for streaming into this repository.(t
StreamSink(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRHscC@s
t||S(s3Return a source for streaming from this repository.(tStreamSource(R0t	to_format((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRGsN(GRRRRRSRRRtLockNotHeldt
LockBrokenRR~RR&RRzRRR
RoRRR!R.RR;R RLRNRVRkRlRnRoRmRpRRyRRRRR`RRRRRRRwRRRR*RRRjRRRBRRRRRRRRRRHRG(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRds3			/			9			/
	7	
	
						T					$				
				
	
		tMetaDirVersionedFileRepositorycB@seZdZdZRS(sARepositories in a meta-dir, that work via versioned file objects.cC@s tt|j|||dS(N(RRR (R0R>RCR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR s(RRRR (((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRst$MetaDirVersionedFileRepositoryFormatcB@seZdZRS(sDBase class for repository formats using versioned files in metadirs.(RRR(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRsRcB@sSeZdZdZdZedZdZddZ	dZ
dZRS(	s,An object that can insert a stream into a repository.

    This interface handles the complexity of reserialising inventories and
    revisions from different formats, and allows unidirectional insertion into
    stacked repositories without looking for the missing basis parents
    beforehand.
    cC@s
||_dS(N(ttarget_repo(R0R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR sc
C@s|jjz|r/|jj|t}n|jjt}y|j|||}|ry|jj}||fS|jj}|jj	j
}|j
}	||	kr|jj	jr|jjd|ngt
fSWn|jjdtnXWd|jjXdS(sInsert a stream's content into the target repository.

        :param src_format: a bzr repository format.

        :return: a list of resume tokens and an  iterable of keys additional
            items required before the insertion can be completed.
        thinttsuppress_errorsN(Rt
lock_writetresume_write_groupRRTRRJtsuspend_write_groupRpR>Rtpack_compressestpackRCRuR(
R0RVt
src_formatRRt	is_resumeRQtwrite_group_tokensRt
to_serializertsrc_serializer((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt
insert_streams0
	
	
	c@s|jjs!tj|n|jjsBtjdn|jjj}|j}d}||kry|jj	j
}Wntk
rqX|jdnxM|D]E\}}dt
jkrtd|n|dkr|jjj|q|dkr8||kr%|jjj|q|j||q|dkrW|j||q|dkry|jjj|q|d	kr||kr|jjj|q|j||q|d
kr|jjj|qtd|fqW|dk	r|jdd
tn|jjd|}	yxd|jjfd|jjfd	|jjfd
|jjfd|jjffD]A\}
|
dkrqn|	jfd|
jDqWWntk
rt }	nX|	S(sInsert a stream's content into the target repository.

        This assumes that you already have a locked repository and an active
        write group.

        :param src_format: a bzr repository format.
        :param is_resume: Passed down to get_missing_parent_inventories to
            indicate if we should be checking for missing texts at the same
            time.

        :return: A set of keys that are missing.
        s$you must already be in a write groupiRVsinserting substream: %sRR<sinventory-deltasRRRs
kaboom! %sRyRRbc3@s|]}f|VqdS(N((RR(tprefix(s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pys	<genexpr>psNi(!Rtis_write_lockedRtObjectNotLockedRR@R>RR&t_pack_collectiont	_new_packtAttributeErrortset_write_cache_sizetdebugtdebug_flagsRRtinsert_record_streamR<t_extract_and_insert_inventoriest$_extract_and_insert_inventory_deltasRRt_extract_and_insert_revisionsRR|t_write_dataRRkRt#get_missing_compression_parent_keysRRC(R0RVRRRRtnew_packtsubstream_typet	substreamRQtversioned_file((Rs8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRJsn	



	
	

cC@s|jjj}|jjj}x|D]}|jd}tj}y|j|}Wn;tjk
r}	t	d|	j
tj|jjnX|\}
}}}
}|}g|j
D]}|d^q}|jj|
|||q%WdS(NR)sIncompatible delta: %si(RR>trich_root_dataRR+tinventory_deltatInventoryDeltaDeserializertparse_text_bytestIncompatibleInventoryDeltaRtmsgRtIncompatibleRevisionR!Rz(R0R%t
serializerttarget_rich_rootttarget_tree_refsR(tinventory_delta_bytestdeserialisertparse_resultterrR9tnew_idt	rich_roott	tree_refsRR7RR!((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRxs 

 	cC@s|jjj}|jjj}xu|D]m}|jd}|jd}|j||}	g|jD]}
|
d^qc}|jj||	|~	q%WdS(sGenerate a new inventory versionedfile in target, converting data.

        The inventory is retrieved from the source, (deserializing it), and
        stored in the target (reserializing it in a different format).
        R)iN(	RR>R'RR+RRR!R~(R0R%R.tparse_deltaR/R0R(tbytesR7RRR!((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs

 cC@s{xt|D]l}|jd}|jd}|j|}|j|kr`td||fn|jj||qWdS(NR)is
wtf: %s != %s(R+RRwR7R|RR
(R0R%R.R(R9R7Rq((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR s

cC@s#|jjjr|jjndS(N(RR>t_fetch_reconcilet	reconcile(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRsN(RRRR RRRJRR&RR R(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs		)g			RcB@seZdZdZdZdZdZdZdZdZ	dZ
ed	Zed
Z
edZedZRS(
s7A source of a stream for fetching between repositories.cC@s"||_||_t|_dS(s5Create a StreamSource streaming from from_repository.N(tfrom_repositoryRt
RecordCountert_record_counter(R0R<R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR s		cC@s1|jjj}|jj}|jjo0||kS(spReturn True if delta's are permitted on metadata streams.

        That is on revisions and signatures.
        (R<R>RRR(R0Rttarget_serializer((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytdelta_on_metadatascC@s|jj}g|D]}|f^q}tj|j||jj|jj}|jj}|j||jj|j	}d|fd|fgS(NRR(
R<Rt
versionedfilet
filter_absentRvRRRRR@(R0Rqtfrom_sfR0RRtfrom_rfR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_fetch_revision_textss		cC@s-|jr%tj|jj|SgSdS(sqThis will be called by get_stream between fetching weave texts and
        fetching the inventory weave.
        N(t_rich_root_upgradet
_mod_fetchtInter1and2HelperR<tgenerate_root_texts(R0Rq((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_generate_root_textsscc@sd}|j}|jj}tj|j|}|jj|}g}x4|D],\}}}	||kr||}n|dkr|jg|	D]}
||
f^qqX|dkr7|jj}d|j	||j
j|j
jfVd}x|j|D]}|VqWxl|j|D]}
|
Vq%WqX|dkrFqX|dkrtx/|j|D]}|VqbWqXtd|qXWdS(NRRRRRsUnknown knit kind %r(tget_keysR<R+RRRBRtextendRRvRRRR&RJt_get_inventory_streamRER|(R0tsearchtphaseRqR)t
data_to_fetchRt	knit_kindRRRt
from_textsRtinfoR(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt
get_streams8		 		c
c@si}t|d<t|d<t|d<t|d<t|d<x'|D]}||dj|dqNWt|drtd|dfnx|jD]\}}t|j|}|dkr|rtd	||fn|sqn|dkrf|jjj	|}g|D]}|d^q%}x"|j
|d
tD]}|VqQWqntj
|j||jjt}	||	fVqWdS(NRRR<RRiis2cannot copy revisions to fill in missing deltas %ssCcannot fill in keys for a versioned file we don't have: %s needs %stmissing(RCR}RR|RaR"R<R&R<RBRMRRARBRvRR(
R0RQRRtsubstream_kindRtpresentRqRSRV((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRI	s:





	cC@s|jrdS|jjSdS(Nttopological(RFRR(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytinventory_fetch_order>	scC@s|jjjo|jjS(N(R<R>R'R(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRFD	scC@s|jj}|jrK|jjrK|j|jjkrKtdndtjkrm|j|d|S|j|jjkr|j	|d|S|jr|jjr|j
|jj
kr|j	|d|S|j|d|SdS(Ns3this case should be handled by GroupCHKStreamSourcetforceinvdeltastdelta_versus_nullRU(R<R>R?Rtnetwork_nameR|RRt!_get_convertable_inventory_streamt_get_simple_inventory_streamR(R0RRUtfrom_format((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRMH	s"cc@sb|jj}|rt}n
|j}d|jg|D]}|f^q8|j|fVdS(NR<(R<R<RR@RvRY(R0RRUt
from_weavet
delta_closureR0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR^`	s	
	cc@sd|j|d|fVdS(Nsinventory-deltasR[(t_stream_invs_as_deltas(R0RR[((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR]l	s	cc@s9|j}g|D]}|f^q}|jj|}|jj|d}|j}ttjg}	tj	d}
|j
tjj}tj
d|jd|j}x|D]}
|
jf}|j|d	}d}|r|rg|D]}|d^q}x|D]}||	kr#qn|tjkr;|}n0|
j|d}|dkrk|j|}n|
j|}|dkst|t|kr|}|}qqWn|dkrtj}|
j|}n|	j|
j|
|
|
j<dj|j||d|}tj||d|VqWdS(
sReturn a stream of inventory-deltas for the given rev ids.

        :param revision_ids: The list of inventories to transmit
        :param delta_versus_null: Don't try to find a minimal delta for this
            entry, instead compute the delta versus the NULL_REVISION. This
            effectively streams a complete inventory. Used for stuff like
            filling in missing parents, etc.
        RXi2tversioned_rootttree_referencesiRyiN((R<R<RBRR>RCR#R$RRRjRR(tInventoryDeltaSerializerR'RR7RfR&RwRRR}Rtdelta_to_linesRAtFulltextContentFactory(R0RR[t	from_repoR0R}RMR<tformattinvs_sent_so_farRtnull_inventoryR.RRRLRt
parent_keyRdRt
parent_invtcandidate_deltaR9tdelta_serialized((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRby	sR						


		
(RRRR R@RERJRTRIRYRFRRMR^R]Rb(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs		
		
	-	2		
RcB@s5eZdddZdZddZdZRS(cC@s+||_|jjd|d||_dS(NRR(R1RR(R0R1RR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR 	s	cC@s-|j|}|tjgkr#dSt|S(s_Calculate the correct parents for a file version according to
        the inventories.
        ((RR#R$R(R0RRL((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytcalculate_file_version_parents	s
cC@sYd}|dkr*tjj}|}nz|j||SWd|rT|jnXdS(snCheck the parents stored in a versioned file are correct.

        It also detects file versions that are not referenced by their
        corresponding revision's inventory.

        :returns: A tuple of (wrong_parents, dangling_file_versions).
            wrong_parents is a dict mapping {revision_id: (stored_parents,
            correct_parents)} for each revision_id where the stored parents
            are not correct.  dangling_file_versions is a set of (file_id,
            revision_id) tuples for versions that are present in this versioned
            file, but not used by the corresponding inventory.
        N(R&RRRt_check_file_version_parentsR(R0Rtprogress_bartlocal_progress((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytcheck_file_version_parents	s
	cC@sDi}tg|jjD]\}}|^q|_t|j}|jtdd||jjj	|j}|jjj
}t|t|j}	xt|jjD]~\}
}|jtd|
||j
|}y||}
Wntjk
rd}
nX||
kr|
|f||<qqW||	fS(sSee check_file_version_parents.sloading text storeischecking text graphN(RCRRRgRRRR1RRBRR^t	enumerateRpRRR&(R0RRrt
wrong_parentsRRt
n_versionsRMRtunused_keystnumRtcorrect_parentstknit_parents((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRq	s$+"
N(RRR&R RpRtRq(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR	s		tInterVersionedFileRepositorycB@seZdZeZededdZddZ	e
ejeddddZ
ddZedZedZRS(i2cC@s|jjjr:tjjdd|jjd|jjnddlm}|jjj	|jjj	krtjjdd|jjd|jjn|d|jd|jd	|d
|d|}dS(
sFetch the content required to construct revision_id.

        The content is copied from self.source to self.target.

        :param revision_id: if None all content is copied, if NULL_REVISION no
                            content is copied.
        :return: None.
        texperimental_format_fetchR_Ri(tRepoFetchertcross_format_fetcht
to_repositoryR<t
last_revisionRFREN(
ttargetR>texperimentalRRtshow_user_warningRTtbzrlib.fetchR~R\(R0R7RERFR~tf((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRL
s$	cC@s|jj}t|}|r3|j|}n|}t}|jj}|j|}ttjg}t	}	xBt
rt}
t}xdt|
|jkry0|j
\}}
|
j||j|
Wqtk
rt
}	PqXqWt|j|}t|
j|}|rt|j|}|j|}|j||rtj|j|jn|j|
||j|}|j|n|	r{Pq{q{W|j\}}}tj||t||S(sWalk out from revision_ids in source to revisions target has.

        :param revision_ids: The start point for the search.
        :return: A set of revision ids.
        (RR+R^tunionRCRTt_make_breadth_first_searcherR#R$RRRt$_walk_to_common_revisions_batch_sizetnext_with_ghostsRRRRBR[RRRFtfind_seen_ancestorststop_searching_anyt	get_stateRR(R0Rtif_present_idsttarget_graphtall_wanted_revstmissing_revstsource_graphtsearchertnull_settsearcher_exhaustedt	next_revstghoststnext_revs_parttghosts_parttghosts_to_checktrevs_to_gett	have_revst	stop_revststarted_keystexcludesR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_walk_to_common_revisions
sL				

	
cC@s<tj|r[tjdtdd|dk	r@tdn|dk	r[|g}q[n~|r|dk	s}|dk	r|j|d|}|dkr|S|j}n<t|j	j
}|j||}	t|	j|}|dk	r,|j
jj|}
ttj|
|}n|j
j|S(s6Return the revision ids that source has that target does not.

        :param revision_id: only return revision ids included by this
            revision_id.
        :param revision_ids: return revision ids included by these
            revision_ids.  NoSuchRevision will be raised if any of these
            revisions are not present.
        :param if_present_ids: like revision_ids, but will not cause
            NoSuchRevision if any of these are absent, instead they will simply
            not be in the result.  This is useful for e.g. finding revisions
            to fetch for tags, which may reference absent revisions.
        :param find_ghosts: If True find missing revisions in deep history
            rather than just finding the surface difference.
        :return: A bzrlib.graph.SearchResult.
        sdsearch_missing_revision_ids(revision_id=...) was deprecated in 2.4.  Use revision_ids=[...] instead.t
stacklevelis3revision_ids is mutually exclusive with revision_idRN(tsymbol_versioningtdeprecated_passedtwarntDeprecationWarningR&R|RRKRCRRrt_present_source_revisions_forRRTR+titer_topo_ordert	itertoolstisliceR(R0R7RERRtlimitRRt
target_idst
source_idsttopo_ordered((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytsearch_missing_revision_idsU
s2
		cC@s4|dk	s|dk	r|dkr0t}n|dkrHt}nt|}t|}|j|}|jj}t|j|}|j|}|rtj|j|j	n|j
|}g|j|D]-\}}	|tj
kr|	dk	r|^q}
n|jj}
t|
S(s'Returns set of all revisions in ancestry of revision_ids present in
        the source repo.

        :param revision_ids: if None, all revisions in source are returned.
        :param if_present_ids: like revision_ids, but if any/all of these are
            absent no error is raised.
        N(R&RCRRTR+RBRRRRFRt
iter_ancestryR#R$Rr(R0RRtall_wanted_idsR)tpresent_revsRUt	found_idsR0R!R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR
s(cC@sdS(N(R&(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_get_repo_format_to_test
scC@s|jjo|jjS(N(R>R(tclsRTR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt
is_compatible
sN(RRRRRDRR&RRLRRRtDEPRECATED_PARAMETERRRtclassmethodRR(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR|	s:	. tInterDifferingSerializercB@steZedZedZdZdZdZdZ	dZ
ed	e
d	dZdZRS(
cC@sdS(N(R&(R0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR
scC@s|jjstS|jjs tSdtjkr3tS|jrP|jrPtS|jjrm|jjrmtS|jr|jjrtSdtjkrt	S|j
jjj
dstS|j
jjj
dstSt	S(Nt	IDS_nevert
IDS_alwayssfile:///(R>RRRRRRR=R?Rtbzrdirt	transportRt
startswith(RTR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR
s(
cC@sg}x~|D]v}||kr9|j|||fq
y|jj|}Wntjk
req
X|||<|j||fq
W|S(N(RRTRjRR(R0Rtcachetpossible_treesR0R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt
_get_trees
s

cC@sg}t}x|D]\}}|jj|j}xu|D]m\}	}
}}|
dkrbq>n|
snq>n|j}
|
dkr|
dkrq>n|j||jfq>W|jt|||fqW|j	|ddS(s[Get the best delta and base for this revision.

        :return: (basis_id, delta)
        RRiiN(
RCRRR&RR}RRRR(R0RRdRtdeltasttexts_possibly_new_in_treeR9RRR1RRt	new_entryR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_get_delta_for_revision
s 		 
cC@s:t}x!|jD]}|j|qW|jj|}t|j|}|jjjd|D}g|D]}|d^qz}	x|jj|	D]}
|
j}||f}g|D]}|d^q}
t	j
}|jj|}|
jj
|j}|jj||||
|
||<qWdS(ssFind all parent revisions that are absent, but for which the
        inventory is present, and copy those inventories.

        This is necessary to preserve correctness when the source is stacked
        without fallbacks configured.  (Note that in cases like upgrade the
        source may be not have _fallback_repositories even though it is
        stacked.)
        cs@s|]}|fVqdS(N((RR0((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pys	<genexpr>siN(RCRRRTRBRR<Rtget_revision_idR#R$RjRRRRz(R0RMRtparent_revsR!tpresent_parentstabsent_parentstparent_invs_keys_for_stackingRtparent_inv_idstparent_treetcurrent_revision_idtparents_parents_keystparents_parentsR9RR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_fetch_parent_invs_for_stackings(		
			c C@st}t}g}g}|jj|}|j||t|j_x8|jj|D]$}	|	j}
|j|
d}|j	||}t
|}
t|
dkr|
j|||fn|j
|	||
\}}|jj|
}|j|||
|jf|jr5|	j|j|
<nt}x|D]\}}}}|dkriqEn|s|jjsqEn|jr|j||jfqEqn|j}|j||jfqEWx|
D]\}}|j}xgt
|D]Y}|\}}y||}Wntjk
r1qnX|j|kr|j|qqWqW|j||j||	||
<|
}q_Wt|j_|jj}|jj}|rt j!||j||j}|j"|n|j"|j#||jj$j%|jj$j&x|D]}|jj'|qW|jj(rUt}t}x.|D]&}|j|j)|j|jqTW|j*||j+t,j-|jj|}x|jj|D]}|j}
||
}|j	||}
t|
dkr|
j|||fn|j
|||
\}}|jj'|||
|qWnxj|D]b}y/|jj.|j)}|jj/|j)|Wntj0k
rnX|jj1|j)|q\W|S(sFetch across a few revisions.

        :param revision_ids: The revisions to copy
        :param basis_id: The revision_id of a tree that must be in cache, used
            as a basis for delta when no other base is available
        :param cache: A cache of RevisionTrees that we can use.
        :return: The revision_id of the last converted tree. The RevisionTree
            for it will be in cache
        i(N(2RCRTRBRRRBRRRfRRDRRRRKRdt_converting_to_rich_roottget_root_idt_revision_id_to_root_idR&RRR}RRRRRRRRRRGt_new_root_data_streamRRvR>RRRzR=R7R[RZR#R$RRyRR
( R0RR9Rtroot_keys_to_createRtpending_deltastpending_revisionsRMRRRdtparent_treesRRRRR1RRRRRRtfile_keyt
file_revisionRRtto_textstroot_streamRRRx((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_fetch_batch"s
								




		


		
	cC@s_|j|d\}}d}tjd}|||<~g}d}xtdt||D]}	|jjyI|jt	d|	t|||	|	|!}
|j
|
||}Wn#t|j_
|jjq`X|jj}|r`|j|q`q`W|r6|jjjr6|jjd|n|jt	dt|t|dS(sFetch everything for the list of revisions.

        :param revision_ids: The list of revisions to fetch. Must be in
            topological order.
        :param pb: A ProgressTask
        :return: None
        iidsTransferring revisionsRN(t
_get_basisRRR&trangeRRRTRRRRRTRBRuRpRLR>RR
(R0RRzR9RRRthintsta_graphRtbatchR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt_fetch_all_revisionss2



cC@s|dk	r|j}nd}|jjjr[tjjdd|jjd|jjn|jj	r|jj	rt
|_i|_n	t
|_|jjj|jjjkrtjjdd|jjd|jjn|dkr5|r|g}nd}|jj|jd|d|j}n|s?d	Stj|jjj|}|sjd
Stjj}z|j||Wd|jXt|dfS(sSee InterRepository.fetch().R}R_RRRREiN(ii(ii(R&RKRTR>RRRRRRRRRRR\RRRR+RBRRRR(R0R7RERFRtsearch_revision_idsRz((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRLsD		$cC@s|jj|}y3|jd}|jj||jj|}Wn5ttjfk
r|tj	}|jj|}nX||fS(sGGet a revision and tree which exists in the target.

        This assumes that first_revision_id is selected for transmission
        because all other ancestors are already present. If we can't find an
        ancestor we fall back to NULL_REVISION since we know that is safe.

        :return: (basis_id, basis_tree)
        i(
RTRKRdRRjR"RRR#R$(R0tfirst_revision_idt	first_revR9R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs	
	N(RRRRtstaticmethodRRRRRRRR&RRLR(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR
s					$-tInterSameDataRepositorycB@s,eZdZedZedZRS(sCode for converting between repositories that represent the same data.

    Data format and model must match for this to work.
    cC@sddlm}|jS(sRepository format for testing with.

        InterSameData can pull from subtree to subtree and from non-subtree to
        non-subtree, so we test this with the richest repository format.
        i(tknitrepo(tbzrlib.repofmtRtRepositoryFormatKnit3(R0R((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRscC@s(tj||o'|jjo'|jjS(N(Rt_same_modelR>R(RTR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyRs(RRRRRRR(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR
s
c	C@s|jy{tjd}xet|D]W\}\}}}t||||||dk	r)|jtd|d|q)q)WWn|jnX|j	dS(sInstall all revision data into a repository.

    Accepts an iterable of revision, tree, signature tuples.  The signature
    may be None.
    i
sTransferring revisionsiN(
RTRRRut_install_revisionR&RRRuRp(	R1titerablet
num_revisionsRzRtnRRjRx((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytinstall_revisions*s
"(
cC@sg}i}xY|jD]N}|j|rN|j||j|||<q|jtj||<qW|j}|j}	|js|	j	\}
}|j
|jkrtj
t|qni}x*|	D]"\}
}
|
||
j|
j
f<qW|jj|}t|t|}x|D]}||}
g}xl|jD]^\}}|j|
jsqqMn|j|
j}||krqMn|j|
j|fqMW|j|
jj}|jj|||q*Wy|jjr}t|jr}|||j<y||jd}Wn'tk
rJ|j|j||qX|j|}|j|jd||j|n|j|j||Wntj k
rnX|dk	r|j"|j|n|j#|j||dS(s,Install all revision data into a repository.iN($RdRRRjR#R$RR,RRRR7RR-treprRRRBRCRaRtget_file_revisiontget_filet	readlinesRR>RRRR~RRztRevisionAlreadyPresentR&RyR
(R1RqRjRxRRRtp_idRtentriesRR{RRttext_parent_mapRhRttext_parentsRRRR	RR((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyR?s^
	



cC@st|||dfgdS(s,Install all revision data into a repository.N(RR&(R1RqRj((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pytinstall_revisionsN(,Rt
__future__Rtbzrlib.lazy_importRtglobalstbzrlibRtbzrlib.decoratorsRRRtbzrlib.inventoryRRRR	tbzrlib.repositoryR
RRR
RRtbzrlib.traceRRRRRRRtobjectRRRR|RRtregister_optimiserR&RRR(((s8/usr/lib/python2.7/dist-packages/bzrlib/vf_repository.pyt<module>sJ	".	n
@\


	A

Copyright © 2017 || Recoded By Mr.Bumblebee