/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 tree.py

Implement GitRevisionTree.path_content_summary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
235
235
            return None, False, None
236
236
        return entry.kind, entry.executable, None
237
237
 
 
238
    def path_content_summary(self, path):
 
239
        """See Tree.path_content_summary."""
 
240
        try:
 
241
            (mode, hexsha) = tree_lookup_path(self.store.__getitem__, self.tree, path)
 
242
        except KeyError:
 
243
            return ('missing', None, None, None)
 
244
        kind = mode_kind(mode)
 
245
        if kind == 'file':
 
246
            executable = mode_is_executable(mode)
 
247
            contents = self.store[hexsha].data
 
248
            return (kind, len(contents), executable, osutils.sha_string(contents))
 
249
        elif kind == 'symlink':
 
250
            return (kind, None, None, self.store[hexsha].data)
 
251
        else:
 
252
            return (kind, None, None, None)
 
253
 
238
254
 
239
255
def tree_delta_from_git_changes(changes, mapping,
240
256
        (old_fileid_map, new_fileid_map), specific_file=None,