/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 bzrlib/tree.py

  • Committer: Jelmer Vernooij
  • Date: 2009-05-28 16:04:39 UTC
  • mfrom: (4387 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4405.
  • Revision ID: jelmer@samba.org-20090528160439-4z0xlrk5nejobm7q
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
202
202
            specific_file_ids=specific_file_ids)
203
203
 
204
204
    def iter_references(self):
205
 
        for path, entry in self.iter_entries_by_dir():
206
 
            if entry.kind == 'tree-reference':
207
 
                yield path, entry.file_id
 
205
        if self.supports_tree_reference():
 
206
            for path, entry in self.iter_entries_by_dir():
 
207
                if entry.kind == 'tree-reference':
 
208
                    yield path, entry.file_id
208
209
 
209
210
    def kind(self, file_id):
210
211
        raise NotImplementedError("Tree subclass %s must implement kind"
262
263
        """
263
264
        raise NotImplementedError(self.get_file)
264
265
 
 
266
    def get_file_with_stat(self, file_id, path=None):
 
267
        """Get a file handle and stat object for file_id.
 
268
 
 
269
        The default implementation returns (self.get_file, None) for backwards
 
270
        compatibility.
 
271
 
 
272
        :param file_id: The file id to read.
 
273
        :param path: The path of the file, if it is known.
 
274
        :return: A tuple (file_handle, stat_value_or_None). If the tree has
 
275
            no stat facility, or need for a stat cache feedback during commit,
 
276
            it may return None for the second element of the tuple.
 
277
        """
 
278
        return (self.get_file(file_id, path), None)
 
279
 
265
280
    def get_file_text(self, file_id, path=None):
266
281
        """Return the byte content of a file.
267
282
 
657
672
            return None
658
673
 
659
674
    def iter_search_rules(self, path_names, pref_names=None,
660
 
        _default_searcher=rules._per_user_searcher):
 
675
        _default_searcher=None):
661
676
        """Find the preferences for filenames in a tree.
662
677
 
663
678
        :param path_names: an iterable of paths to find attributes for.
667
682
        :return: an iterator of tuple sequences, one per path-name.
668
683
          See _RulesSearcher.get_items for details on the tuple sequence.
669
684
        """
 
685
        if _default_searcher is None:
 
686
            _default_searcher = rules._per_user_searcher
670
687
        searcher = self._get_rules_searcher(_default_searcher)
671
688
        if searcher is not None:
672
689
            if pref_names is not None: