/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/revisiontree.py

  • Committer: Jelmer Vernooij
  • Date: 2018-06-14 17:59:16 UTC
  • mto: This revision was merged to the branch mainline in revision 7065.
  • Revision ID: jelmer@jelmer.uk-20180614175916-a2e2xh5k533guq1x
Move breezy.plugins.git to breezy.git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""RevisionTree - a Tree implementation backed by repository data for a revision."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
from io import BytesIO
20
22
from . import (
 
23
    errors,
21
24
    lock,
22
25
    revision,
23
26
    tree,
41
44
 
42
45
    def supports_tree_reference(self):
43
46
        return getattr(self._repository._format, "supports_tree_reference",
44
 
                       False)
 
47
            False)
45
48
 
46
49
    def get_parent_ids(self):
47
50
        """See Tree.get_parent_ids.
59
62
        """Return the revision id associated with this tree."""
60
63
        return self._revision_id
61
64
 
62
 
    def get_file_revision(self, path):
 
65
    def get_file_revision(self, path, file_id=None):
63
66
        """Return the revision id in which a file was last changed."""
64
67
        raise NotImplementedError(self.get_file_revision)
65
68
 
66
 
    def get_file_text(self, path):
 
69
    def get_file_text(self, path, file_id=None):
67
70
        for (identifier, content) in self.iter_files_bytes([(path, None)]):
68
71
            ret = b"".join(content)
69
72
        return ret
70
73
 
71
 
    def get_file(self, path):
72
 
        return BytesIO(self.get_file_text(path))
 
74
    def get_file(self, path, file_id=None):
 
75
        return BytesIO(self.get_file_text(path, file_id))
73
76
 
74
77
    def is_locked(self):
75
78
        return self._repository.is_locked()
89
92
        """See Tree._get_rules_searcher."""
90
93
        if self._rules_searcher is None:
91
94
            self._rules_searcher = super(RevisionTree,
92
 
                                         self)._get_rules_searcher(default_searcher)
 
95
                self)._get_rules_searcher(default_searcher)
93
96
        return self._rules_searcher