~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: John Arbash Meinel
  • Date: 2009-09-02 13:32:52 UTC
  • mfrom: (4634.6.14 2.0)
  • mto: (4634.6.15 2.0)
  • mto: This revision was merged to the branch mainline in revision 4667.
  • Revision ID: john@arbash-meinel.com-20090902133252-t2t94xtckoliv2th
Merge lp:bzr/2.0 to resolve NEWS issues.

Show diffs side-by-side

added added

removed removed

Lines of Context:
613
613
 
614
614
    def get_file_size(self, file_id):
615
615
        """See Tree.get_file_size"""
 
616
        # XXX: this returns the on-disk size; it should probably return the
 
617
        # canonical size
616
618
        try:
617
619
            return os.path.getsize(self.id2abspath(file_id))
618
620
        except OSError, e:
749
751
            raise
750
752
        kind = _mapper(stat_result.st_mode)
751
753
        if kind == 'file':
752
 
            size = stat_result.st_size
753
 
            # try for a stat cache lookup
754
 
            executable = self._is_executable_from_path_and_stat(path, stat_result)
755
 
            return (kind, size, executable, self._sha_from_stat(
756
 
                path, stat_result))
 
754
            return self._file_content_summary(path, stat_result)
757
755
        elif kind == 'directory':
758
756
            # perhaps it looks like a plain directory, but it's really a
759
757
            # reference.
766
764
        else:
767
765
            return (kind, None, None, None)
768
766
 
 
767
    def _file_content_summary(self, path, stat_result):
 
768
        size = stat_result.st_size
 
769
        executable = self._is_executable_from_path_and_stat(path, stat_result)
 
770
        # try for a stat cache lookup
 
771
        return ('file', size, executable, self._sha_from_stat(
 
772
            path, stat_result))
 
773
 
769
774
    def _check_parents_for_ghosts(self, revision_ids, allow_leftmost_as_ghost):
770
775
        """Common ghost checking functionality from set_parent_*.
771
776