~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-11-30 04:49:31 UTC
  • mfrom: (4819.2.6 2.1.0b4-convert-kg-heads)
  • Revision ID: pqm@pqm.ubuntu.com-20091130044931-b5rjfh24zq1d3lju
(jam) Improve conversion efficiency by using a better heads()
        implementation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1679
1679
    return result
1680
1680
 
1681
1681
 
 
1682
class GraphThunkIdsToKeys(object):
 
1683
    """Forwards calls about 'ids' to be about keys internally."""
 
1684
 
 
1685
    def __init__(self, graph):
 
1686
        self._graph = graph
 
1687
 
 
1688
    def heads(self, ids):
 
1689
        """See Graph.heads()"""
 
1690
        as_keys = [(i,) for i in ids]
 
1691
        head_keys = self._graph.heads(as_keys)
 
1692
        return set([h[0] for h in head_keys])
 
1693
 
 
1694
 
1682
1695
_counters = [0,0,0,0,0,0,0]
1683
1696
try:
1684
1697
    from bzrlib._known_graph_pyx import KnownGraph