/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: Robert Collins
  • Date: 2008-04-04 00:43:07 UTC
  • mfrom: (3331 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3333.
  • Revision ID: robertc@robertcollins.net-20080404004307-0whomfhm3yal2rvw
Resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    RepositoryFormat,
44
44
    )
45
45
from bzrlib.store.text import TextStore
 
46
from bzrlib.symbol_versioning import deprecated_method, one_four
46
47
from bzrlib.trace import mutter
47
48
 
48
49
 
107
108
        consistency and is only applicable to inventory-weave-for-ancestry
108
109
        using repository formats & fetchers.
109
110
        """
110
 
        weave_parents = inventory.get_parents(revision.revision_id)
111
 
        weave_names = inventory.versions()
 
111
        weave_parents = inventory.get_parent_map(
 
112
            [revision.revision_id])[revision.revision_id]
 
113
        parent_map = inventory.get_parent_map(revision.parent_ids)
112
114
        for parent_id in revision.parent_ids:
113
 
            if parent_id in weave_names:
 
115
            if parent_id in parent_map:
114
116
                # this parent must not be a ghost.
115
117
                if not parent_id in weave_parents:
116
118
                    # but it is a ghost
140
142
            self._check_revision_parents(rev, inv)
141
143
        return revs
142
144
 
 
145
    @deprecated_method(one_four)
143
146
    @needs_read_lock
144
147
    def get_revision_graph(self, revision_id=None):
145
148
        """Return a dictionary containing the revision graph.
158
161
        a_weave = self.get_inventory_weave()
159
162
        all_revisions = self._eliminate_revisions_not_present(
160
163
                                a_weave.versions())
161
 
        entire_graph = dict([(node, tuple(a_weave.get_parents(node))) for 
162
 
                             node in all_revisions])
 
164
        entire_graph = a_weave.get_parent_map(all_revisions)
163
165
        if revision_id is None:
164
166
            return entire_graph
165
167
        elif revision_id not in entire_graph:
247
249
        consistency and is only applicable to inventory-weave-for-ancestry
248
250
        using repository formats & fetchers.
249
251
        """
250
 
        weave_parents = inventory.get_parents(revision.revision_id)
251
 
        weave_names = inventory.versions()
 
252
        weave_parents = inventory.get_parent_map(
 
253
            [revision.revision_id])[revision.revision_id]
 
254
        parent_map = inventory.get_parent_map(revision.parent_ids)
252
255
        for parent_id in revision.parent_ids:
253
 
            if parent_id in weave_names:
 
256
            if parent_id in parent_map:
254
257
                # this parent must not be a ghost.
255
258
                if not parent_id in weave_parents:
256
259
                    # but it is a ghost
281
284
        self._check_revision_parents(r, inv)
282
285
        return r
283
286
 
 
287
    @deprecated_method(one_four)
284
288
    @needs_read_lock
285
289
    def get_revision_graph(self, revision_id=None):
286
290
        """Return a dictionary containing the revision graph.
299
303
        a_weave = self.get_inventory_weave()
300
304
        all_revisions = self._eliminate_revisions_not_present(
301
305
                                a_weave.versions())
302
 
        entire_graph = dict([(node, tuple(a_weave.get_parents(node))) for 
303
 
                             node in all_revisions])
 
306
        entire_graph = a_weave.get_parent_map(all_revisions)
304
307
        if revision_id is None:
305
308
            return entire_graph
306
309
        elif revision_id not in entire_graph: