-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
î:ïNc@@stdZddlmZddlZddlmZddlZddlmZmZddl	m
Z
ddlmZddl
mZmZd	Zejd
ƒZejdƒZiadZd
„Zd„Zd„Zd„Zdid„Zdd„Zdefd„ƒYZed„Z ed„Z!d„Z"e!dddƒe!dddƒe!eddƒe!dddƒdS( s4Serializer factory for reading and writing bundles.
i(tabsolute_importN(tStringIO(terrorstpyutils(t
internal_diff(t
NULL_REVISION(tunpack_highres_datetformat_highres_dates# Bazaar revision bundle vsG^# Bazaar revision bundle v(?P<version>\d+[\w.]*)(?P<lineending>\r?)\n$sD^# Bazaar-NG changeset v(?P<version>\d+[\w.]*)(?P<lineending>\r?)\n$t4cC@sdt|fS(Ns%s%s
(t
BUNDLE_HEADER(tversion((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyt_get_bundle_header0scC@st|ddƒS(Ntnames	<unknown>(tgetattr(tf((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyt
_get_filename3scC@sd}x´|D]¬}tj|ƒ}|r_|jdƒdkrLtjƒ‚n|jdƒ}Pn!|jtƒr€tjdƒ‚nt	j|ƒ}|r
|jdƒ}tj
|dƒ‚q
q
W|dkrÛtjdƒ‚n|tkrütj
|dƒ‚nt||ƒ}|j
|ƒS(	suRead in a bundle from a filelike object.

    :param f: A file-like object
    :return: A list of Bundle objects
    t
lineendingtR
s%Extra characters after version numbers old format bundles not supportedsDid not find an opening headers$version not listed in known versionsN(tNonetBUNDLE_HEADER_REtmatchtgroupRtUnsupportedEOLMarkert
startswithR	tMalformedHeadertCHANGESET_OLD_HEADER_REtBundleNotSupportedt
NotABundlet_serializerstread(RR
tlinetmt
serializer((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pytread_bundle7s.
		cC@s<yt||ƒSWn#tk
r7tj|dƒ‚nXdS(Nsunknown bundle format(RtKeyErrorRR(R
((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pytget_serializer[s
cC@s<|jƒz t|ƒj||||ƒSWd|jƒXdS(sSerialize a list of bundles to a filelike object.

    :param source: A source for revision information
    :param revision_ids: The list of revision ids to serialize
    :param f: The file to output to
    :param version: [optional] target serialization version
    N(t	lock_readR#twritetunlock(tsourcetrevision_idsRR
tforced_bases((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyR%bs
	
cC@s<|jƒz t|ƒj||||ƒSWd|jƒXdS(s&Write a bundle of revisions.

    :param repository: Repository containing revisions to serialize.
    :param revision_id: Head revision_id of the bundle.
    :param base_revision_id: Revision assumed to be present in repositories
         applying the bundle.
    :param out: Output file.
    N(R$R#twrite_bundleR&(t
repositorytrevision_idtbase_revision_idtouttformat((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyR*ss
	
tBundleSerializercB@s2eZdZd„Zd„Zd„Zd„ZRS(sWThe base class for Serializers.

    Common functionality should be included here.
    cC@s
||_dS(N(R
(tselfR
((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyt__init__‰scC@s
t‚dS(sŽRead the rest of the bundles from the supplied file.

        :param f: The file to read from
        :return: A list of bundle trees
        N(tNotImplementedError(R1R((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyRŒscC@s
t‚dS(s\Write the bundle to the supplied file.

        :param repository: The repository to retrieve revision data from
        :param target: The revision to provide data for
        :param base: The most recent of ancestor of the revision that does not
            need to be included in the bundle
        :param fileobj: The file to output to
        N(R3(R1R+ttargettbasetfileobj((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyR*”s	cC@s‚i||6}|tkr"d}n|jƒ}|j||gƒ}t|jƒj|ƒƒ}|jƒ|j||||ƒ|S(s5Helper function for translating write_bundle to writeN(RRt	get_graphtfind_unique_ancestorstlisttiter_topo_ordertreverseR%(R1R+R,R-R.R)tgraphR(((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyt
_write_bundleŸs
		
(t__name__t
__module__t__doc__R2RR*R=(((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyR0„s
			cC@s1|r|t|<dS|tkr-|t|<ndS(sµRegister a BundleSerializer version.

    :param version: The version associated with this format
    :param klass: The class to instantiate, which must take a version argument
    N(R(R
tklasst	overwrite((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pytregister®s

c@s)‡‡fd†}t||d|ƒdS(s*Register lazy-loaded bundle serializer.

    :param version: The version associated with this reader
    :param module: String indicating what module should be loaded
    :param classname: Name of the class that will be instantiated
    :param overwrite: Should this version override a default
    c@stjˆˆƒ}||ƒS(N(Rtget_named_object(R
RA(t	classnametmodule(sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyt_loaderÅsRBN(RC(R
RFRERBRG((RERFsE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyt
register_lazy½scC@sStƒ}t|||||dtƒ|jdƒtj||ƒ|jdƒdS(Ntallow_binaryis
(RRtTruetseektbase64tencodeR%(told_filenamet	old_linestnew_filenamet	new_linestto_filettemp((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pytbinary_diffËs	
s0.8sbzrlib.bundle.serializer.v08tBundleSerializerV08s0.9sbzrlib.bundle.serializer.v09tBundleSerializerV09sbzrlib.bundle.serializer.v4tBundleSerializerV4(#R@t
__future__RRLRtretbzrlibRRtbzrlib.diffRtbzrlib.revisionRtbzrlib.timestampRRR	tcompileRRRt	v4_stringRRR!R#RR%R*tobjectR0tFalseRCRHRT(((sE/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/__init__.pyt<module>s<					$	*		

Copyright © 2017 || Recoded By Mr.Bumblebee