~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/graph.py

  • Committer: John Arbash Meinel
  • Date: 2009-09-24 19:26:45 UTC
  • mto: (4634.52.3 2.0)
  • mto: This revision was merged to the branch mainline in revision 4716.
  • Revision ID: john@arbash-meinel.com-20090924192645-hyy1ycnnk6u3j5j6
Catch a corner case that we were missing.
The CHKInventory tests were passing, but failed for test_inv because
we were passing None to _getitems(). That only failed for InternalNodes,
but we were using a structure that didn't have internal nodes.
So now the test is parameterized on a small CHKInventory page size
to force those things out into the open.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from bzrlib import (
20
20
    debug,
21
21
    errors,
22
 
    osutils,
23
22
    revision,
24
23
    trace,
25
24
    )
1679
1678
    return result
1680
1679
 
1681
1680
 
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
 
 
1695
1681
_counters = [0,0,0,0,0,0,0]
1696
1682
try:
1697
1683
    from bzrlib._known_graph_pyx import KnownGraph
1698
 
except ImportError, e:
1699
 
    osutils.failed_to_load_extension(e)
 
1684
except ImportError:
1700
1685
    from bzrlib._known_graph_py import KnownGraph