##// END OF EJS Templates
mq: use sets instead of lists for speed...
Nicolas Dumazet -
r12948:de6a28ff default
parent child Browse files
Show More
@@ -1289,6 +1289,9 b' class queue(object):'
1289 1289 else:
1290 1290 match = cmdutil.matchall(repo)
1291 1291 m, a, r, d = repo.status(match=match)[:4]
1292 mm = set(mm)
1293 aa = set(aa)
1294 dd = set(dd)
1292 1295
1293 1296 # we might end up with files that were added between
1294 1297 # qtip and the dirstate parent, but then changed in the
@@ -1296,31 +1299,31 b' class queue(object):'
1296 1299 # show up in the added section
1297 1300 for x in m:
1298 1301 if x not in aa:
1299 mm.append(x)
1302 mm.add(x)
1300 1303 # we might end up with files added by the local dirstate that
1301 1304 # were deleted by the patch. In this case, they should only
1302 1305 # show up in the changed section.
1303 1306 for x in a:
1304 1307 if x in dd:
1305 del dd[dd.index(x)]
1306 mm.append(x)
1308 dd.remove(x)
1309 mm.add(x)
1307 1310 else:
1308 aa.append(x)
1311 aa.add(x)
1309 1312 # make sure any files deleted in the local dirstate
1310 1313 # are not in the add or change column of the patch
1311 1314 forget = []
1312 1315 for x in d + r:
1313 1316 if x in aa:
1314 del aa[aa.index(x)]
1317 aa.remove(x)
1315 1318 forget.append(x)
1316 1319 continue
1317 elif x in mm:
1318 del mm[mm.index(x)]
1319 dd.append(x)
1320
1321 m = list(set(mm))
1322 r = list(set(dd))
1323 a = list(set(aa))
1320 else:
1321 mm.discard(x)
1322 dd.add(x)
1323
1324 m = list(mm)
1325 r = list(dd)
1326 a = list(aa)
1324 1327 c = [filter(matchfn, l) for l in (m, a, r)]
1325 1328 match = cmdutil.matchfiles(repo, set(c[0] + c[1] + c[2]))
1326 1329 chunks = patch.diff(repo, patchparent, match=match,
General Comments 0
You need to be logged in to leave comments. Login now