-=[ Mr. Bumblebee ]=-
_Indonesia_

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


nNc@@sddlmZddlZddlZddlmZeedddlmZm	Z	m
Z
mZddlm
Z
mZmZddlmZddlmZmZmZmZdd	lmZmZmZmZdd
lmZmZmZdefdYZ d
efdYZ!de"fdYZ#de#fdYZ$de$fdYZ%de#fdYZ&de"fdYZ'de"fdYZ(de"fdYZ)defdYZ*defd YZ+d!e	j,fd"YZ-d#e"fd$YZ.dS(%i(tabsolute_importN(tlazy_imports
from itertools import izip
import time

from bzrlib import (
    chk_map,
    cleanup,
    config,
    debug,
    graph,
    osutils,
    pack,
    transactions,
    tsort,
    ui,
    )
from bzrlib.index import (
    CombinedGraphIndex,
    GraphIndexPrefixAdapter,
    )
(tbtree_indexterrorstlockable_filestlockdir(tneeds_read_locktneeds_write_locktonly_raises(tLogicalLockResult(t
_LazyListJointMetaDirRepositorytRepositoryFormatMetaDirtRepositoryWriteLockResult(tMetaDirVersionedFileRepositoryt$MetaDirVersionedFileRepositoryFormattVersionedFileCommitBuildertVersionedFileRootCommitBuilder(tmuttertnotetwarningtPackCommitBuildercB@s2eZdZdddddedZdZRS(sSubclass of VersionedFileCommitBuilder to add texts with pack semantics.

    Specifically this uses one knit object rather than one knit object per
    added text, reducing memory and object pressure.
    c

C@sYtj||||d|d|d|d|d|d|	tj|jjj|_dS(Nt	timestampttimezonet	committertrevpropstrevision_idtlossy(Rt__init__tgraphtGrapht_pack_collectiont
text_indextcombined_indext_file_graph(
tselft
repositorytparentstconfigRRRRRR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRSs
cC@sLg|D]}||f^q}tg|jj|D]}|d^q5S(Ni(tsetR"theads(R#tfile_idtrevision_idsRtkeystkey((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_heads\sN(t__name__t
__module__t__doc__tNonetFalseRR-(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRLs
	tPackRootCommitBuildercB@s2eZdZdddddedZdZRS(sA subclass of RootCommitBuilder to add texts with pack semantics.

    Specifically this uses one knit object rather than one knit object per
    added text, reducing memory and object pressure.
    c

C@s_tt|j|||d|d|d|d|d|d|	tj|jjj|_dS(NRRRRRR(	tsuperR3RRRRR R!R"(
R#R$R%R&RRRRRR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRhscC@sLg|D]}||f^q}tg|jj|D]}|d^q5S(Ni(R'R"R((R#R)R*RR+R,((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR-rsN(R.R/R0R1R2RR-(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR3as
	tPackcB@seZdZidd6dd6dd	6dd6d d6Zd!dZdZdZdZdZ	dZ
dZdZdZ
dZdZdZRS("sAn in memory proxy for a pack and its indices.

    This is a base class that is not directly used, instead the classes
    ExistingPack and NewPack are used.
    s.cixitchks.rixitrevisions.iixit	inventorys.tixittexts.sixit	signaturecC@s1||_||_||_||_||_dS(s=Create a pack instance.

        :param revision_index: A GraphIndex for determining what revisions are
            present in the Pack and accessing the locations of their texts.
        :param inventory_index: A GraphIndex for determining what inventories are
            present in the Pack and accessing the locations of their
            texts/deltas.
        :param text_index: A GraphIndex for determining what file texts
            are present in the pack and accessing the locations of their
            texts/deltas (via (fileid, revisionid) tuples).
        :param signature_index: A GraphIndex for determining what signatures are
            present in the Pack and accessing the locations of their texts.
        :param chk_index: A GraphIndex for accessing content by CHK, if the
            pack has one.
        N(trevision_indextinventory_indexR tsignature_indext	chk_index(R#R;R<R R=R>((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs
				cC@s|j|jfS(s6Return a tuple (transport, name) for the pack content.(tpack_transportt	file_name(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytaccess_tuplescC@si}xd|j|j|jjjfd|j|j|jjjfgD]P\}}}|jd|j|D}|rOtt|||<qOqOW|rddl	m
}tjd|||fndS(sBMake sure our external references are present.

        Packs are allowed to have deltas whose base is not in the pack, but it
        must be present somewhere in this collection.  It is not allowed to
        have deltas based on a fallback repository.
        (See <https://bugs.launchpad.net/bzr/+bug/288751>)
        ttextstinventoriescs@s!|]\}}}}|VqdS(N((t.0tidxtktvtr((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pys	<genexpr>si(tpformatsRNewly created pack file %r has delta references to items not in its repository:
%sN(
t_get_external_refsR RR!R<t
differencetiter_entriestsortedtlisttpprintRIRt
BzrCheckError(R#t
missing_itemst
index_namet
external_refstindextmissingRI((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_check_referencess$"cC@s|jdS(s'Get the file name for the pack on disk.s.pack(tname(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR@scC@s
|jjS(N(R;t	key_count(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytget_revision_countscC@s|tj|dS(s8Get the disk name of an index type for pack name 'name'.i(R5tindex_definitions(R#t
index_typeRW((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRRscC@stj|dS(s>Get the position in a index_size array for a given index type.i(R5RZ(R#R[((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytindex_offsetscC@s|jd|S(s!The inv index is the name + .iix.R8(RR(R#RW((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytinventory_index_namescC@s|jd|S(s&The revision index is the name + .rix.R7(RR(R#RW((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytrevision_index_namescC@s|jd|S(s'The signature index is the name + .six.R:(RR(R#RW((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytsignature_index_namescC@s|jd|S(s"The text index is the name + .tix.R9(RR(R#RW((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyttext_index_namescC@st}|dkrt}n|j|j|j||j|j|j|d|}|dkrstj	|_
nt||d|dS(NR6tunlimited_cachet_index(R2tTruetindex_classtindex_transportRRRWtindex_sizesR\Rt_gcchk_factoryt
_leaf_factorytsetattr(R#R[RaRT((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_replace_index_with_readonlys		(s.cixi(s.rixi(s.iixi(s.tixi(s.sixiN(R.R/R0RZR1RRARVR@RYRRR\R]R^R_R`Rj(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR5ws&
										tExistingPackcB@s5eZdZddZdZdZdZRS(s>An in memory proxy for an existing .pack and its disk indices.cC@s\tj||||||||_||_d||||||fkrXtndS(sCreate an ExistingPack object.

        :param pack_transport: The transport where the pack file resides.
        :param name: The name of the pack on disk in the pack_transport.
        N(R5RRWR?R1tAssertionError(R#R?RWR;R<R R=R>((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs
		cC@s|j|jkS(N(t__dict__(R#tother((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt__eq__scC@s|j|S(N(Ro(R#Rn((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt__ne__scC@s/d|jj|jjt||j|jfS(Ns<%s.%s object at 0x%x, %s, %s(t	__class__R/R.tidR?RW(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt__repr__sN(R.R/R0R1RRoRpRs(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRks
		tResumedPackcB@s8eZddZdZdZdZdZRS(c
C@stj|||||||d|
||_||_ddddg|_d|fd|fd|fd|fg}|
dk	r|jd|
f|jjdnx3|D]+\}}
|j|}|
j|j|<qW|	j	|_
|	|_d|_dS(	sCreate a ResumedPack object.R>R7R8R9R:R6tresumedN(
RkRtupload_transportReR1RftappendR\t_sizet_index_classRdRt_state(R#RWR;R<R R=RvR?Retpack_collectionR>tindicesR[RTtoffset((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs&						cC@sQ|jdkrtj|S|jdkr>|j|jfSt|jdS(NtfinishedRu(RzR5RARvR@Rl(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRA's

cC@s~|jj|j|j|j|j|jg}|jdk	rV|j	|jnx!|D]}|j
j|jq]WdS(N(RvtdeleteR@R;R<R R=R>R1Rwt
_transportt_name(R#R|RT((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytabort/s
cC@s|jddddg}|jdk	r;|jdnxM|D]E}|j||j}d|}|jj|||j|qBWd|j	}|jj|j	|d|_
dS(	NR7R8R9R:R6s../indices/s	../packs/R~(RVR>R1RwRRRWRvtmoveRjR@Rz(R#tindex_typesR[told_nametnew_name((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytfinish8s


cC@s
|jdS(sReturn compression parents for this index that are not present.

        This returns any compression parents that are referenced by this index,
        which are not contained *in* this index. They may be present elsewhere.
        i(texternal_references(R#RT((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRJFsN(R.R/R1RRARRRJ(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRt
s
				tNewPackcB@steZdZdddZdZdZdZdZe	dZ
dZd	Zd
Z
e	dZRS(
s5An in memory proxy for a pack which is being created.tc	@s|j}|jd
k	r*|dd}nd
}tj|dd|dd|dddd|ddd||_|j_|j_	|j
_|j_
|_tj_d
_d_tjd|_tj_j	jjdj_d	tjkrftd
tjj	jjtjjngdg_t jjj!jj"fd}|_#t$j%j#_&j&j'd_(d
_)d
S(sMCreate a NewPack instance.

        :param pack_collection: A PackCollection into which this is being inserted.
        :param upload_suffix: An optional suffix to be given to any temporary
            files created during the pack creation. e.g '.autopack'
        :param file_mode: Unix permissions for newly created file.
        treference_listsiiitkey_elementsR>itmodetpacks0%s: create_pack: pack stream open: %s%s t+%6.3fsc@s{|dj||dct|7<|djks@|rwdj|d}||||gdg|(ndS(NiiR(Rwtlent_cache_limittjoin(tbytestflusht_buffert_writet_update(R#(s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_write_datas

topenN(*t_index_builder_classR>R1R5RRRyRdt_upload_transportRvt_index_transportRet_pack_transportR?t
_file_modetosutilstmd5t_hashRfRt
rand_charstrandom_namettimet
start_timetopen_write_streamtwrite_streamtdebugtdebug_flagsRtctimetbaseRR2twritetupdateRRtContainerWritert_writertbeginRzRW(R#R{t
upload_suffixt	file_modetindex_builder_classR>R((R#s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRRsF
								!
	
	cC@s-d|_|jj|jj|jdS(sCancel creating this pack.tabortedN(RzRtcloseRvRR(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs	
cC@sN|jdkrtj|S|jdkr;|j|jfSt|jdS(s6Return a tuple (transport, name) for the pack content.R~RN(RzR5RARvRRl(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRAs

cC@s[t|jpW|jjpW|jjpW|jjpW|jdk	oW|jjS(s)True if data has been added to this pack.N(tboolRYR<RXR R=R>R1(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt
data_inserteds
cC@sY|jdk	rdS|jj|jdrC|jddtn|jj|_dS(NiRR(	RWR1RtendRRRcRt	hexdigest(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytfinish_contents

cC@s}|j|s|jnddddg|_|jd|jd||jd|jd||jd|jd||jd|jd||j	dk	r|jj
d|jd|j	d|n|jjd	|j
jjd
|jd}|sd|}n|jj|j|d
|_dtjkrytdtj|jj|j|tj|jndS(s=Finish the new pack.

        This:
         - finalises the content
         - assigns a name (the md5 of the content, currently)
         - writes out the associated indices
         - renames the pack into place.
         - stores the index size tuple for the pack in the index_sizes
           attribute.
        R7R8R9s
file textsR:srevision signaturesR6scontent hash bytestwant_fdatasyncsrepository.fdatasyncs.packs	../packs/R~Rs1%s: create_pack: pack finished: %s%s->%s t+%6.3fsN(RRVR1Rft_write_indexR;R<R R=R>RwRRRtconfig_stacktgetRWRvRRRzRRRRRRR(R#tsuspendR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs4





	cC@sZ|jdrVdj|jd}|jj||jj|gdg|j(ndS(sFlush any current data.iRiN(RRRRRR(R#R((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs

cC@s
|jS(N(t_external_references(R#RT((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRJscC@s
||_dS(N(R(R#tsize((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytset_write_cache_sizesc
C@s|j||j}|r'|j}n	|j}|j}|j}|j|d|j}	|	j||	j	d|j
jjdt
||j|j|<dtjkrtdtj||jj|jtj|jn|j|dS(sWrite out an index.

        :param index_type: The type of index to write - e.g. 'revision'.
        :param index: The index object to serialise.
        :param label: What label to give the index e.g. 'revision'.
        RRsrepository.fdatasyncRs.%s: create_pack: wrote %s index: %s%s t+%6.3fsN(RRRWRvReRtreadRRRRRRRRRfR\RRRRRRRRRj(
R#R[RTtlabelRRRt	transporttindex_tempfiletindex_bytesR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs"	
	N(R.R/R0R1RRRARRR2RRRJRR(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyROs]					7			tAggregateIndexcB@sAeZdZdddZdZdZdZdZRS(sAn aggregated index for the RepositoryPackCollection.

    AggregateIndex is reponsible for managing the PackAccess object,
    Index-To-Pack mapping, and all indices list for a specific type of index
    such as 'revision index'.

    A CombinedIndex provides an index on a single key space built up
    from several on-disk indices.  The AggregateIndex builds on this
    to provide a knit access layer, and allows having up to one writable
    index within the collection.
    cC@sR||_i|_tgd||_t|jd|d||_d|_dS(sCreate an AggregateIndex.

        :param reload_func: A function to call if we find we are missing an
            index. Should have the form reload_func() => True if the list of
            active pack files has changed.
        treload_funct
flush_funcN(t_reload_funct
index_to_packtCombinedGraphIndexR!t_DirectPackAccesstdata_accessR1tadd_callback(R#RR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRDs		cC@s0|j|j|<|jjd||jdS(sAdd index to the aggregate, which is an index for Pack pack.

        Future searches on the aggregate index will seach this new index
        before all previously inserted indices.

        :param index: An Index for the pack.
        :param pack: A Pack instance.
        iN(RARR!tinsert_indexRW(R#RTR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt	add_indexSs
cC@sj|jdk	r+td||jfn|j|||jj|j||j|j|_dS(sAdd an index which is able to have data added to it.

        There can be at most one writable index at any time.  Any
        modifications made to the knit are put into this index.

        :param index: An index from the pack parameter.
        :param pack: A Pack instance.
        s*%s already has a writable index through %sN(	RR1RlRRt
set_writerRRAt	add_nodes(R#RTR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytadd_writable_indexas	cC@sD|jjddd|jj|jj2|jj2d|_dS(s(Reset all the aggregate data to nothing.N(NN(	RRR1RtclearR!t_indicest_index_namesR(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRts



cC@s|j|=|jjj|}|jj|=|jj|=|jdk	rt|dd|jkrd|_|jj	dddndS(swRemove index from the indices used to answer queries.

        :param index: An index from the pack parameter.
        RN(NN(
RR!RRTRRR1tgetattrRR(R#RTtpos((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytremove_index|s


	N(	R.R/R0R1RRRRR(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR5s			tPackercB@sheZdZd
d
dZd
dZdZdZdZdZ	dZ
dZd	ZRS(sCreate a pack from packs.cC@sL||_||_||_d|_||_||_d|_d|_dS(sCreate a Packer.

        :param pack_collection: A RepositoryPackCollection object where the
            new pack is being written to.
        :param packs: The packs to combine.
        :param suffix: The suffix to use on the temporary files for the pack.
        :param revision_ids: Revision ids to limit the pack to.
        :param reload_func: A function to call if a pack file/index goes
            missing. The side effect of calling this function should be to
            update self.packs. See also AggregateIndex
        N(	tpackstsuffixR*R1tnew_packRRt_revision_keyst_text_filter(R#R{RRR*R((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs
							cC@s|jjdk	r1tjd|jjfn|jdk	rt|jdkrYdSt	|j|_t	d|jD|_
n|dkrtjj
|_n	||_z|jSWd|dkr|jjnXdS(s|Create a new pack by reading data from other packs.

        This does little more than a bulk copy of data. One key difference
        is that data with the same item key across multiple packs is elided
        from the output. The new pack is written into the current pack store
        along with its indices, and the name added to the pack names. The
        source packs are not altered and are not required to be in the current
        pack collection.

        :param pb: An optional progress bar to use. A nested bar is created if
            this is None.
        :return: A Pack object, or None if nothing was copied.
        s6call to %s.pack() while another pack is being written.ics@s|]}|fVqdS(N((RDtrevid((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pys	<genexpr>sN(Rt	_new_packR1RtBzrErrorRqR.R*Rt	frozensett
revision_keystuit
ui_factorytnested_progress_bartpbt_create_pack_from_packsR~(R#R((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs 			cC@s|jj|jd|jd|jjjj}|jjdt|j	jdt|j
jdt|jjdt|S(s)Open a pack for the pack we are creating.RRtcombine_backing_indices(Rtpack_factoryRtrepotbzrdirt_get_file_modeR;tset_optimizeR2R<R R=(R#R((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt	open_packs	cC@st|jdS(s#Copy revision data to the new pack.N(tNotImplementedErrort_copy_revision_texts(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@st|jdS(sCopy the inventory texts to the new pack.

        self._revision_keys is used to determine what inventories to copy.

        Sets self._text_filter appropriately.
        N(Rt_copy_inventory_texts(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@st|jdS(N(Rt_copy_text_texts(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@st|jdS(N(RR(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@s`dtjkr\tdtj|jjj|jj	|jj
jtj|jjndS(NRs:%s: create_pack: file texts copied: %s%s %d items t+%6.3fs(
RRRRRRRRRRR RXR(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_log_copied_textss	cC@s
|jS(sReturn True if new_pack should be used.

        :param new_pack: The pack that has just been created.
        :return: True if the pack should be used.
        (R(R#R((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt	_use_packsN(
R.R/R0R1RRRRRRRRR(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs(	
						tRepositoryPackCollectioncB@seZdZd,Zd,Zd,Zd,ZdZdZ	dZ
dZdZdZ
d,dZdZd	Zd
Zd,edZdZd
ZdZdZdZdZdZdZeedZdZdZdZdZ dZ!dZ"edZ#dZ$dZ%dZ&dZ'ed,d Z(d!Z)d"Z*d#Z+d,d$Z,d%Z-d&Z.d'Z/d(Z0d)Z1d*Z2d+Z3RS(-sbManagement of packs within a repository.

    :ivar _names: map of {pack_name: (index_size,)}
    c	C@s||_||_||_||_||_||_||_idd6dd6dd6dd6d	d
6|_g|_d|_
i|_d|_d|_
|j}	t|j|	|_t|j|	|_t|j|	|_t|j|	|_|j|j|j|jg}
|rAt|j|	|_|
j|jn	d|_g|
D]}|j^qQ}x-|D]%}
|
jt|j|
gqmWg|_tj|jj|_dS(syCreate a new RepositoryPackCollection.

        :param transport: Addresses the repository base directory
            (typically .bzr/repository/).
        :param index_transport: Addresses the directory containing indices.
        :param upload_transport: Addresses the directory into which packs are written
            while they're being created.
        :param pack_transport: Addresses the directory of existing complete packs.
        :param index_builder_class: The index builder class to use.
        :param index_class: The index class to use.
        :param use_chk_index: Whether to setup and manage a CHK index.
        is.rixis.iixis.tixis.sixis.cixN( RRRRRRRyt_suffix_offsetsRR1t_namest_packs_by_namet_packs_at_loadRt_flush_new_packRtreload_pack_namesR;R<R R=R>RwR!tset_sibling_indicesR'RKt_resumed_packsR&t
LocationStackRR(R#RRReRvR?RRdt
use_chk_indexRtall_indicestagg_idxtall_combinedtcombined_idx((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR
s>							
							
	cC@sd|jj|jfS(Ns%s(%r)(RqR.R(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRsFscC@s|j|jkr+td|jfn|jj|||j|j<|jj|j||jj|j||jj|j||j	j|j	||j
dk	r|j
j|j
|ndS(spMake a Pack object available to the repository to satisfy queries.

        :param pack: A Pack object.
        s!pack %s already in _packs_by_nameN(RWRRlRRwR;RR<R R=R>R1(R#R((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytadd_pack_to_memoryIscC@s7g}x*|jD]}|j|j|qW|S(sReturn a list of all the Pack objects this repository has.

        Note that an in-progress pack being created is not returned.

        :return: A list of Pack objects for all the packs in the repository.
        (tnamesRwtget_pack_by_name(R#tresultRW((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt	all_packsZscC@s6x/tr1y|jSWqtjk
r-qXqWdS(sPack the pack collection incrementally.

        This will not attempt global reorganisation or recompression,
        rather it will just ensure that the total number of packs does
        not grow without bound. It uses the _max_pack_count method to
        determine if autopacking is needed, and the pack_distribution
        method to determine the number of revisions in each pack.

        If autopacking takes place then the packs name collection will have
        been flushed to disk - packing requires updating the name collection
        in synchronisation with certain steps. Otherwise the names collection
        is not flushed.

        :return: Something evaluating true if packing took place.
        N(Rct_do_autopackRt
RetryAutopack(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytautopackfs
	c
C@sO|jjj}t|j}|j||kr:dS|j|}g}xE|jD]7}|j	}|dkrq\n|j
||fq\W|j||}t|}tg|D]}	t|	d^q}
tg|D]}	|	d^q}t
d||||
|||j|d|jd|j}t
d||S(Niis}Auto-packing repository %s, which has %d pack files, containing %d revisions. Packing %d files into %d affecting %d revisionstpacker_classRs$Auto-packing repository %s completed(R;R!RXRRt_max_pack_countR1tpack_distributionRRYRwtplan_autopack_combinationstsumRt_execute_pack_operationstnormal_packer_classt_restart_autopack(
R#ttotal_revisionsttotal_packsRtexisting_packsRtrevision_counttpack_operationst
num_new_packstpot
num_old_packstnum_revs_affectedR
((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR~s.)#

cC@sx|D]\}}t|dkr+qn|||dd|}y|j}Wn6tjk
r|jdk	r|jjnnX|dkrdSx|D]}|j|qWqWg}	x!|D]\}
}|	j|qW|j	dt
d|	}|S(sExecute a series of pack operations.

        :param pack_operations: A list of [revision_count, packs_to_combine].
        :param packer_class: The class of packer to use
        :return: The new pack names.
        is	.autopackRNtclear_obsolete_packstobsolete_packs(RRRtRetryWithNewPacksRR1Rt_remove_pack_from_memorytextendt_save_pack_namesRc(R#RRRRRtpackerR
Rtto_be_obsoletedt_((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs*	
	cC@s#|jdk	r|jjndS(N(RR1R(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@s|jjjdS(sAcquire the mutex around the pack-names index.

        This cannot be used in the middle of a read-only transaction on the
        repository.
        N(Rt
control_filest
lock_write(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt
lock_namesscC@s#|jjjp!t|jdkS(s!Is the collection already packed?i(Rt_formattpack_compressesRR(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_already_packedscC@s|jt|j}|jr)dS|jjj}td||||x3try|j	|Wnt
k
rqTnXPqTW|r|jndS(s!Pack the pack collection totally.NsUPacking repository %s, which has %d pack files, containing %d revisions with hint %r.(t
ensure_loadedRRR.R;R!RXRRct_try_pack_operationstRetryPackOperationst_clear_obsolete_packs(R#thinttclean_obsolete_packsRR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs 

	
cC@sdggg}xa|jD]S}|dks=|j|kr|ddc|j7<|ddj|qqW|j|d|jd|jdS(s\Calculate the pack operations based on the hint (if any), and
        execute them.
        iiiRRN(RR1RWRYRwRtoptimising_packer_classt_restart_pack_operations(R#R3RR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR0s	c
C@st|t|krgS|jdtdggg}xt|r|jd\}}||dkrx|dkr||d8}|dkr|d=qr||d<qrWq>|ddc|7<|ddj||dd|dkr>|d=|jdggq>q>Wd}g}x+|D]#\}}	||7}|j|	q)Wt|dkrrtdgS||ggS(sPlan a pack operation.

        :param existing_packs: The packs to pack. (A list of (revcount, Pack)
            tuples).
        :param pack_distribution: A list with the number of revisions desired
            in each pack.
        treverseiiisEWe somehow generated an autopack with a single pack file being moved.(RtsortRctpopRwR$Rl(
R#RRRtnext_pack_rev_countt	next_packtfinal_rev_counttfinal_pack_listtnum_revst
pack_files((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs4

cC@s|jjs$tj|jn|jdkri|_t|_xS|jD]E\}}}|d}|j	||j|<|jj
||fqUWt}nt}|j
|S(stEnsure we have read names from disk.

        :return: True if the disk names had not been previously read.
        iN(Rt	is_lockedRtObjectNotLockedRR1R'Rt_iter_disk_pack_indext_parse_index_sizestaddRcR2R(R#RTR,tvalueRWR
((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR/3s	
	
cC@s,tg|jdD]}t|^qS(sParse a string of index sizes.t (ttupletsplittint(R#REtdigits((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRCJscC@sy|j|SWntk
r|j|d}|j|d}|j|d}|j|d}|jdk	r|j|ddt}nd}t|j||||||}|j||SXdS(s~Get a Pack object by name.

        :param name: The name of the pack - e.g. '123456'
        :return: A Pack object.
        s.rixs.iixs.tixs.sixs.cixtis_chkN(	RtKeyErrort_make_indexR>R1RcRkRR(R#RWt	rev_indext	inv_indext	txt_indext	sig_indexR>R
((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR	Ns

c	C@s[tjd|s0tj|j|gdny|j|ddt}|j|ddt}|j|ddt}|j|ddt}|jdk	r|j|ddtd	t}nd}|j	||||||j
|j|j|d
|	}Wn7tj
k
r9}tj|j|gt|nX|j||jj||S(sGet a suspended Pack object by name.

        :param name: The name of the pack - e.g. '123456'
        :return: A Pack object.
        s[a-f0-9]{32}sMalformed write group tokens.rixtresumes.iixs.tixs.sixs.cixRKR>N(tretmatchRtUnresumableWriteGroupRRMRcR>R1tresumed_pack_factoryRRRt
NoSuchFiletstrRRRw(	R#RWRNRORPRQR>R
te((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_resume_packds*
%
cC@se|j|j|jkr;tjd|j|fnt|j|j|j<|j|dS(sAllocate name in the list of packs.

        :param a_new_pack: A NewPack instance to be added to the collection of
            packs for this repository.
        sPack %r already exists in %sN(R/RWRRRRGRfR(R#t
a_new_pack((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytallocates
cC@s|j|jddjS(sIterate over the contents of the pack-names index.

        This is used when loading the list from disk, and before writing to
        detect updates from others during our write operation.
        :return: An iterator of the index contents.
        s
pack-namesN(RyRR1titer_all_entries(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRBsc
C@s|j|}||}|r;|j}|j|j}n|j}|j||}|j|||d|}	|r|jtjkrtj	|	_
n|	S(NRa(RRtstattst_sizeRRRyRtBTreeGraphIndexRgRh(
R#RWRRRRKtsize_offsetRRRt
index_sizeRT((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRMs

			cC@sA|s
dSt|}d}x|D]}|t|7}q#W|S(sReturn the maximum number of packs to use for total revisions.

        :param total_revisions: The total number of revisions in the
            repository.
        ii(RXRI(R#RRJR
tdigit((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs
cC@st|jjS(s)Provide an order to the underlying names.(RMRR+(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@svxo|D]g}yy'|jj|jd|jWnbtjk
ry|jjdWntjk
rtnX|jj|jd|jnXWn0tjtjfk
r}t	d|fnXddddg}|j
d	k	r|jdnxj|D]b}y)|j
j|j|d|j|Wqtjtjfk
ri}t	d|fqXqWqWd	S(
sMove a number of packs which have been obsoleted out of the way.

        Each pack and its associated indices are moved out of the way.

        Note: for correctness this function should only be called after a new
        pack names index has been written without these pack names, and with
        the names of packs that contain the data previously available via these
        packs.

        :param packs: The packs to obsolete.
        :param return: None.
        s../obsolete_packs/s.couldn't rename obsolete pack, skipping it:
%ss.iixs.sixs.tixs.rixs.cixs/couldn't rename obsolete index, skipping it:
%sN(R?RR@RRWtmkdirt
FileExistst	PathErrortTransportErrorRR>R1RwRRW(R#RRRYtsuffixesR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_obsolete_packss2


cC@s|dkrdgStt|}g}xNt|D]@\}}d|}x'tt|D]}|j|qaWq8Wtt|S(sGenerate a list of the number of revisions to put in each pack.

        :param total_revisions: The total number of revisions in the
            repository.
        ii
(treversedRXt	enumeratetrangeRIRwRN(R#RRJR
texponenttcountRR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs
cC@s|j|dfS(s@Return a tuple with the transport and file name for a pack name.s.pack(R(R#RW((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_pack_tuplescC@sG|jj|j|jj|j|j||jj|dS(sRemove pack from the packs accessed by this repository.

        Only affects memory state, until self._save_pack_names() is invoked.
        N(RR9RWRt_remove_pack_indicesRtremove(R#R((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR#s
cC@sxtjjD]q}|d}t||}|dk	rt||}y|j|Wqtk
r}|rwqnqXqqWdS(sRemove the indices for pack from the aggregated indices.
        
        :param ignore_missing: Suppress KeyErrors from calling remove_index.
        RbN(R5RZR+RR1RRL(R#Rtignore_missingR[t	attr_nametaggregate_indext
pack_index((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRps

cC@s|jj|jj|jj|jj|jdk	rS|jjnd|_d|_g|_	i|_
d|_dS(sClear all cached data.N(R;RR=R R<R>R1RRRRR(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytresets



				cC@s|jjjdS(s.Release the mutex around the pack-names index.N(RR)tunlock(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt
_unlock_names,scC@st}x0|jD]"\}}}|j||fqWt|}t}xF|jjD]5\}}|j|fdjd|DfqaW|j|}	||j}
|j|	|j|
||	|
|fS(sWRead the pack names from disk, and compare it to the one in memory.

        :return: (disk_nodes, deleted_nodes, new_nodes)
            disk_nodes    The final set of nodes that should be referenced
            deleted_nodes Nodes which have been removed from when we started
            new_nodes     Nodes that are newly introduced
        RFcs@s|]}t|VqdS(N(RX(RDR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pys	<genexpr>Bs(	R'RBRDRt	iteritemsRRtdifference_updateR(R#t
disk_nodesRTR,REtorig_disk_nodest
current_nodesRWtsizest
deleted_nodest	new_nodes((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_diff_pack_names0s			'



cC@s0g}g}g}t|}xF|jD]8}|jf|kr+|j|j|j|q+q+Wx|D]\}}|d}	|j|}
|	|jkr|
|j|	kr|j|j|	|
|j|	<|j|	|j|	qqn|
|j|	<|j|	|j|	qnW|||fS(sGiven the correct set of pack files, update our saved info.

        :return: (removed, added, modified)
            removed     pack names removed from self._names
            added       pack names added to self._names
            modified    pack names that had changed value
        i(tdictRRWRwR#RCRR	(R#R{tremovedtaddedtmodifiedt	new_namesRR,RERWR~((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt&_syncronize_pack_names_from_disk_nodesQs*
	



cC@sTg}|jz|j}|j\}}}}x$|D]\}	}
|j|	|
q>W|jjd|jd|jjj	||_
|rd}|rtg|D]}|j
^q}n|j|}nWd|jX|j||r5g|D]}|j
|kr|^q}|j|ng|D]}
|
dd^q<S(sNSave the list of packs.

        This will take out the mutex around the pack names list for the
        duration of the method call. If concurrent updates have been made, a
        three-way merge between the current list and the current in memory list
        is performed.

        :param clear_obsolete_packs: If True, clear out the contents of the
            obsolete_packs directory.
        :param obsolete_packs: Packs that are obsolete once the new pack-names
            file has been written.
        :return: A list of the names saved that were not previously on disk.
        s
pack-namesRNi(R+RRtadd_nodeRtput_fileRRRRRR1R'RWR2RxRRi(R#R R!talready_obsoletetbuilderR{RRR|R,REtto_preservetotnew_node((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR%}s,
	%

c	C@si|j}|rtS|j\}}}}||_|j|\}}}|sa|sa|retStS(sKSync our pack listing with what is present in the repository.

        This should be called when we find out that something we thought was
        present is now missing. This happens when another process re-packs the
        repository, etc.

        :return: True if the in-memory list of packs has been altered at all.
        (R/RcRRRR2(	R#t
first_readR{RRR|RRR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs	cC@s4|jsntj|jttjdS(s:Reload the pack names list, and restart the autopack code.N(RRR
RR2tsystexc_info(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@s1|jsnt|jttjdS(s:Reload the pack names list, and restart the autopack code.N(RR1RR2RR(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR6sc	C@sg}|jjd}|dkr0t}ny|jd}Wntjk
rZ|SXx|D]}tj|\}}|dkr|j	|n||krqbny|j
|Wqbtjtjfk
r}t
d|fqbXqbW|S(sDelete everything from the obsolete-packs directory.

        :return: A list of pack identifiers (the filename without '.pack') that
            were found in obsolete_packs.
        R!t.s.packs.couldn't delete obsolete pack, skipping it:
%sN(RtcloneR1R'tlist_dirRRWRtsplitextRwRRfRgR(	R#tpreservetfoundtobsolete_pack_transporttobsolete_pack_filestfilenameRWtextRY((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR2s(
cC@s|jjs!tj|n|j|ddd|jjj|_|jj	|jj|j|j
j	|jj
|j|jj	|jj|j|jjjdt
|jj	|jj|j|jdk	r-|jj	|jj|j|jj|jjj_|jjjdt
n|j
j|jjj_|jj|jjj_|jj|jjj_|jj|jjj_dS(NRs.packRR(Rtis_write_lockedRtNotWriteLockedRRRRR;RR<R RR2R=R>R1Rt	chk_bytesRbt
_add_callbackRCt	revisionst
signaturesRB(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_start_write_groups,




cC@s|jdk	rctj|jj}|jt|dd|j|j|jdt|j	nxF|j
D];}tj|j}|j|j|dt|j	qmW|j
2dS(NRRr(RR1tcleanuptOperationWithCleanupsRtadd_cleanupRiRpRct
run_simpleR(R#t	operationtresumed_pack((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_abort_write_groups
cC@s,x|jD]}|j|q
W|j2dS(N(RRp(R#R((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_remove_resumed_pack_indices&scC@sgS(sDetect missing inventories in this write group.

        :returns: list of strs, summarising any problems found.  If the list is
            empty no problems were found.
        ((R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_check_new_inventories+scC@st}xd|jjfd|jjfd|jjfd|jjffD]?\}}|j}|jg|D]}|f|^qqqLW|rtj	d|jt
|fn|j}|rdj|}tj	d|n|j
|jt}|jjrE|jj|j|jd|_t}n|jjd|_xK|jD]@}	d|j|	j<|j|	|	j|j|	t}qeW|j2|r|j}
|
s|jS|
SgS(NRRCRBRs3Repository %s has missing compression parent(s) %r s
s&Cannot add revision(s) to repository: (R'RRRCRBRt#get_missing_compression_parent_keysRRRPRMRRRpRR2RRR\R1RcRRRRWR#RR%(R#tall_missingtprefixtversioned_fileRUR,tproblemstproblems_summarytany_new_contentRR
((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_commit_write_group5sN	+
		
	




cC@sg|jD]}|j^q
}|j|j|jjrp|jjdt|j|jjd|_n|jj	d|_|j
|S(NR(RRWRpRRRRcRwR1RR(R#Rttokens((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_suspend_write_groupes
	
cC@s"x|D]}|j|qWdS(N(RZ(R#Rttoken((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_resume_write_groupss
N(4R.R/R0R1RRVRR5RRsRRRRRRR+R.R2RR0RR/RCR	RZR\RBRMRRRiRRoR#RpRvRxRRR%RRR6R2RRRRRRR(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs`	9					'$					4					
	
			-			
			!	,0							
	0	tPackRepositorycB@seZdZdZdZdZedZdZ	dZ
dZdZdZ
dZd	Zd
ZdZdZdd
ZdZdZdZededZededZdZeejejdZ RS(sRepository with knit objects stored inside pack containers.

    The layering for a KnitPackRepository is:

    Graph        |  HPSS    | Repository public layer |
    ===================================================
    Tuple based apis below, string based, and key based apis above
    ---------------------------------------------------
    VersionedFiles
      Provides .texts, .revisions etc
      This adapts the N-tuple keys to physical knit records which only have a
      single string identifier (for historical reasons), which in older formats
      was always the revision_id, and in the mapped code for packs is always
      the last element of key tuples.
    ---------------------------------------------------
    GraphIndex
      A separate GraphIndex is used for each of the
      texts/inventories/revisions/signatures contained within each individual
      pack file. The GraphIndex layer works in N-tuples and is unaware of any
      semantic value.
    ===================================================

    cC@s{tj||||||_||_t|_|jjrXtj	|j
|_ntj	||_|jjdS(N(
RRt_commit_builder_classt_serializerRct_reconcile_fixes_text_parentsR,tsupports_external_lookupsRtCachingParentsProvidert _make_parents_provider_unstackedt_unstacked_providert
disable_cache(R#R,ta_bzrdirR)RR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs			cC@s$g|jjD]}|d^qS(s"See Repository.all_revision_ids().i(RR+(R#R,((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_all_revision_idsscC@s$|jjjj|jjdS(N(RRbt_key_dependenciesRRR(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@s2|jjs|jStjt|jg|jS(N(R,RRRtStackedParentsProviderR
t_fallback_repositories(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt_make_parents_providers	cC@s;|jsdS|jj|jj|jjdS(N(R@RRRRtenable_cache(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt
_refresh_datas


cC@s|jjdS(N(RR(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@s@|jj}|jjjj|jj|jj|S(N(	RRRRbRRRRR(R#R3((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs


cC@s/|jj}|jjjjd|_|S(N(RRRRbRRR1t_write_group(R#R((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytsuspend_write_groups	cC@ss|jy|jj|Wn!tjk
rA|jnXx*|jjD]}|jjj	|j
qOWdS(N(RRRRRURRRRbtscan_unvalidated_indexR;(R#RR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs

cC@s!|jr|jS|jjSdS(N(t_write_lock_countt_transactionR)tget_transaction(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs	cC@s|jp|jjS(N(RR)R@(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR@scC@s|jS(N(R(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@s|j}|jr.|r.tj|n|jd7_|jdkr^tj|_n|sdtjkr|j	dkrt
d|nd|_	|jjx|j
D]}|jqW|jnt|jdS(siLock the repository for writes.

        :return: A bzrlib.repository.RepositoryWriteLockResult.
        itrelocktws%r was write locked againN(R@RRt
ReadOnlyErrorttransactionstWriteTransactionRRRt
_prev_lockRRRRt	lock_readRR
RwR1(R#RtlockedR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR*s	

cC@s|j}|jr'|jd7_n
|jj|sdtjkrh|jdkrhtd|nd|_|jj	x|j
D]}|jqW|jnt|j
S(sZLock the repository for reads.

        :return: A bzrlib.lock.LogicalLockResult.
        iRRHs%r was read locked again(R@RR)RRRRRRRRRR	Rw(R#RR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs	
	

cC@st|jdS(N(Rtleave_lock_in_place(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@st|jdS(N(Rtdont_leave_lock_in_place(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@s|jjd|d|dS(sCompress the data within the repository.

        This will pack all the data to a single pack. In future it may
        recompress deltas or do other such expensive operations.
        R3R4N(RR(R#R3R4((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscC@s0ddlm}||d|}|j|S(sReconcile this repository.i(tPackReconcilertthorough(tbzrlib.reconcileRt	reconcile(R#RnRRt
reconciler((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs
cC@st|jdS(N(Rt_reconcile_pack(R#t
collectionRt	extensiontrevsR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR'scC@s|jdkr]|jdk	r]|j|jjd|_d|_tjd|n|jr|jd8_|js|j}d|_|j	qn
|j
j|js|jjx|j
D]}|jqWndS(Niis6Must end write group before releasing write lock on %s(RRR1tabort_write_groupRRRRRRR)RwR@R(R#ttransactionR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRw*s&

		
				

N(!R.R/R0R1RRRRRRRRRRRRRR@RR*RRRRR2RRRRRtLockNotHeldt
LockBrokenRw(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRxs2	
								
							tRepositoryFormatPackcB@sqeZdZdZdZdZeZe	Z
e	ZdZdZ
eZe	ZeZeZe	dZe	ddZRS(sFormat logic for pack structured repositories.

    This repository format has:
     - a list of packs in pack-names
     - packs in packs/NAME.pack
     - indices in indices/NAME.{iix,six,tix,rix}
     - knit deltas in the packs, knit indices mapped to the indices.
     - thunk objects to support the knits programming API.
     - a format marker of its own
     - an optional 'shared-storage' flag
     - an optional 'no-working-trees' flag
     - a LockDir lock
    cC@std|jjddddg}|j}d|jfg}d|jfg}|j||||||jd|d	t}|j	||||S(
sCreate a pack based repository.

        :param a_bzrdir: bzrdir to contain the new repository; must already
            be initialized.
        :param shared: If true the repository will be initialized as a shared
                       repository.
        screating repository in %s.R|R!Rtuploads
pack-namestformatRt_found(
RRRRRtget_format_stringt_upload_blank_contentRRct_run_post_repo_init_hooks(R#RtsharedtdirsRtfilest
utf8_filesR$((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt
initializejscC@s|stj|}n|dk	r-|}n|jd}tj|dtj}|jd|d|d|d|j	d|j
S(sSee RepositoryFormat.open().

        :param _override_transport: INTERNAL USE ONLY. Allows opening the
                                    repository at a slightly different url
                                    than normal. I.e. during 'upgrade'.
        tlockR,RR)RRN(Rtfind_formatR1tget_repository_transportRt
LockableFilesRtLockDirtrepository_classRR(R#RRt_override_transportRtrepo_transportR)((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR}s			N(R.R/R0R1RRRRctsupports_ghostsR2Rt
supports_chksRRdt_fetch_uses_deltastfast_deltastsupports_funky_characterst%revision_graph_can_have_wrong_parentsRR(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRCs
R1cB@seZdZeZdZRS(sRaised when we are packing and we find a missing file.

    Meant as a signaling exception, to tell the RepositoryPackCollection.pack
    code it should try again.
    sWPack files have changed, reload and try pack again. context: %(context)s %(orig_error)s(R.R/R0Rctinternal_errort_fmt(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyR1sRcB@sJeZdZdddZdZdZdZdZdZ	RS(s:Access to data in one or more packs with less translation.cC@s1d|_d|_||_||_||_dS(sCreate a _DirectPackAccess object.

        :param index_to_packs: A dict mapping index objects to the transport
            and file names for obtaining data.
        :param reload_func: A function to call if we determine that the pack
            files have moved and we need to reload our caches. See
            bzrlib.repo_fmt.pack_repo.AggregateIndex for more details.
        N(R1t_container_writerRRRt_flush_func(R#tindex_to_packsRR((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs
					c	C@st|tk	r+tdt|ng}d}x]|D]U\}}|jj||||!g\}}||7}|j|j||fq>W|S(sMAdd raw knit bytes to a storage area.

        The data is spooled to the container writer in one bytes-record per
        raw data item.

        :param sizes: An iterable of tuples containing the key and size of each
            raw data segment.
        :param raw_data: A bytestring containing the data.
        :return: A list of memos to retrieve the record later. Each memo is an
            opaque index memo. For _DirectPackAccess the memo is (index, pos,
            length), where the index field is the write_index object supplied
            to the PackAccess object.
        sdata must be plain bytes was %si(ttypeRXRlRtadd_bytes_recordRwR(	R#t	key_sizestraw_dataR
R}R,Rtp_offsettp_length((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytadd_raw_recordss	
cC@s |jdk	r|jndS(soFlush pending writes on this access object.

        This will flush any buffered writes to a NewPack.
        N(RR1(R#((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRscc@sg}d}xp|D]h\}}}||krD|j||fq|dk	rf|j||fn|}||fg}qW|dk	r|j||fnx|D]\}}y|j|\}	}
WnGtk
r|jdkrntj|dtdtj	nXyAt
j|	|
|}x%|jD]\}}
|
dVq:WWqtj
k
r|jdkr~ntj|	j|
dtdtj	qXqWdS(sZGet the raw bytes for a records.

        :param memos_for_retrieval: An iterable containing the (index, pos,
            length) memo for retrieving the bytes. The Pack access method
            looks up the pack to use for a given record in its index_to_pack
            map.
        :return: An iterator over the bytes of the records.
        treload_occurredRN(R1RwRRLRRR"RcRRRtmake_readv_readertiter_recordsRWtabspathR2(R#tmemos_for_retrievalt
request_listst
current_indexRTR}tlengthtcurrent_listtoffsetsRtpathtreaderRt	read_func((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytget_raw_recordss<

cC@s2|dk	r||j|<n||_||_dS(s$Set a writer to use for adding data.N(R1RRR(R#twriterRTttransport_packname((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs	cC@sjt}|jdkrt}n!|js?|js?t}q?n|rf|j\}}}|||ndS(sTry calling the reload function, or re-raise the original exception.

        This should be called after _DirectPackAccess raises a
        RetryWithNewPacks exception. This function will handle the common logic
        of determining when the error is fatal versus being temporary.
        It will also make sure that the original exception is raised, rather
        than the RetryWithNewPacks exception.

        If this function returns, then the calling function should retry
        whatever operation was being performed. Otherwise an exception will
        be raised.

        :param retry_exc: A RetryWithNewPacks exception.
        N(R2RR1RcRR(R#t	retry_exctis_errort	exc_classt	exc_valuet
exc_traceback((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pytreload_or_raise
s		N(
R.R/R0R1RRRRRR!(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyRs			2	(/t
__future__RRSRtbzrlib.lazy_importRtglobalstbzrlibRRRRtbzrlib.decoratorsRRRtbzrlib.lockR	tbzrlib.repositoryR
RRR
tbzrlib.vf_repositoryRRRRtbzrlib.traceRRRRR3tobjectR5RkRtRRRRRRR"R1R(((s</usr/lib/python2.7/dist-packages/bzrlib/repofmt/pack_repo.pyt<module>s6	"""uEVwyP

Copyright © 2017 || Recoded By Mr.Bumblebee