/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: 2007-09-27 21:11:38 UTC
  • mfrom: (2871 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2879.
  • Revision ID: robertc@robertcollins.net-20070927211138-ebsu1bo1qz9f1w8n
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
702
702
        if updated:
703
703
            self.set_parent_ids(parents, allow_leftmost_as_ghost=True)
704
704
 
705
 
    def path_content_summary(self, path, _lstat=os.lstat,
 
705
    def path_content_summary(self, path, _lstat=osutils.lstat,
706
706
        _mapper=osutils.file_kind_from_stat_mode):
707
707
        """See Tree.path_content_summary."""
708
708
        abspath = self.abspath(path)
712
712
            if getattr(e, 'errno', None) == errno.ENOENT:
713
713
                # no file.
714
714
                return ('missing', None, None, None)
715
 
            # propogate other errors
 
715
            # propagate other errors
716
716
            raise
717
717
        kind = _mapper(stat_result.st_mode)
718
718
        if kind == 'file':
723
723
            else:
724
724
                mode = stat_result.st_mode
725
725
                executable = bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
726
 
            sha1 = None # 'stat-hit-check' here
727
 
            return (kind, size, executable, sha1)
 
726
            return (kind, size, executable, self._sha_from_stat(
 
727
                path, stat_result))
728
728
        elif kind == 'directory':
729
729
            # perhaps it looks like a plain directory, but it's really a
730
730
            # reference.
833
833
                yield Stanza(file_id=file_id.decode('utf8'), hash=hash)
834
834
        self._put_rio('merge-hashes', iter_stanzas(), MERGE_MODIFIED_HEADER_1)
835
835
 
 
836
    def _sha_from_stat(self, path, stat_result):
 
837
        """Get a sha digest from the tree's stat cache.
 
838
 
 
839
        The default implementation assumes no stat cache is present.
 
840
 
 
841
        :param path: The path.
 
842
        :param stat_result: The stat result being looked up.
 
843
        """
 
844
        return None
 
845
 
836
846
    def _put_rio(self, filename, stanzas, header):
837
847
        self._must_be_locked()
838
848
        my_file = rio_file(stanzas, header)