~ubuntu-branches/ubuntu/lucid/bzr/lucid-proposed

« back to all changes in this revision

Viewing changes to bzrlib/testament.py

  • Committer: Bazaar Package Importer
  • Author(s): Jeff Bailey
  • Date: 2006-03-20 08:31:00 UTC
  • mfrom: (1.1.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060320083100-ovdi2ssuw0epcx8s
Tags: 0.8~200603200831-0ubuntu1
* Snapshot uploaded to Dapper at Martin Pool's request.

* Disable testsuite for upload.  Fakeroot and the testsuite don't
  play along.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
    """
89
89
 
90
90
    @classmethod
91
 
    def from_revision(cls, branch, revision_id):
 
91
    def from_revision(cls, repository, revision_id):
92
92
        """Produce a new testament from a historical revision"""
93
 
        rev = branch.get_revision(revision_id)
94
 
        inventory = branch.get_inventory(revision_id)
 
93
        rev = repository.get_revision(revision_id)
 
94
        inventory = repository.get_inventory(revision_id)
95
95
        return cls(rev, inventory)
96
96
 
97
97
    def __init__(self, rev, inventory):
114
114
        hashed in that encoding.
115
115
        """
116
116
        r = []
117
 
        def a(s):
118
 
            r.append(s)
 
117
        a = r.append
119
118
        a('bazaar-ng testament version 1\n')
120
119
        a('revision-id: %s\n' % self.revision_id)
121
120
        a('committer: %s\n' % self.committer)
137
136
            for l in r:
138
137
                assert isinstance(l, basestring), \
139
138
                    '%r of type %s is not a plain string' % (l, type(l))
140
 
        return r
 
139
        return [line.encode('utf-8') for line in r]
141
140
 
142
141
    def _escape_path(self, path):
143
142
        assert not contains_linebreaks(path)