/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 bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-19 04:28:39 UTC
  • mfrom: (2911.4.3 graph)
  • Revision ID: pqm@pqm.ubuntu.com-20071019042839-xwvsz0loa77yokxm
(robertc) Create a reusable HeadsCache in graph.HeadsCache. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
            self._timezone = int(timezone)
117
117
 
118
118
        self._generate_revision_if_needed()
119
 
        self._repo_graph = repository.get_graph()
 
119
        self._heads = graph.HeadsCache(repository.get_graph()).heads
120
120
 
121
121
    def commit(self, message):
122
122
        """Make the actual commit.
285
285
        # XXX: Friction: parent_candidates should return a list not a dict
286
286
        #      so that we don't have to walk the inventories again.
287
287
        parent_candiate_entries = ie.parent_candidates(parent_invs)
288
 
        head_set = self._repo_graph.heads(parent_candiate_entries.keys())
 
288
        head_set = self._heads(parent_candiate_entries.keys())
289
289
        heads = []
290
290
        for inv in parent_invs:
291
291
            if ie.file_id in inv:
2486
2486
        self.revision_versions = {}
2487
2487
        self.revision_parents = {}
2488
2488
        self.repo_graph = self.repository.get_graph()
2489
 
        self.rev_heads = {}
 
2489
        # XXX: RBC: I haven't tracked down what uses this, but it would be
 
2490
        # better to use the headscache directly I think.
 
2491
        self.heads = graph.HeadsCache(self.repo_graph).heads
2490
2492
 
2491
2493
    def add_revision_text_versions(self, tree):
2492
2494
        """Cache text version data from the supplied revision tree"""
2531
2533
            self.revision_parents[revision_id] = parents
2532
2534
            return parents
2533
2535
 
2534
 
    def heads(self, revision_ids):
2535
 
        revision_ids = tuple(revision_ids)
2536
 
        try:
2537
 
            return self.rev_heads[revision_ids]
2538
 
        except KeyError:
2539
 
            heads = self.repo_graph.heads(revision_ids)
2540
 
            self.rev_heads[revision_ids] = heads
2541
 
            return heads
2542
2536
 
2543
2537
class VersionedFileChecker(object):
2544
2538