~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/testament.py

  • Committer: Aaron Bentley
  • Date: 2006-02-22 14:39:42 UTC
  • mto: (2027.1.2 revert-subpath-56549)
  • mto: This revision was merged to the branch mainline in revision 1570.
  • Revision ID: abentley@panoramicfeedback.com-20060222143942-ae72299f2de66767
Fixed build_tree with symlinks

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)