Show More
@@ -191,6 +191,11 b' def rangeset(repo, subset, x, y):' | |||
|
191 | 191 | s = set(subset) |
|
192 | 192 | return [x for x in r if x in s] |
|
193 | 193 | |
|
194 | def dagrange(repo, subset, x, y): | |
|
195 | return andset(repo, subset, | |
|
196 | ('func', ('symbol', 'descendants'), x), | |
|
197 | ('func', ('symbol', 'ancestors'), y)) | |
|
198 | ||
|
194 | 199 | def andset(repo, subset, x, y): |
|
195 | 200 | return getset(repo, getset(repo, subset, x), y) |
|
196 | 201 | |
@@ -1309,6 +1314,7 b' symbols = {' | |||
|
1309 | 1314 | |
|
1310 | 1315 | methods = { |
|
1311 | 1316 | "range": rangeset, |
|
1317 | "dagrange": dagrange, | |
|
1312 | 1318 | "string": stringset, |
|
1313 | 1319 | "symbol": symbolset, |
|
1314 | 1320 | "and": andset, |
@@ -1332,9 +1338,6 b' def optimize(x, small):' | |||
|
1332 | 1338 | op = x[0] |
|
1333 | 1339 | if op == 'minus': |
|
1334 | 1340 | return optimize(('and', x[1], ('not', x[2])), small) |
|
1335 | elif op == 'dagrange': | |
|
1336 | return optimize(('and', ('func', ('symbol', 'descendants'), x[1]), | |
|
1337 | ('func', ('symbol', 'ancestors'), x[2])), small) | |
|
1338 | 1341 | elif op == 'dagrangepre': |
|
1339 | 1342 | return optimize(('func', ('symbol', 'ancestors'), x[1]), small) |
|
1340 | 1343 | elif op == 'dagrangepost': |
@@ -1369,7 +1372,7 b' def optimize(x, small):' | |||
|
1369 | 1372 | return o[0], (op, o[1]) |
|
1370 | 1373 | elif op == 'group': |
|
1371 | 1374 | return optimize(x[1], small) |
|
1372 | elif op in 'range list parent ancestorspec': | |
|
1375 | elif op in 'dagrange range list parent ancestorspec': | |
|
1373 | 1376 | if op == 'parent': |
|
1374 | 1377 | # x^:y means (x^) : y, not x ^ (:y) |
|
1375 | 1378 | post = ('parentpost', x[1]) |
General Comments 0
You need to be logged in to leave comments.
Login now