~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-12 03:33:24 UTC
  • mto: (1185.82.108 w-changeset)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: aaron.bentley@utoronto.ca-20060512033324-5947a3f509a1cb9d
Disabled validate_revisions (needs info it doesn't have), updated API to repos

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
 
6
8
import bzrlib
 
9
from bzrlib.testament import Testament
7
10
 
8
11
header_str = 'Bazaar-NG changeset v'
9
12
version = (0, 1, 0)
207
210
    timestamp += fract_seconds
208
211
    return (timestamp, offset)
209
212
 
 
213
 
 
214
def testament_sha1(repository, revision_id):
 
215
    text = Testament.from_revision(repository, revision_id).as_short_text()
 
216
    s = sha(text)
 
217
    return s.hexdigest()
 
218
 
 
219
 
210
220
if __name__ == '__main__':
211
221
    import doctest
212
222
    doctest.testmod()