/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: Ian Clatworthy
  • Date: 2008-12-18 06:41:29 UTC
  • mto: (4171.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 4173.
  • Revision ID: ian.clatworthy@canonical.com-20081218064129-ifzxuk0lbftgf67v
add and use supports_content_filtering API

Show diffs side-by-side

added added

removed removed

Lines of Context:
566
566
        """
567
567
        raise NotImplementedError(self.walkdirs)
568
568
 
 
569
    def supports_content_filtering(self):
 
570
        return False
 
571
 
569
572
    def _content_filter_stack(self, path=None, file_id=None):
570
 
        """The stack of content filters for a path.
571
 
        
 
573
        """The stack of content filters for a path if filtering is supported.
 
574
 
572
575
        Readers will be applied in first-to-last order.
573
576
        Writers will be applied in last-to-first order.
574
577
        Either the path or the file-id needs to be provided.
589
592
            note("*** %s content-filter: %s => %r" % (path,prefs,stk))
590
593
        return stk
591
594
 
 
595
    def _content_filter_stack_provider(self):
 
596
        """A function that returns a stack of ContentFilters.
 
597
 
 
598
        The function takes a path (relative to the top of the tree) and a
 
599
        file-id as parameters.
 
600
 
 
601
        :return: None if content filtering is not supported by this tree.
 
602
        """
 
603
        if self.supports_content_filtering():
 
604
            return lambda path, file_id: \
 
605
                    self._content_filter_stack(path, file_id)
 
606
        else:
 
607
            return None
 
608
 
592
609
    def iter_search_rules(self, path_names, pref_names=None,
593
610
        _default_searcher=rules._per_user_searcher):
594
611
        """Find the preferences for filenames in a tree.