~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/testament.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Testament - a summary of a revision for signing.
18
18
 
19
 
A testament can be defined as "something that serves as tangible 
 
19
A testament can be defined as "something that serves as tangible
20
20
proof or evidence."  In bzr we use them to allow people to certify
21
 
particular revisions as authentic.  
 
21
particular revisions as authentic.
22
22
 
23
23
The goal is that if two revisions are semantically equal, then they will
24
24
have a byte-for-byte equal testament.  We can define different versions of
61
61
 
62
62
# XXX: At the moment, clients trust that the graph described in a weave
63
63
# is accurate, but that's not covered by the testament.  Perhaps the best
64
 
# fix is when verifying a revision to make sure that every file mentioned 
 
64
# fix is when verifying a revision to make sure that every file mentioned
65
65
# in the revision has compatible ancestry links.
66
66
 
67
67
# TODO: perhaps write timestamp in a more readable form
81
81
class Testament(object):
82
82
    """Reduced summary of a revision.
83
83
 
84
 
    Testaments can be 
 
84
    Testaments can be
85
85
 
86
86
      - produced from a revision
87
87
      - written to a stream
180
180
 
181
181
    def as_short_text(self):
182
182
        """Return short digest-based testament."""
183
 
        return (self.short_header + 
 
183
        return (self.short_header +
184
184
                'revision-id: %s\n'
185
185
                'sha1: %s\n'
186
186
                % (self.revision_id, self.as_sha1()))
218
218
 
219
219
class StrictTestament3(StrictTestament):
220
220
    """This testament format is for use as a checksum in bundle format 0.9+
221
 
    
 
221
 
222
222
    It differs from StrictTestament by including data about the tree root.
223
223
    """
224
224