/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to annotate/gannotate.py

  • Committer: Aaron Bentley
  • Date: 2007-01-18 14:10:24 UTC
  • mfrom: (66.5.3 gtk.73965)
  • mto: This revision was merged to the branch mainline in revision 129.
  • Revision ID: abentley@panoramicfeedback.com-20070118141024-qoeb11l3olg0g6nl
Speed up the 'back' operation

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
        self.annotate_colormap = AnnotateColorSaturation()
55
55
 
56
56
        self._create()
 
57
        self.revisions = {}
57
58
 
58
59
    def annotate(self, tree, branch, file_id):
59
 
        self.revisions = {}
60
60
        self.annotations = []
61
61
        self.branch = branch
62
62
        self.tree = tree
145
145
        else:
146
146
            revision_id = self.revision_id
147
147
        dotted = self._dotted_revnos(repository, revision_id)
148
 
        revision_cache = RevisionCache(repository)
 
148
        revision_cache = RevisionCache(repository, self.revisions)
149
149
        for origin, text in tree.annotate_iter(file_id):
150
150
            rev_id = origin
151
151
            try:
346
346
 
347
347
class RevisionCache(object):
348
348
    """A caching revision source"""
349
 
    def __init__(self, real_source):
 
349
    def __init__(self, real_source, seed_cache=None):
350
350
        self.__real_source = real_source
351
 
        self.__cache = {}
 
351
        if seed_cache is None:
 
352
            self.__cache = {}
 
353
        else:
 
354
            self.__cache = dict(seed_cache)
352
355
 
353
356
    def get_revision(self, revision_id):
354
357
        if revision_id not in self.__cache: