/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/graph.py

  • Committer: John Arbash Meinel
  • Date: 2008-03-10 15:10:47 UTC
  • mto: This revision was merged to the branch mainline in revision 3281.
  • Revision ID: john@arbash-meinel.com-20080310151047-4vm0q4357if5q856
Respond to abentley's review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
427
427
    def iter_ancestry(self, revision_ids):
428
428
        """Iterate the ancestry of this revision.
429
429
 
430
 
        The specific order is undefined, but children should be returned before
431
 
        parents.
432
 
 
433
430
        :param revision_ids: Nodes to start the search
434
431
        :return: Yield tuples mapping a revision_id to its parents for the
435
432
            ancestry of revision_id.
436
 
            Ghosts will be returned with parents of the empty tuple, and nodes
 
433
            Ghosts will be returned with None as their parents, and nodes
437
434
            with no parents will have NULL_REVISION as their only parent. (As
438
435
            defined by get_parent_map.)
439
 
            There also be a node for (NULL_REVISION, ())
 
436
            There will also be a node for (NULL_REVISION, ())
440
437
        """
441
 
        # XXX: Do we want to guarantee that children will be returned before
442
 
        #      parents? At present that is the order, but I don't know that it
443
 
        #      is beneficial to require it.
444
438
        pending = set(revision_ids)
445
439
        processed = set()
446
440
        while pending:
452
446
                next_pending.update(p for p in item[1] if p not in processed)
453
447
            ghosts = pending.difference(next_map)
454
448
            for ghost in ghosts:
455
 
                yield (ghost, ())
 
449
                yield (ghost, None)
456
450
            pending = next_pending
457
451
 
458
452
    def iter_topo_order(self, revisions):