~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisiontree.py

(gz) Never raise KnownFailure in tests,
 use knownFailure method instead (Martin [gz])

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))
216
211
    def iter_files_bytes(self, desired_files):
217
212
        """See Tree.iter_files_bytes.
218
213
 
219
 
        This version is implemented on top of Repository.iter_files_bytes"""
 
214
        This version is implemented on top of Repository.extract_files_bytes"""
220
215
        repo_desired_files = [(f, self.get_file_revision(f), i)
221
216
                              for f, i in desired_files]
222
217
        try:
223
218
            for result in self._repository.iter_files_bytes(repo_desired_files):
224
219
                yield result
225
220
        except errors.RevisionNotPresent, e:
226
 
            raise errors.NoSuchFile(e.file_id)
 
221
            raise errors.NoSuchFile(e.revision_id)
227
222
 
228
223
    def annotate_iter(self, file_id,
229
224
                      default_revision=revision.CURRENT_REVISION):