~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisiontree.py

(jelmer) Deprecate Repository.iter_reverse_revision_history(). (Jelmer
 Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        self._revision_id = revision_id
37
37
        self._rules_searcher = None
38
38
 
39
 
    def has_versioned_directories(self):
40
 
        """See `Tree.has_versioned_directories`."""
41
 
        return self._repository._format.supports_versioned_directories
42
 
 
43
39
    def supports_tree_reference(self):
44
40
        return getattr(self._repository._format, "supports_tree_reference",
45
41
            False)
65
61
        raise NotImplementedError(self.get_file_revision)
66
62
 
67
63
    def get_file_text(self, file_id, path=None):
68
 
        for (identifier, content) in self.iter_files_bytes([(file_id, None)]):
69
 
            ret = "".join(content)
70
 
        return ret
 
64
        _, content = list(self.iter_files_bytes([(file_id, None)]))[0]
 
65
        return ''.join(content)
71
66
 
72
67
    def get_file(self, file_id, path=None):
73
68
        return StringIO(self.get_file_text(file_id))
184
179
    def _file_size(self, entry, stat_value):
185
180
        return entry.text_size
186
181
 
 
182
    def _get_ancestors(self, default_revision):
 
183
        return set(self._repository.get_ancestry(self._revision_id,
 
184
                                                 topo_sorted=False))
 
185
 
187
186
    def walkdirs(self, prefix=""):
188
187
        _directory = 'directory'
189
188
        inv = self.inventory
216
215
    def iter_files_bytes(self, desired_files):
217
216
        """See Tree.iter_files_bytes.
218
217
 
219
 
        This version is implemented on top of Repository.iter_files_bytes"""
 
218
        This version is implemented on top of Repository.extract_files_bytes"""
220
219
        repo_desired_files = [(f, self.get_file_revision(f), i)
221
220
                              for f, i in desired_files]
222
221
        try:
223
222
            for result in self._repository.iter_files_bytes(repo_desired_files):
224
223
                yield result
225
224
        except errors.RevisionNotPresent, e:
226
 
            raise errors.NoSuchFile(e.file_id)
 
225
            raise errors.NoSuchFile(e.revision_id)
227
226
 
228
227
    def annotate_iter(self, file_id,
229
228
                      default_revision=revision.CURRENT_REVISION):