mercurial/parsers.c
changeset 26032 a3d5da8b641e
parent 26018 c6115c30a376
child 26033 9e7d805925c8
equal deleted inserted replaced
26031:0b57b77f9b3e 26032:a3d5da8b641e
  1183 	k = 0;
  1183 	k = 0;
  1184 	while (k < lentovisit) {
  1184 	while (k < lentovisit) {
  1185 		/* Add the node to reachable if it is a root*/
  1185 		/* Add the node to reachable if it is a root*/
  1186 		revnum = tovisit[k++];
  1186 		revnum = tovisit[k++];
  1187 		val = PyInt_FromLong(revnum);
  1187 		val = PyInt_FromLong(revnum);
       
  1188 		if (val == NULL)
       
  1189 			goto bail;
  1188 		if (PySet_Contains(roots, val) == 1) {
  1190 		if (PySet_Contains(roots, val) == 1) {
  1189 			PySet_Add(reachable, val);
  1191 			PySet_Add(reachable, val);
  1190 			if (includepath == 0) {
  1192 			if (includepath == 0) {
  1191 				Py_XDECREF(val);
  1193 				Py_DECREF(val);
  1192 				continue;
  1194 				continue;
  1193 			}
  1195 			}
  1194 		}
  1196 		}
  1195 		Py_XDECREF(val);
  1197 		Py_DECREF(val);
  1196 
  1198 
  1197 		/* Add its parents to the list of nodes to visit */
  1199 		/* Add its parents to the list of nodes to visit */
  1198 		if (revnum != -1) {
  1200 		if (revnum != -1) {
  1199 			r = index_get_parents(self, revnum, parents, (int)len - 1);
  1201 			r = index_get_parents(self, revnum, parents, (int)len - 1);
  1200 			if (r < 0)
  1202 			if (r < 0)
  1221 				/* Corrupted index file, error is set from index_get_parents */
  1223 				/* Corrupted index file, error is set from index_get_parents */
  1222 				if (r < 0)
  1224 				if (r < 0)
  1223 					goto bail;
  1225 					goto bail;
  1224 				for (k = 0; k < 2; k++) {
  1226 				for (k = 0; k < 2; k++) {
  1225 					PyObject *p = PyInt_FromLong(parents[k]);
  1227 					PyObject *p = PyInt_FromLong(parents[k]);
  1226 					if (PySet_Contains(reachable, p) == 1)
  1228 					if (p == NULL)
  1227 						PySet_Add(reachable, PyInt_FromLong(i));
  1229 						goto bail;
  1228 					Py_XDECREF(p);
  1230 					if (PySet_Contains(reachable, p) == 1) {
       
  1231 						val = PyInt_FromLong(i);
       
  1232 						if (val == NULL)
       
  1233 							goto bail;
       
  1234 						PySet_Add(reachable, val);
       
  1235 					}
       
  1236 					Py_DECREF(p);
  1229 				}
  1237 				}
  1230 			}
  1238 			}
  1231 		}
  1239 		}
  1232 	}
  1240 	}
  1233 
  1241