~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/testament.py

  • Committer: John Arbash Meinel
  • Date: 2011-04-20 15:06:17 UTC
  • mto: This revision was merged to the branch mainline in revision 5836.
  • Revision ID: john@arbash-meinel.com-20110420150617-i41caxgemg32tq1r
Start adding tests that _worth_saving_limit works as expected.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
* the testament uses unix line-endings (\n)
60
60
"""
61
61
 
62
 
from __future__ import absolute_import
63
 
 
64
62
# XXX: At the moment, clients trust that the graph described in a weave
65
63
# is accurate, but that's not covered by the testament.  Perhaps the best
66
64
# fix is when verifying a revision to make sure that every file mentioned
76
74
from bzrlib.osutils import (
77
75
    contains_whitespace,
78
76
    contains_linebreaks,
79
 
    sha_strings,
 
77
    sha,
80
78
    )
81
79
from bzrlib.tree import Tree
82
80
 
211
209
        return r
212
210
 
213
211
    def as_sha1(self):
214
 
        return sha_strings(self.as_text_lines())
 
212
        s = sha()
 
213
        map(s.update, self.as_text_lines())
 
214
        return s.hexdigest()
215
215
 
216
216
 
217
217
class StrictTestament(Testament):