-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
î:ïNc@@s˜dZddlmZddlmZddlmZmZmZddlm	Z	de
fd„ƒYZdefd	„ƒYZd
efd„ƒYZ
dS(
sÅTestament - a summary of a revision for signing.

A testament can be defined as "something that serves as tangible
proof or evidence."  In bzr we use them to allow people to certify
particular revisions as authentic.

The goal is that if two revisions are semantically equal, then they will
have a byte-for-byte equal testament.  We can define different versions of
"semantically equal" by using different testament classes; e.g. one that
includes or ignores file-ids.

We sign a testament rather than the revision XML itself for several reasons.
The most important is that the form in which the revision is stored
internally is designed for that purpose, and contains information which need
not be attested to by the signer.  For example the inventory contains the
last-changed revision for a file, but this is not necessarily something the
user cares to sign.

Having unnecessary fields signed makes the signatures brittle when the same
revision is stored in different branches or when the format is upgraded.

Handling upgrades is another motivation for using testaments separate from
the stored revision.  We would like to be able to compare a signature
generated from an old-format tree to newer tree, or vice versa.  This could
be done by comparing the revisions but that makes it unclear about exactly
what is being compared or not.

Different signing keys might indicate different levels of trust; we can in
the future extend this to allow signatures indicating not just that a
particular version is authentic but that it has other properties.

The signature can be applied to either the full testament or to just a
hash of it.

Testament format 1
~~~~~~~~~~~~~~~~~~

* timestamps are given as integers to avoid rounding errors
* parents given in lexicographical order
* indented-text form similar to log; intended to be human readable
* paths are given with forward slashes
* files are named using paths for ease of comparison/debugging
* the testament uses unix line-endings (
)
i(tabsolute_import(tcopy(tcontains_whitespacetcontains_linebreakstsha_strings(tTreet	TestamentcB@seZdZdZdZeZed„ƒZed„ƒZ	d„Z
d„Zd„Zd„Z
d	„Zd
„Zd„Zd„Zd
„ZRS(s´Reduced summary of a revision.

    Testaments can be

      - produced from a revision
      - written to a stream
      - loaded from a stream
      - compared to a revision
    sbazaar-ng testament version 1
s!bazaar-ng testament short form 1
cC@s+|j|ƒ}|j|ƒ}|||ƒS(s3Produce a new testament from a historical revision.(tget_revisiont
revision_tree(tclst
repositorytrevision_idtrevttree((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyt
from_revisioncscC@s%|jj|jƒƒ}|||ƒS(s-Produce a new testament from a revision tree.(t_repositoryRtget_revision_id(R	R
R((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pytfrom_revision_treejscC@sÎ|j|_|j|_|jp$d|_|j|_|j|_|j|_t|tƒsmtdƒ‚n||_	t
|jƒ|_t
|jƒr©t|jƒ‚nt|jƒrÊt|jƒ‚ndS(s*Create a new testament for rev using tree.is?As of bzr 2.4 Testament.__init__() takes a Revision and a Tree.N(Rt	committerttimezonet	timestamptmessaget
parent_idst
isinstanceRt	TypeErrorR
Rt
propertiestrevpropsRt
ValueErrorR(tselfRR
((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyt__init__ps
	cC@sOg}|j}||jƒ|d|jƒ|d|jƒ|d|jƒ|d|jƒ|dƒx@t|jƒD]/}t|ƒr›t	|ƒ‚n|d|ƒqzW|dƒx%|j
jƒD]}|d|ƒqÇW|dƒx0|jƒD]"\}}||j
||ƒƒqöW|j|jƒƒg|D]}|jd	ƒ^q6S(
sšYield text form as a sequence of lines.

        The result is returned in utf-8, because it should be signed or
        hashed in that encoding.
        srevision-id: %s
scommitter: %s
stimestamp: %d
s
timezone: %d
s	parents:
s  %s
s	message:
sinventory:
sutf-8(tappendtlong_headerRRRRtsortedRRRRt
splitlinest_get_entriest_entry_to_linetextendt_revprops_to_linestencode(Rtrtat	parent_idtltpathtietline((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyt
as_text_lines‚s(	



cC@s d„|jjd|jƒDƒS(Ncs@s*|] \}}}}}||fVqdS(N((t.0R+t	versionedtkindtfile_idR,((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pys	<genexpr>Ÿstinclude_root(R
t
list_filesR3(R((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyR"žscC@s=t|ƒrt|ƒ‚nt|jddƒjddƒƒS(Ns\t/t s\ (RRtunicodetreplace(RR+((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyt_escape_path¢scC@s×t|jƒr!t|jƒ‚nd}d}|jdkrc|jsQtƒ‚n|j}d}n?|jdkr¢|js‡tƒ‚n|j|jƒ}d}nd|j|j|ƒ|jjdƒ||f}|S(s-Turn an inventory entry into a testament linettfileR6tsymlinku  %s %s %s%s%s
tutf8(	RR2RR1t	text_sha1tAssertionErrortsymlink_targetR9tdecode(RR+R,tcontenttcontent_spacerR*((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyR#§s$					
cC@sdj|jƒƒS(NR:(tjoinR.(R((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pytas_text¾scC@s|jd|j|jƒfS(s$Return short digest-based testament.srevision-id: %s
sha1: %s
(tshort_headerRtas_sha1(R((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyt
as_short_textÁscC@s”|js
gSdg}xwt|jjƒƒD]`\}}t|ƒrSt|ƒ‚n|jd|ƒx%|jƒD]}|jd|ƒqqWq,W|S(sPack up revision properties.sproperties:
s  %s:
u    %s
(RR titemsRRRR!(RR'tnametvalueR-((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyR%Ès		"cC@st|jƒƒS(N(RR.(R((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyRGÕs(t__name__t
__module__t__doc__RRFtFalseR3tclassmethodRRRR.R"R9R#RERHR%RG(((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyRTs									
tStrictTestamentcB@s)eZdZdZdZeZd„ZRS(sCThis testament format is for use as a checksum in bundle format 0.8s bazaar-ng testament version 2.1
s#bazaar-ng testament short form 2.1
cC@sMtj|||ƒd }|d|j7}|idt6dt6|j7}|S(NiÿÿÿÿR6s yes
s no
(RR#trevisiontTrueROt
executable(RR+R,R*((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyR#ßs(RLRMRNRRFROR3R#(((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyRQÙs
tStrictTestament3cB@s)eZdZdZdZeZd„ZRS(s•This testament format is for use as a checksum in bundle format 0.9+

    It differs from StrictTestament by including data about the tree root.
    s"bazaar testament version 3 strict
s%bazaar testament short form 3 strict
cC@sRt|ƒrt|ƒ‚n|dkr0d}nt|jddƒjddƒƒS(NR:t.s\R5R6s\ (RRR7R8(RR+((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyR9ðs
	(RLRMRNRRFRSR3R9(((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyRUæs
N(RNt
__future__RRtbzrlib.osutilsRRRtbzrlib.treeRtobjectRRQRU(((s4/usr/lib/python2.7/dist-packages/bzrlib/testament.pyt<module><s…

Copyright © 2017 || Recoded By Mr.Bumblebee