diff -r e7fe0a12376c -r 8779ce81ea80 mercurial/parsers.c --- a/mercurial/parsers.c Sat Aug 15 19:38:03 2015 +0900 +++ b/mercurial/parsers.c Sun Aug 16 09:30:37 2015 +0900 @@ -1240,18 +1240,17 @@ * index_get_parents */ if (r < 0) goto bail; - for (k = 0; k < 2; k++) { - if ((revstates[parents[k] + 1] & RS_REACHABLE) - && !(revstates[i + 1] & RS_REACHABLE)) { - revstates[i + 1] |= RS_REACHABLE; - val = PyInt_FromLong(i); - if (val == NULL) - goto bail; - r = PyList_Append(reachable, val); - Py_DECREF(val); - if (r < 0) - goto bail; - } + if (((revstates[parents[0] + 1] | + revstates[parents[1] + 1]) & RS_REACHABLE) + && !(revstates[i + 1] & RS_REACHABLE)) { + revstates[i + 1] |= RS_REACHABLE; + val = PyInt_FromLong(i); + if (val == NULL) + goto bail; + r = PyList_Append(reachable, val); + Py_DECREF(val); + if (r < 0) + goto bail; } } }