~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/weaverepo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-03-26 03:06:52 UTC
  • mfrom: (3287.5.10 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080326030652-vgwdkwda9mi8s200
Deprecate VersionedFile.get_parents. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        consistency and is only applicable to inventory-weave-for-ancestry
108
108
        using repository formats & fetchers.
109
109
        """
110
 
        weave_parents = inventory.get_parents(revision.revision_id)
111
 
        weave_names = inventory.versions()
 
110
        weave_parents = inventory.get_parent_map(
 
111
            [revision.revision_id])[revision.revision_id]
 
112
        parent_map = inventory.get_parent_map(revision.parent_ids)
112
113
        for parent_id in revision.parent_ids:
113
 
            if parent_id in weave_names:
 
114
            if parent_id in parent_map:
114
115
                # this parent must not be a ghost.
115
116
                if not parent_id in weave_parents:
116
117
                    # but it is a ghost
158
159
        a_weave = self.get_inventory_weave()
159
160
        all_revisions = self._eliminate_revisions_not_present(
160
161
                                a_weave.versions())
161
 
        entire_graph = dict([(node, tuple(a_weave.get_parents(node))) for 
162
 
                             node in all_revisions])
 
162
        entire_graph = a_weave.get_parent_map(all_revisions)
163
163
        if revision_id is None:
164
164
            return entire_graph
165
165
        elif revision_id not in entire_graph:
247
247
        consistency and is only applicable to inventory-weave-for-ancestry
248
248
        using repository formats & fetchers.
249
249
        """
250
 
        weave_parents = inventory.get_parents(revision.revision_id)
251
 
        weave_names = inventory.versions()
 
250
        weave_parents = inventory.get_parent_map(
 
251
            [revision.revision_id])[revision.revision_id]
 
252
        parent_map = inventory.get_parent_map(revision.parent_ids)
252
253
        for parent_id in revision.parent_ids:
253
 
            if parent_id in weave_names:
 
254
            if parent_id in parent_map:
254
255
                # this parent must not be a ghost.
255
256
                if not parent_id in weave_parents:
256
257
                    # but it is a ghost
299
300
        a_weave = self.get_inventory_weave()
300
301
        all_revisions = self._eliminate_revisions_not_present(
301
302
                                a_weave.versions())
302
 
        entire_graph = dict([(node, tuple(a_weave.get_parents(node))) for 
303
 
                             node in all_revisions])
 
303
        entire_graph = a_weave.get_parent_map(all_revisions)
304
304
        if revision_id is None:
305
305
            return entire_graph
306
306
        elif revision_id not in entire_graph: