##// END OF EJS Templates
revset: fix keyword arguments to go through optimization process...
Yuya Nishihara -
r29766:5004ef47 stable
parent child Browse files
Show More
@@ -2423,6 +2423,9 b' def _optimize(x, small):'
2423 elif op == 'list':
2423 elif op == 'list':
2424 ws, ts = zip(*(_optimize(y, small) for y in x[1:]))
2424 ws, ts = zip(*(_optimize(y, small) for y in x[1:]))
2425 return sum(ws), (op,) + ts
2425 return sum(ws), (op,) + ts
2426 elif op == 'keyvalue':
2427 w, t = _optimize(x[2], small)
2428 return w, (op, x[1], t)
2426 elif op == 'func':
2429 elif op == 'func':
2427 f = getsymbol(x[1])
2430 f = getsymbol(x[1])
2428 wa, ta = _optimize(x[2], small)
2431 wa, ta = _optimize(x[2], small)
@@ -470,6 +470,25 b' keyword arguments'
470 hg: parse error: can't use a key-value pair in this context
470 hg: parse error: can't use a key-value pair in this context
471 [255]
471 [255]
472
472
473 right-hand side should be optimized recursively
474
475 $ try --optimize 'foo=(not public())'
476 (keyvalue
477 ('symbol', 'foo')
478 (group
479 (not
480 (func
481 ('symbol', 'public')
482 None))))
483 * optimized:
484 (keyvalue
485 ('symbol', 'foo')
486 (func
487 ('symbol', '_notpublic')
488 None))
489 hg: parse error: can't use a key-value pair in this context
490 [255]
491
473 Test that symbols only get parsed as functions if there's an opening
492 Test that symbols only get parsed as functions if there's an opening
474 parenthesis.
493 parenthesis.
475
494
@@ -1649,6 +1668,11 b' use the topo.firstbranch option when top'
1649 hg: parse error: topo.firstbranch can only be used when using the topo sort key
1668 hg: parse error: topo.firstbranch can only be used when using the topo sort key
1650 [255]
1669 [255]
1651
1670
1671 topo.firstbranch should accept any kind of expressions:
1672
1673 $ hg log -r 'sort(0, topo, topo.firstbranch=(book1))'
1674 0 b12 m111 u112 111 10800
1675
1652 $ cd ..
1676 $ cd ..
1653 $ cd repo
1677 $ cd repo
1654
1678
General Comments 0
You need to be logged in to leave comments. Login now