~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/memorytree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-03 05:04:42 UTC
  • mfrom: (2776.4.19 commit)
  • Revision ID: pqm@pqm.ubuntu.com-20071003050442-e0x9ofdfo0hwxnal
(robertc) Move serialisation of inventory entries into CommitBuilder. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
            return None, False, None
99
99
        return entry.kind, entry.executable, None
100
100
 
 
101
    def path_content_summary(self, path):
 
102
        """See Tree.path_content_summary."""
 
103
        id = self.path2id(path)
 
104
        if id is None:
 
105
            return 'missing', None, None, None
 
106
        kind = self.kind(id)
 
107
        if kind == 'file':
 
108
            bytes = self._file_transport.get_bytes(path)
 
109
            size = len(bytes)
 
110
            executable = self._inventory[id].executable
 
111
            sha1 = None # no stat cache
 
112
            return (kind, size, executable, sha1)
 
113
        elif kind == 'directory':
 
114
            # memory tree does not support nested trees yet.
 
115
            return kind, None, None, None
 
116
        elif kind == 'symlink':
 
117
            raise NotImplementedError('symlink support')
 
118
        else:
 
119
            raise NotImplementedError('unknown kind')
 
120
 
101
121
    def _file_size(self, entry, stat_value):
102
122
        """See Tree._file_size."""
103
123
        if entry is None: