/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: 2008-03-28 06:42:20 UTC
  • mfrom: (3287.6.9 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080328064220-ongijg78bfqhvbay
Deprecate a number of VersionedFile method calls,
        and Repository.get_revision_graph. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1339
1339
        """
1340
1340
        # All revisions, to find inventory parents.
1341
1341
        if ancestors is None:
1342
 
            # self.get_revision_graph_with_ghosts().get_ancestors() wasn't
1343
 
            # returning any ghosts anyway.
1344
 
            ancestors = self.get_revision_graph()
 
1342
            graph = self.get_graph()
 
1343
            ancestors = graph.get_parent_map(self.all_revision_ids())
1345
1344
        if text_key_references is None:
1346
1345
            text_key_references = self.find_text_key_references()
1347
1346
        pb = ui.ui_factory.nested_progress_bar()
1553
1552
        return self.get_revision(revision_id).inventory_sha1
1554
1553
 
1555
1554
    @needs_read_lock
 
1555
    @deprecated_method(symbol_versioning.one_four)
1556
1556
    def get_revision_graph(self, revision_id=None):
1557
1557
        """Return a dictionary containing the revision graph.
1558
1558
 
3140
3140
                if correct_parents != knit_parents:
3141
3141
                    wrong_parents[revision_id] = (knit_parents, correct_parents)
3142
3142
        return wrong_parents, unused_versions
 
3143
 
 
3144
 
 
3145
def _old_get_graph(repository, revision_id):
 
3146
    """DO NOT USE. That is all. I'm serious."""
 
3147
    graph = repository.get_graph()
 
3148
    revision_graph = dict(((key, value) for key, value in
 
3149
        graph.iter_ancestry([revision_id]) if value is not None))
 
3150
    return _strip_NULL_ghosts(revision_graph)
 
3151
 
 
3152
 
 
3153
def _strip_NULL_ghosts(revision_graph):
 
3154
    """Also don't use this. more compatibility code for unmigrated clients."""
 
3155
    # Filter ghosts, and null:
 
3156
    if _mod_revision.NULL_REVISION in revision_graph:
 
3157
        del revision_graph[_mod_revision.NULL_REVISION]
 
3158
    for key, parents in revision_graph.items():
 
3159
        revision_graph[key] = tuple(parent for parent in parents if parent
 
3160
            in revision_graph)
 
3161
    return revision_graph