1070
1070
def annotate(self, key):
1071
1071
"""See VersionedFiles.annotate."""
1073
parent_map = self.get_parent_map([key])
1075
raise errors.RevisionNotPresent(key, self)
1076
if parent_map[key] is not None:
1077
parent_map = dict((k, v) for k, v in graph.iter_ancestry([key])
1079
keys = parent_map.keys()
1082
parent_map = {key:()}
1083
# We used Graph(self) to load the parent_map, but now that we have it,
1084
# we can just query the parent map directly, so create a KnownGraph
1085
heads_provider = _mod_graph.KnownGraph(parent_map)
1087
reannotate = annotate.reannotate
1088
for record in self.get_record_stream(keys, 'topological', True):
1090
lines = osutils.chunks_to_lines(record.get_bytes_as('chunked'))
1091
parent_lines = [parent_cache[parent] for parent in parent_map[key]]
1092
parent_cache[key] = list(
1093
reannotate(parent_lines, lines, key, None, heads_provider))
1094
return parent_cache[key]
1072
ann = annotate.Annotator(self)
1073
return ann.annotate_flat(key)
1075
def get_annotator(self):
1076
return annotate.Annotator(self)
1096
1078
def check(self, progress_bar=None):
1097
1079
"""See VersionedFiles.check()."""