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