~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/changeset/common.py

  • Committer: Aaron Bentley
  • Date: 2006-05-25 17:13:14 UTC
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: abentley@panoramicfeedback.com-20060525171314-53d50ffcc34db055
Move calculation of Testament sha1s to Testament

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
Common entries, like strings, etc, for the changeset reading + writing code.
4
4
"""
5
5
 
6
 
from sha import sha
7
 
 
8
6
import bzrlib
9
 
from bzrlib.testament import StrictTestament
10
7
 
11
8
header_str = 'Bazaar changeset v'
12
9
version = (0, 7)
186
183
    return (timestamp, offset)
187
184
 
188
185
 
189
 
def testament_sha1(repository, revision_id):
190
 
    testament = StrictTestament.from_revision(repository, revision_id)
191
 
    text = testament.as_short_text()
192
 
    s = sha(text)
193
 
    return s.hexdigest()
194
 
 
195
 
 
196
186
if __name__ == '__main__':
197
187
    import doctest
198
188
    doctest.testmod()