~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/testament.py

Testament sha1 is the same as in short form (John A. Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
 
167
167
    def as_short_text(self):
168
168
        """Return short digest-based testament."""
169
 
        s = sha()
170
 
        map(s.update, self.as_text_lines())
171
169
        return (self.short_header + 
172
170
                'revision-id: %s\n'
173
171
                'sha1: %s\n'
174
 
                % (self.revision_id, s.hexdigest()))
 
172
                % (self.revision_id, self.as_sha1()))
175
173
 
176
174
    def _revprops_to_lines(self):
177
175
        """Pack up revision properties."""
189
187
        return r
190
188
 
191
189
    def as_sha1(self):
192
 
        return sha(self.as_short_text()).hexdigest()
 
190
        s = sha()
 
191
        map(s.update, self.as_text_lines())
 
192
        return s.hexdigest()
193
193
 
194
194
 
195
195
class StrictTestament(Testament):