# HG changeset patch # User Augie Fackler # Date 1439321650 14400 # Node ID bbb698697efc4ba9067e5db8a13b3c5e78632997 # Parent 59d57ea69ae6b86988e5a671c2343e697f68a43b reachableroots: fix transposition of set and list types in PyArg_ParseTuple This is being masked by the function not properly returning NULL when it raises an exception, so the client code was just falling back to the native codepath when it got None back. A future change removes all reason for this C function to return None, which exposed this problem during development. diff -r 59d57ea69ae6 -r bbb698697efc mercurial/parsers.c --- a/mercurial/parsers.c Tue Aug 11 14:50:39 2015 -0400 +++ b/mercurial/parsers.c Tue Aug 11 15:34:10 2015 -0400 @@ -1112,8 +1112,10 @@ long minroot; PyObject *includepatharg = NULL; int includepath = 0; + /* heads is a list */ PyObject *heads = NULL; Py_ssize_t numheads; + /* roots is a set */ PyObject *roots = NULL; PyObject *reachable = NULL; @@ -1134,8 +1136,8 @@ char *seen = NULL; /* Get arguments */ - if (!PyArg_ParseTuple(args, "lO!O!O!", &minroot, &PySet_Type, &heads, - &PyList_Type, &roots, &PyBool_Type, &includepatharg)) + if (!PyArg_ParseTuple(args, "lO!O!O!", &minroot, &PyList_Type, &heads, + &PySet_Type, &roots, &PyBool_Type, &includepatharg)) goto bail; if (includepatharg == Py_True)