/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: Robert Collins
  • Date: 2010-05-11 08:36:16 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100511083616-b8fjb19zomwupid0
Make all lock methods return Result objects, rather than lock_read returning self, as per John's review.

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
 
        my_file = self.get_file(file_id, path=path, filtered=filtered)
467
 
        try:
468
 
            return my_file.read()
469
 
        finally:
470
 
            my_file.close()
 
466
        return self.get_file(file_id, path=path, filtered=filtered).read()
471
467
 
472
468
    def get_file_byname(self, filename, filtered=True):
473
469
        path = self.abspath(filename)
527
523
 
528
524
        # Now we have the parents of this content
529
525
        annotator = self.branch.repository.texts.get_annotator()
530
 
        text = self.get_file_text(file_id)
 
526
        text = self.get_file(file_id).read()
531
527
        this_key =(file_id, default_revision)
532
528
        annotator.add_special_text(this_key, file_parent_keys, text)
533
529
        annotations = [(key[-1], line)
1975
1971
        def recurse_directory_to_add_files(directory):
1976
1972
            # Recurse directory and add all files
1977
1973
            # so we can check if they have changed.
1978
 
            for parent_info, file_infos in self.walkdirs(directory):
 
1974
            for parent_info, file_infos in\
 
1975
                self.walkdirs(directory):
1979
1976
                for relpath, basename, kind, lstat, fileid, kind in file_infos:
1980
1977
                    # Is it versioned or ignored?
1981
1978
                    if self.path2id(relpath) or self.is_ignored(relpath):
2016
2013
                            # ... but not ignored
2017
2014
                            has_changed_files = True
2018
2015
                            break
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.
 
2016
                    elif content_change and (kind[1] is not None):
 
2017
                        # Versioned and changed, but not deleted
2023
2018
                        has_changed_files = True
2024
2019
                        break
2025
2020