~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_annotator_py.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-18 18:48:33 UTC
  • mto: This revision was merged to the branch mainline in revision 4522.
  • Revision ID: john@arbash-meinel.com-20090618184833-sbl535idwmrhh833
Start working on 'annotate_flat' which conforms to the original spec.

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
        except KeyError:
152
152
            raise errors.RevisionNotPresent(key, self._vf)
153
153
        return annotations, self._text_cache[key]
 
154
 
 
155
    def annotate_flat(self, key):
 
156
        """Determine the single-best-revision to source for each line.
 
157
 
 
158
        This is meant as a compatibility thunk to how annotate() used to work.
 
159
        """
 
160
        graph = _mod_graph.KnownGraph(self._parent_map)
 
161
        heads = graph.heads
 
162
        annotations, lines = self.annotate(key)
 
163
        assert len(annotations) == len(lines)
 
164
        out = []
 
165
        for annotation, line in zip(annotations, lines):
 
166
            if len(annotation) == 1:
 
167
                out.append((annotation[0], line))
 
168
        return out