~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/graph.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-10 05:28:23 UTC
  • mfrom: (4098.1.3 fix-pending-ancestry-keys)
  • Revision ID: pqm@pqm.ubuntu.com-20090310052823-5h4znt0j8j5ak38o
(andrew) Fix a bug with how PendingAncestryResult.get_keys handles
        NULL_REVISION.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1516
1516
        raise NotImplementedError(self.get_recipe)
1517
1517
 
1518
1518
    def get_keys(self):
1519
 
        """See SearchResult.get_keys."""
1520
 
        keys = [key for (key, parents) in
1521
 
                self.repo.get_graph().iter_ancestry(self.heads)]
1522
 
        if keys[-1] != 'null:':
1523
 
            raise AssertionError(
1524
 
                "Ancestry ends with %r, not null." % (keys[-1],))
1525
 
        del keys[-1]
 
1519
        """See SearchResult.get_keys.
 
1520
 
 
1521
        Returns all the keys for the ancestry of the heads, excluding
 
1522
        NULL_REVISION.
 
1523
        """
 
1524
        return self._get_keys(self.repo.get_graph())
 
1525
 
 
1526
    def _get_keys(self, graph):
 
1527
        NULL_REVISION = revision.NULL_REVISION
 
1528
        keys = [key for (key, parents) in graph.iter_ancestry(self.heads)
 
1529
                if key != NULL_REVISION]
1526
1530
        return keys
1527
1531
 
1528
1532