~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: John Arbash Meinel
  • Date: 2010-01-13 16:23:07 UTC
  • mto: (4634.119.7 2.0)
  • mto: This revision was merged to the branch mainline in revision 4959.
  • Revision ID: john@arbash-meinel.com-20100113162307-0bs82td16gzih827
Update the MANIFEST.in file.

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
 
1893
1898
            firstline = xml.split('\n', 1)[0]
1894
1899
            if (not 'revision_id="' in firstline or
1895
1900
                'format="7"' not in firstline):
1896
 
                inv = self.branch.repository.deserialise_inventory(
1897
 
                    new_revision, xml)
 
1901
                inv = self.branch.repository._serializer.read_inventory_from_string(
 
1902
                    xml, new_revision)
1898
1903
                xml = self._create_basis_xml_from_inventory(new_revision, inv)
1899
1904
            self._write_basis_inventory(xml)
1900
1905
        except (errors.NoSuchRevision, errors.RevisionNotPresent):
3030
3035
        return self.get_format_string()
3031
3036
 
3032
3037
 
3033
 
__default_format = WorkingTreeFormat4()
 
3038
__default_format = WorkingTreeFormat6()
3034
3039
WorkingTreeFormat.register_format(__default_format)
3035
 
WorkingTreeFormat.register_format(WorkingTreeFormat6())
3036
3040
WorkingTreeFormat.register_format(WorkingTreeFormat5())
 
3041
WorkingTreeFormat.register_format(WorkingTreeFormat4())
3037
3042
WorkingTreeFormat.register_format(WorkingTreeFormat3())
3038
3043
WorkingTreeFormat.set_default_format(__default_format)
3039
3044
# formats which have no format string are not discoverable