~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: John Arbash Meinel
  • Date: 2008-02-25 22:03:04 UTC
  • mto: This revision was merged to the branch mainline in revision 3281.
  • Revision ID: john@arbash-meinel.com-20080225220304-5shor4tu2zlrvl0x
API Friction... get_parent_map() artificially adds pointers to NULL_REVISION

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
        :return: A dictionary mapping revision_id => dotted revno.
212
212
        """
213
213
        last_revision = self.last_revision()
214
 
        revision_graph = self.repository.get_revision_graph(last_revision)
 
214
        g = self.repository.get_graph()
 
215
        ancestry = []
 
216
        null_parents = (_mod_revision.NULL_REVISION,)
 
217
        for revision_id, parents in g.iter_ancestry(last_revision):
 
218
            if parents == null_parents:
 
219
                ancestry.append((revision_id, ()))
 
220
            elif revision_id == _mod_revision.NULL_REVISION:
 
221
                continue
 
222
            else:
 
223
                ancestry.append((revision_id, parents))
215
224
        merge_sorted_revisions = tsort.merge_sort(
216
 
            revision_graph,
 
225
            ancestry,
217
226
            last_revision,
218
227
            None,
219
228
            generate_revno=True)