-=[ 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/v08.pyc

ó
MēxOc@@s8dZddlmZddlmZmZddlmZmZddlm	Z	ddl
mZmZddl
mZddlmZdd	lmZdd
lmZddlmZddlmZid
e6de6Zdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ dS(s4Serializer factory for reading and writing bundles.
i(tabsolute_import(terrorstui(tBundleSerializert_get_bundle_header(tbinary_diff(tRevisionInfot
BundleInfo(t
internal_diff(t
NULL_REVISION(tStrictTestament(tformat_highres_date(t	text_file(tmuttertyestnotActioncB@sAeZdZddd„Zd„Zd„Zd„Zd„ZRS(sRepresent an actioncC@sO||_|dkr!g|_n	||_|dkrBg|_n	||_dS(N(tnametNonet
parameterst
properties(tselfRRR((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyt__init__.s		cC@s#|jj||jdƒfƒdS(s;Add a property whose value is currently utf8 to the action.tutf8N(Rtappendtdecode(RRtvalue((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pytadd_utf8_property9scC@s|jj||fƒdS(sAdd a property to the actionN(RR(RRR((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pytadd_property=scC@s|j|t|ƒdS(s$Add a boolean property to the actionN(Rt	bool_text(RRR((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pytadd_bool_propertyAscC@s'dj|jg|jƒg}xb|jD]W}t|ƒdkrU|j|dƒq)y|jd|ƒWq)t|ƒ‚q)Xq)Wdg}|jdj|ƒƒdj|ƒjdƒ}d	}xNt|ƒ|kr|j|| ƒ||}|jd
ƒd	tdƒ}qÄW|j|dƒd
S(sWrite action as to a filet iis%s:%ss=== s // tsutf-8iOs
... s... s
N(	tjoinRRRtlenRtreprtencodetwrite(Rtto_filetp_textstpropttextt	text_linet	available((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR%Es$	

N(	t__name__t
__module__t__doc__RRRRRR%(((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR+s			tBundleSerializerV08cB@steZd„Zd„Zd„Zd„Zd„Zded„Zd„Z	d„Z
d	„Zdd
„Z
d„ZRS(
cC@s
t|ƒjS(s‰Read the rest of the bundles from the supplied file.

        :param f: The file to read from
        :return: A list of bundles
        (tBundleReadertinfo(Rtf((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pytread]scC@s1|jjƒr-tjdt|jƒƒ‚ndS(Ns0.8(tsourcetsupports_rich_rootRtIncompatibleBundleFormatR#(R((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pytcheck_compatibleescC@s†||_||_||_||_|jƒ|jƒz<|jƒtjj	ƒ}z|j
|ƒWd|jƒXWd|jƒXdS(s&Write the bundless to the supplied files.

        :param source: A source for revision information
        :param revision_ids: The list of revision ids to serialize
        :param forced_bases: A dict of revision -> base that overrides default
        :param f: The file to output to
        N(
R4trevision_idstforced_basesR&R7t	lock_readt_write_main_headerRt
ui_factorytnested_progress_bart_write_revisionstfinishedtunlock(RR4R8R9R2tpb((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR%is				


cC@s|j||||ƒS(N(t
_write_bundle(Rt
repositoryttargettbasetfileobj((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pytwrite_bundlescC@s-|j}|jtdƒƒ|jdƒdS(s Write the header for the changess0.8s#
N(R&R%R(RR2((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR;„s	icC@s|dkrtdƒ‚n|j}|jdd|ƒ|j|jdƒƒ|s‡|rw|dkrw|jdƒq{|jdƒnōt|tƒrĄ|jd	ƒ|j|ƒ|jd
ƒn»t|tƒr|jd	ƒ|j|jdƒƒ|jd
ƒny|jdƒxi|D]a}|jdd|dƒt|tƒrT|j|ƒn|j|jdƒƒ|jd
ƒqWdS(
srWrite out meta information, with proper indenting, etc.

        :param trailing_space_when_empty: To work around a bug in earlier
            bundle readers, when writing an empty property, we use "prop: 
"
            rather than writing "prop:
".
            If this parameter is True, and value is the empty string, we will
            write an extra space.
        is"indentation must be greater than 0t#Rsutf-8R s: 
s:
s: s
iN(t
ValueErrorR&R%R$t
isinstancetstrtunicode(RtkeyRtindentttrailing_space_when_emptyR2tentry((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyt_writeŠs0		




c
C@sEd}d}t|jƒ}x#t|jƒD]\}}|jd||ƒ|jj|ƒ}||krq|}n|jj|ƒ}||jkr½t	}	|j|}
|
dkrāt
}
qān%t}	|jrÜ|jd}
nt
}
|
|kr÷|}n|jj|
ƒ}|dk}|j
|||
||	|ƒ|
}|}q+WdS(s/Write the information for all of the revisions.sGenerating revision datai’’’’iN(RR"R8t	enumeratetupdateR4tget_revisiont
revision_treeR9tTrueR	tFalset
parent_idst_write_revision(
RRAtlast_rev_idt
last_rev_treeti_maxtitrev_idtrevtrev_treet
explicit_basetbase_idt	base_treetforce_binary((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR>Æs4	
		
cC@stj|j|ƒjƒS(N(R
t
from_revisionR4tas_sha1(Rtrevision_id((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyt_testament_sha1Õsc
@s`‡fd†}|d|jjdƒƒ|d|jƒ|dt|j|jƒƒˆjjdƒˆj|||j	|ƒ|d|j	ƒ|dˆj
|j	ƒƒ|d|jƒ|jrŅ|d	|jƒn|rč|d
|ƒn|j
rLˆjdddd
ƒxBt|j
jƒƒD](\}}	ˆj||	dddtƒqWnˆjjdƒdS(s)Write out the information for a revision.c@sˆj||ddƒdS(NRNi(RQ(RMR(R(s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pytwÜstmessages
t	committertdatesrevision idtsha1sinventory sha1s
parent idssbase idRRNiiRON(RjtsplitRkRt	timestampttimezoneR&R%t_write_deltaRgRhtinventory_sha1RXRRQRtsortedtitemsRV(
RR_R`tbase_revRcRaRdRiRR((Rs@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyRYŁs&		"cC@s”|dkrg}ng|D]}d|^q}|jjdƒ|jjdj|g|ƒjdƒƒ|jjdj|ƒjdƒƒ|jjdƒdS(Ns%s:%ss=== Rsutf-8s // s
(RR&R%R!R$(RRRRtvR'((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyt
_write_actionös	)"c	@skd}d}d}‡‡‡fd†‰‡‡‡‡‡fd†}ˆjˆdtdtƒ}	x;|	jD]0\}
}}td||
gƒjˆjƒ}
qgWxr|	jD]g\}
}}td||
gd	|fgƒ}
|d
koķˆj|ƒ}||
|||t||
ƒq„Wx]|	jD]R\}}}}}}td||g|fgƒ}
||
||||||ƒqWxQ|	j	D]F\}
}}}}td||
gƒ}
||
|||||
|
ƒqzWx |	j
D]•\}
}}ˆj|ƒ}|dkržqĪnˆj|ƒ}||krĪtdˆj
|ƒˆj|ƒgƒ}
|
jd
|ƒ|
jˆjƒqĪqĪWdS(s(Write out the changes between the trees.s	/dev/nullR c@sšt‡fd†}yf|r*tjƒ‚n|ˆdtƒ}|ˆdtƒ}|jˆjƒt||||ˆjƒWnqtjk
rė|ˆdtƒ}|ˆdtƒ}|jddƒ|jˆjƒt||||ˆjƒnXdS(Nc@sK|jˆƒrC|jˆƒ}|tkr9t|ƒ}n|jƒSgSdS(N(thas_idtget_fileRVRt	readlines(ttreetrequire_textt	tree_file(tfile_id(s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyt
tree_liness
R|tencodingtbase64(	RWRt
BinaryFileRVR%R&RRR(R~told_pathtnew_pathtactionRdRt	old_linest	new_lines(tnew_treetold_treeR(R~s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pytdo_diffs 	c@sµˆj|}|jˆkr2|jd|jƒn|rN|jd|jƒn|rv|dkrv|jd|jƒn|r”|dkr”ˆ||||ˆƒn|jˆjƒdS(Nslast-changedt
executabletsymlinkRDtfile(	troot_inventorytrevisionRRR‹Rtsymlink_targetR%R&(R…R~tkindt
meta_modifiedt
text_modifiedRƒR„RP(tdefault_revision_idRŠRdRˆR(s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyt
finish_action s
twant_unchangedtinclude_roottremovedtaddedsfile-idRtrenamedtmodifiedslast-changedN(tchanges_fromRVR˜RR%R&R™t
is_executableRšR›t	unchangedtget_file_revisionRR‘tid2pathR(RRˆR‰R”RdtDEVNULLt	old_labelt	new_labelR•tdeltatpathR~R‘R…R’RƒR„R“tnew_revtold_rev((R”RŠRdRˆR‰Rs@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyRq’sF	%!N(R,R-R3R7R%RGR;RWRQR>RhRYRRwRq(((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR/\s					%	&			R0cB@s}eZdZd„Zd„Zd„Zd„Zd„Zd„Zdd„Z	d	„Z
d
„Zd„Zd„Z
d
„ZRS(syThis class reads in a bundle from a file, and returns
    a Bundle object, which can then be applied against a tree.
    cC@sLtj|ƒt|ƒ|_d|_|jƒ|_|jƒ|j	ƒdS(svRead in the bundle from the file.

        :param from_file: A file-like object (must have iterator support).
        N(
tobjectRtitert	from_fileRt
_next_linet	_get_infoR1t_readt	_validate(RRŖ((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyRVs
	
cC@stƒS(N(tBundleInfo08(R((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR¬gscC@sa|jƒjƒxJ|jdk	r\|jƒs2Pn|jdkrEPn|jƒ|jƒqWdS(N(t_nexttnextR«Rt_read_revision_headert
_read_patchest_read_footer(R((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR­js
cC@s|jjƒdS(seMake sure that the information read in makes sense
        and passes appropriate checksums.
        N(R1t
complete_info(R((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR®tscc@sUx7|jD],}|j}||_|dk	r
|Vq
q
W|j}d|_|VdS(sQyield the next line, but secretly
        keep 1 extra line for peeking.
        N(RŖR«R(Rtlinetlast((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR°|s				cC@s—t}|jjjtdƒƒxX|jƒD]J}|dksJ|dkrNPn|jdƒscq,nt}|j	|ƒq,W|s“|jjj
ƒn|S(Ns
RH(RWR1t	revisionsRRRR°t
startswithRVt_handle_nexttpop(Rtfound_somethingR¶((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR²‹sicC@s|jdƒs!tjdƒ‚n|dd!jdƒ}|| d|krX||}n|sbdS|jdƒ}|dkr·|| }||d}|sż|jd	|dƒ}qżnF|dd
krź|d }|jd	|dƒ}ntjd|ƒ‚|jddƒ}||fS(s!Read in a key-value pair
        RHsBzr header did not start with #ii’’’’sutf-8Rs: iRNt:s=While looking for key: value pairs, did not find the colon %rt_N(NN(R¹RtMalformedHeaderRRtfindt
_read_manytreplace(RR¶RNtlocRMR((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyt_read_next_entryœs(


	
cC@s|dkrdS|j|ddƒ\}}td||fƒ|dkrOdS|jjd}||jkrūt||ƒdkrå|dkr”|jdƒ}n1|d	krŅg|D]}|jdƒ^q“}nt|||ƒqt	j
d
|ƒ‚nt	j
d|ƒ‚dS(
NRNis_handle_next %r => %ri’’’’R~RgRbRRXsDuplicated Key: %ssUnknown Key: "%s"(sfile_idsrevision_idsbase_id(RRÄR
R1Røt__dict__tgetattrR$tsetattrRRæ(RR¶RMRt
revision_infoRv((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyRŗøs %cC@sŖg}dd|}|jdks<|jt|ƒ |kr@|Sxc|jƒD]U}|j|t|ƒd!jdƒƒ|jdksž|jt|ƒ |krMPqMqMW|S(sēIf a line ends with no entry, that means that it should be
        followed with multiple lines of values.

        This detects the end of the list, because it will be a line that
        does not start properly indented.
        RHRi’’’’sutf-8N(R«RR"R°RR(RRNtvalueststartR¶((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyRĮĪs(#(cC@s^|jdks!|jjdƒr.dgtfSt}g}x|jƒD]}|r‘|jdƒsxtjd|ƒ‚n|dd!jdƒ}n2|jdƒrĆ||t	dƒd!jdƒ7}n|jdk	rń|jjdƒrń||tfS|jdks|jjdƒr||tfS|r.t}qG|jdƒsG|j
|ƒqGqGW||tfS(	s…Read in one patch, return the complete patch, along with
        the next line.

        :return: action, lines, do_continue
        RHs===sAThe first line of all patches should be a bzr meta line "===": %rii’’’’sutf-8s... N(R«RR¹RWRVR°RtMalformedPatchesRR"R(RtfirsttlinesR¶R…((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyt_read_one_patchįs,!
	
#
!
	cC@sŒt}g}xA|rO|jƒ\}}}|dk	r|j||fƒqqW|jjdjdk	rutƒ‚n||jjd_dS(Ni’’’’(RVRĪRRR1Røttree_actionstAssertionError(Rtdo_continuetrevision_actionsR…RĶ((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR³s	cC@saxZ|jƒD]L}|j|ƒ|jdkr3Pn|jjdƒs
|jƒjƒPq
q
WdS(s»Read the rest of the meta information.

        :param first_line:  The previous step iterates past what it
                            can handle. That extra line is given here.
        RHN(R°RŗR«RR¹R±(RR¶((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR“s
(R,R-R.RR¬R­R®R°R²RÄRŗRĮRĪR³R“(((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyR0Rs			
						$	RÆcB@s#eZd„Zd„Zd„ZRS(cC@s'|jd|ƒtj|||ƒdS(NR (tnote_last_changedRt_update_tree(Rtbundle_treeRg((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyRŌ!scC@stj||ƒ}|jƒS(N(R
ReRf(RRCRgt	testament((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyt_testament_sha1_from_revision%scC@st||ƒjƒS(N(R
Rf(RRR{((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyRh)s(R,R-RŌR×Rh(((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyRÆs		N(!R.t
__future__RtbzrlibRRtbzrlib.bundle.serializerRRRtbzrlib.bundle.bundle_dataRRtbzrlib.diffRtbzrlib.revisionR	tbzrlib.testamentR
tbzrlib.timestampRtbzrlib.textfileRtbzrlib.traceR
RVRWRRØRR/R0RÆ(((s@/usr/lib/python2.7/dist-packages/bzrlib/bundle/serializer/v08.pyt<module>s 1öĶ

Copyright © 2017 || Recoded By Mr.Bumblebee