##// END OF EJS Templates
reachableroots: return list of revisions instead of set...
Yuya Nishihara -
r26055:607868ec default
parent child Browse files
Show More
@@ -1148,11 +1148,9 b' static PyObject *reachableroots2(indexOb'
1148 includepath = 1;
1148 includepath = 1;
1149
1149
1150 /* Initialize return set */
1150 /* Initialize return set */
1151 reachable = PySet_New(NULL);
1151 reachable = PyList_New(0);
1152 if (reachable == NULL) {
1152 if (reachable == NULL)
1153 PyErr_NoMemory();
1154 goto bail;
1153 goto bail;
1155 }
1156
1154
1157 /* Initialize internal datastructures */
1155 /* Initialize internal datastructures */
1158 tovisit = (int *)malloc((len + 1) * sizeof(int));
1156 tovisit = (int *)malloc((len + 1) * sizeof(int));
@@ -1205,7 +1203,7 b' static PyObject *reachableroots2(indexOb'
1205 val = PyInt_FromLong(revnum);
1203 val = PyInt_FromLong(revnum);
1206 if (val == NULL)
1204 if (val == NULL)
1207 goto bail;
1205 goto bail;
1208 PySet_Add(reachable, val);
1206 PyList_Append(reachable, val);
1209 Py_DECREF(val);
1207 Py_DECREF(val);
1210 if (includepath == 0)
1208 if (includepath == 0)
1211 continue;
1209 continue;
@@ -1241,12 +1239,13 b' static PyObject *reachableroots2(indexOb'
1241 if (r < 0)
1239 if (r < 0)
1242 goto bail;
1240 goto bail;
1243 for (k = 0; k < 2; k++) {
1241 for (k = 0; k < 2; k++) {
1244 if (revstates[parents[k] + 1] & RS_REACHABLE) {
1242 if ((revstates[parents[k] + 1] & RS_REACHABLE)
1243 && !(revstates[i + 1] & RS_REACHABLE)) {
1245 revstates[i + 1] |= RS_REACHABLE;
1244 revstates[i + 1] |= RS_REACHABLE;
1246 val = PyInt_FromLong(i);
1245 val = PyInt_FromLong(i);
1247 if (val == NULL)
1246 if (val == NULL)
1248 goto bail;
1247 goto bail;
1249 PySet_Add(reachable, val);
1248 PyList_Append(reachable, val);
1250 Py_DECREF(val);
1249 Py_DECREF(val);
1251 }
1250 }
1252 }
1251 }
General Comments 0
You need to be logged in to leave comments. Login now