/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: Canonical.com Patch Queue Manager
  • Date: 2010-06-04 05:59:55 UTC
  • mfrom: (5279.1.1 lazy-import-merge)
  • Revision ID: pqm@pqm.ubuntu.com-20100604055955-98pfcy1bn8oz7749
(spiv) Use lazy imports in bzrilb.merge to minimise the startup cost of
 plugins like news_merge. (Andrew Bennetts)

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)
1971
1975
        def recurse_directory_to_add_files(directory):
1972
1976
            # Recurse directory and add all files
1973
1977
            # so we can check if they have changed.
1974
 
            for parent_info, file_infos in\
1975
 
                self.walkdirs(directory):
 
1978
            for parent_info, file_infos in self.walkdirs(directory):
1976
1979
                for relpath, basename, kind, lstat, fileid, kind in file_infos:
1977
1980
                    # Is it versioned or ignored?
1978
1981
                    if self.path2id(relpath) or self.is_ignored(relpath):
2013
2016
                            # ... but not ignored
2014
2017
                            has_changed_files = True
2015
2018
                            break
2016
 
                    elif content_change and (kind[1] is not None):
2017
 
                        # Versioned and changed, but not deleted
 
2019
                    elif (content_change and (kind[1] is not None) and
 
2020
                            osutils.is_inside_any(files, path[1])):
 
2021
                        # Versioned and changed, but not deleted, and still
 
2022
                        # in one of the dirs to be deleted.
2018
2023
                        has_changed_files = True
2019
2024
                        break
2020
2025