~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/testament.py

- add short-form of testaments

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
 
67
67
from cStringIO import StringIO
68
68
import string
 
69
import sha
69
70
 
70
71
 
71
72
def contains_whitespace(s):
144
145
        self.text_form_1_to_file(s)
145
146
        return s.getvalue()
146
147
 
 
148
    def as_short_text(self):
 
149
        """Return short digest-based testament."""
 
150
        s = sha.sha(self.to_text_form_1())
 
151
        return ('bazaar-ng testament short form 1\n'
 
152
                'revision %s\n'
 
153
                'sha1 %s\n'
 
154
                % (self.revision_id, s.hexdigest()))
 
155