~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_known_graph_pyx.pyx

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-07-20 12:47:06 UTC
  • mfrom: (4553.1.1 1.17-comes-back)
  • Revision ID: pqm@pqm.ubuntu.com-20090720124706-b52fp9fcciu17np7
(jml) Merge in changes from 1.17.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    ctypedef struct PyObject:
26
26
        pass
27
27
 
28
 
    object PyFrozenSet_New(object)
29
 
 
30
28
    object PyTuple_New(Py_ssize_t n)
31
29
    Py_ssize_t PyTuple_GET_SIZE(object t)
32
30
    PyObject * PyTuple_GET_ITEM(object t, Py_ssize_t o)
267
265
        cdef Py_ssize_t pos, last_item
268
266
        cdef long min_gdfo
269
267
 
270
 
        heads_key = PyFrozenSet_New(keys)
 
268
        heads_key = frozenset(keys)
271
269
        maybe_heads = PyDict_GetItem(self._known_heads, heads_key)
272
270
        if maybe_heads != NULL:
273
271
            return <object>maybe_heads
285
283
            if not candidate_nodes:
286
284
                return frozenset([NULL_REVISION])
287
285
            # The keys changed, so recalculate heads_key
288
 
            heads_key = PyFrozenSet_New(candidate_nodes)
 
286
            heads_key = frozenset(candidate_nodes)
289
287
        if PyDict_Size(candidate_nodes) < 2:
290
288
            return heads_key
291
289
 
330
328
            node = <_KnownGraphNode>temp_node
331
329
            if not node.seen:
332
330
                PyList_Append(heads, node.key)
333
 
        heads = PyFrozenSet_New(heads)
 
331
        heads = frozenset(heads)
334
332
        for pos from 0 <= pos < PyList_GET_SIZE(cleanup):
335
333
            node = _get_list_node(cleanup, pos)
336
334
            node.seen = 0