/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: Martin Pool
  • Date: 2010-06-11 06:33:15 UTC
  • mto: This revision was merged to the branch mainline in revision 5296.
  • Revision ID: mbp@canonical.com-20100611063315-cba8kkz8zzeh8y37
ScriptRunner strips consistent leading indentation from scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
463
463
        return (file_obj, stat_value)
464
464
 
465
465
    def get_file_text(self, file_id, path=None, filtered=True):
466
 
        return self.get_file(file_id, path=path, filtered=filtered).read()
 
466
        my_file = self.get_file(file_id, path=path, filtered=filtered)
 
467
        try:
 
468
            return my_file.read()
 
469
        finally:
 
470
            my_file.close()
467
471
 
468
472
    def get_file_byname(self, filename, filtered=True):
469
473
        path = self.abspath(filename)
523
527
 
524
528
        # Now we have the parents of this content
525
529
        annotator = self.branch.repository.texts.get_annotator()
526
 
        text = self.get_file(file_id).read()
 
530
        text = self.get_file_text(file_id)
527
531
        this_key =(file_id, default_revision)
528
532
        annotator.add_special_text(this_key, file_parent_keys, text)
529
533
        annotations = [(key[-1], line)