~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2008-03-28 03:54:40 UTC
  • mto: This revision was merged to the branch mainline in revision 3313.
  • Revision ID: robertc@robertcollins.net-20080328035440-4cflvryqujresn2g
Reduce code duplication as per review.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        errors,
26
26
        lockdir,
27
27
        lockable_files,
 
28
        repository,
28
29
        revision as _mod_revision,
29
30
        transport,
30
31
        tsort,
192
193
        :return: A dictionary mapping revision_id => dotted revno.
193
194
        """
194
195
        last_revision = self.last_revision()
195
 
        graph = self.repository.get_graph()
196
 
        search = graph._make_breadth_first_searcher([last_revision])
197
 
        transitive_ids = set()
198
 
        map(transitive_ids.update, list(search))
199
 
        revision_graph = graph.get_parent_map(transitive_ids)
200
 
        # Filter ghosts, and null:
201
 
        if _mod_revision.NULL_REVISION in revision_graph:
202
 
            del revision_graph[_mod_revision.NULL_REVISION]
203
 
        for key, parents in revision_graph.items():
204
 
            revision_graph[key] = tuple(parent for parent in parents if parent
205
 
                in revision_graph)
 
196
        revision_graph = repository._old_get_graph(self.repository,
 
197
            last_revision)
206
198
        merge_sorted_revisions = tsort.merge_sort(
207
199
            revision_graph,
208
200
            last_revision,