~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-06 19:35:39 UTC
  • mfrom: (4086.1.4 hpss-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090306193539-h0q6dlyayhgcehta
(robertc, andrew) Add Branch.get_tags_dict RPC;
        Add optional 'fetch_spec' argument to Repository.fetch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1495
1495
        return self._keys
1496
1496
 
1497
1497
 
 
1498
class PendingAncestryResult(object):
 
1499
    """A search result that will reconstruct the ancestry for some graph heads.
 
1500
 
 
1501
    Unlike SearchResult, this doesn't hold the complete search result in
 
1502
    memory, it just holds a description of how to generate it.
 
1503
    """
 
1504
 
 
1505
    def __init__(self, heads, repo):
 
1506
        """Constructor.
 
1507
 
 
1508
        :param heads: an iterable of graph heads.
 
1509
        :param repo: a repository to use to generate the ancestry for the given
 
1510
            heads.
 
1511
        """
 
1512
        self.heads = heads
 
1513
        self.repo = repo
 
1514
 
 
1515
    def get_recipe(self):
 
1516
        raise NotImplementedError(self.get_recipe)
 
1517
 
 
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]
 
1526
        return keys
 
1527
 
 
1528
 
1498
1529
def collapse_linear_regions(parent_map):
1499
1530
    """Collapse regions of the graph that are 'linear'.
1500
1531