Show More
@@ -1867,7 +1867,7 b' def optimize(x, small):' | |||
|
1867 | 1867 | wb, tb = optimize(x[2], True) |
|
1868 | 1868 | |
|
1869 | 1869 | # (::x and not ::y)/(not ::y and ::x) have a fast path |
|
1870 |
def is |
|
|
1870 | def isonly(revs, bases): | |
|
1871 | 1871 | return ( |
|
1872 | 1872 | revs[0] == 'func' |
|
1873 | 1873 | and getstring(revs[1], _('not a symbol')) == 'ancestors' |
@@ -1876,12 +1876,10 b' def optimize(x, small):' | |||
|
1876 | 1876 | and getstring(bases[1][1], _('not a symbol')) == 'ancestors') |
|
1877 | 1877 | |
|
1878 | 1878 | w = min(wa, wb) |
|
1879 |
if is |
|
|
1880 |
return w, ('func', ('symbol', ' |
|
|
1881 | ('list', ta[2], tb[1][2])) | |
|
1882 | if ismissingancestors(tb, ta): | |
|
1883 | return w, ('func', ('symbol', '_missingancestors'), | |
|
1884 | ('list', tb[2], ta[1][2])) | |
|
1879 | if isonly(ta, tb): | |
|
1880 | return w, ('func', ('symbol', 'only'), ('list', ta[2], tb[1][2])) | |
|
1881 | if isonly(tb, ta): | |
|
1882 | return w, ('func', ('symbol', 'only'), ('list', tb[2], ta[1][2])) | |
|
1885 | 1883 | |
|
1886 | 1884 | if wa > wb: |
|
1887 | 1885 | return w, (op, tb, ta) |
@@ -562,7 +562,7 b' test intersecting something with an adds' | |||
|
562 | 562 | 5 |
|
563 | 563 | 8 |
|
564 | 564 | |
|
565 |
check that conversion to |
|
|
565 | check that conversion to only works | |
|
566 | 566 | $ try --optimize '::3 - ::1' |
|
567 | 567 | (minus |
|
568 | 568 | (dagrangepre |
@@ -571,7 +571,7 b' check that conversion to _missingancesto' | |||
|
571 | 571 | ('symbol', '1'))) |
|
572 | 572 | * optimized: |
|
573 | 573 | (func |
|
574 |
('symbol', ' |
|
|
574 | ('symbol', 'only') | |
|
575 | 575 | (list |
|
576 | 576 | ('symbol', '3') |
|
577 | 577 | ('symbol', '1'))) |
@@ -586,7 +586,7 b' check that conversion to _missingancesto' | |||
|
586 | 586 | ('symbol', '3'))) |
|
587 | 587 | * optimized: |
|
588 | 588 | (func |
|
589 |
('symbol', ' |
|
|
589 | ('symbol', 'only') | |
|
590 | 590 | (list |
|
591 | 591 | ('symbol', '1') |
|
592 | 592 | ('symbol', '3'))) |
@@ -599,7 +599,7 b' check that conversion to _missingancesto' | |||
|
599 | 599 | ('symbol', '6'))) |
|
600 | 600 | * optimized: |
|
601 | 601 | (func |
|
602 |
('symbol', ' |
|
|
602 | ('symbol', 'only') | |
|
603 | 603 | (list |
|
604 | 604 | ('symbol', '6') |
|
605 | 605 | ('symbol', '2'))) |
@@ -618,7 +618,7 b' check that conversion to _missingancesto' | |||
|
618 | 618 | ('symbol', '4')))) |
|
619 | 619 | * optimized: |
|
620 | 620 | (func |
|
621 |
('symbol', ' |
|
|
621 | ('symbol', 'only') | |
|
622 | 622 | (list |
|
623 | 623 | ('symbol', '6') |
|
624 | 624 | ('symbol', '4'))) |
General Comments 0
You need to be logged in to leave comments.
Login now