/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/repofmt/weaverepo.py

  • Committer: Andrew Bennetts
  • Date: 2008-04-02 00:14:00 UTC
  • mfrom: (3324 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080402001400-r1pqse38i03dl97w
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    RepositoryFormat,
49
49
    )
50
50
from bzrlib.store.text import TextStore
 
51
from bzrlib.symbol_versioning import deprecated_method, one_four
51
52
from bzrlib.trace import mutter
52
53
 
53
54
 
114
115
        consistency and is only applicable to inventory-weave-for-ancestry
115
116
        using repository formats & fetchers.
116
117
        """
117
 
        weave_parents = inventory.get_parents(revision.revision_id)
118
 
        weave_names = inventory.versions()
 
118
        weave_parents = inventory.get_parent_map(
 
119
            [revision.revision_id])[revision.revision_id]
 
120
        parent_map = inventory.get_parent_map(revision.parent_ids)
119
121
        for parent_id in revision.parent_ids:
120
 
            if parent_id in weave_names:
 
122
            if parent_id in parent_map:
121
123
                # this parent must not be a ghost.
122
124
                if not parent_id in weave_parents:
123
125
                    # but it is a ghost
147
149
            self._check_revision_parents(rev, inv)
148
150
        return revs
149
151
 
 
152
    @deprecated_method(one_four)
150
153
    @needs_read_lock
151
154
    def get_revision_graph(self, revision_id=None):
152
155
        """Return a dictionary containing the revision graph.
165
168
        a_weave = self.get_inventory_weave()
166
169
        all_revisions = self._eliminate_revisions_not_present(
167
170
                                a_weave.versions())
168
 
        entire_graph = dict([(node, tuple(a_weave.get_parents(node))) for 
169
 
                             node in all_revisions])
 
171
        entire_graph = a_weave.get_parent_map(all_revisions)
170
172
        if revision_id is None:
171
173
            return entire_graph
172
174
        elif revision_id not in entire_graph:
256
258
        consistency and is only applicable to inventory-weave-for-ancestry
257
259
        using repository formats & fetchers.
258
260
        """
259
 
        weave_parents = inventory.get_parents(revision.revision_id)
260
 
        weave_names = inventory.versions()
 
261
        weave_parents = inventory.get_parent_map(
 
262
            [revision.revision_id])[revision.revision_id]
 
263
        parent_map = inventory.get_parent_map(revision.parent_ids)
261
264
        for parent_id in revision.parent_ids:
262
 
            if parent_id in weave_names:
 
265
            if parent_id in parent_map:
263
266
                # this parent must not be a ghost.
264
267
                if not parent_id in weave_parents:
265
268
                    # but it is a ghost
290
293
        self._check_revision_parents(r, inv)
291
294
        return r
292
295
 
 
296
    @deprecated_method(one_four)
293
297
    @needs_read_lock
294
298
    def get_revision_graph(self, revision_id=None):
295
299
        """Return a dictionary containing the revision graph.
308
312
        a_weave = self.get_inventory_weave()
309
313
        all_revisions = self._eliminate_revisions_not_present(
310
314
                                a_weave.versions())
311
 
        entire_graph = dict([(node, tuple(a_weave.get_parents(node))) for 
312
 
                             node in all_revisions])
 
315
        entire_graph = a_weave.get_parent_map(all_revisions)
313
316
        if revision_id is None:
314
317
            return entire_graph
315
318
        elif revision_id not in entire_graph: