/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/workingtree.py

  • Committer: Ian Clatworthy
  • Date: 2008-05-01 07:25:21 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-20080501072521-e039tt9ry30bbqf9
add filtered option to get_file and get_file_byname in workingtree.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
485
485
    def has_filename(self, filename):
486
486
        return osutils.lexists(self.abspath(filename))
487
487
 
488
 
    def get_file(self, file_id, path=None):
 
488
    def get_file(self, file_id, path=None, filtered=True):
489
489
        if path is None:
490
490
            path = self.id2path(file_id)
491
 
        return self.get_file_byname(path)
 
491
        return self.get_file_byname(path, filtered=filtered)
492
492
 
493
493
    def get_file_text(self, file_id):
494
494
        return self.get_file(file_id).read()
495
495
 
496
 
    def get_file_byname(self, filename):
 
496
    def get_file_byname(self, filename, filtered=True):
497
497
        path = self.abspath(filename)
498
 
        filters = self._content_filter_stack(filename)
499
 
        return filtered_input_file(file(path, 'rb'), filters)
 
498
        f = file(path, 'rb')
 
499
        if filtered:
 
500
            filters = self._content_filter_stack(filename)
 
501
            return filtered_input_file(f, filters)
 
502
        else:
 
503
            return f
500
504
 
501
505
    @needs_read_lock
502
506
    def annotate_iter(self, file_id, default_revision=CURRENT_REVISION):