~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_known_graph_pyx.pyx

  • Committer: Jonathan Lange
  • Date: 2009-07-20 11:27:05 UTC
  • mfrom: (4526.2.6 1.17)
  • mto: This revision was merged to the branch mainline in revision 4554.
  • Revision ID: jml@canonical.com-20090720112705-ss4o5s3zw3dbxsek
Merge 1.17, resolving conflicts.

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