tests/test-revset.t
changeset 32819 4710cc4dac99
parent 32817 e962c70c0aad
child 32820 653d60455dbe
equal deleted inserted replaced
32818:9ddb18ae342e 32819:4710cc4dac99
  1014   9
  1014   9
  1015   $ log 'last(all(), 2)'
  1015   $ log 'last(all(), 2)'
  1016   8
  1016   8
  1017   9
  1017   9
  1018 
  1018 
       
  1019 Test smartset.slice() by first/last()
       
  1020 
       
  1021  (using unoptimized set, filteredset as example)
       
  1022 
       
  1023   $ hg debugrevspec --no-show-revs -s '0:7 & branch("re:")'
       
  1024   * set:
       
  1025   <filteredset
       
  1026     <spanset+ 0:8>,
       
  1027     <branch 're:'>>
       
  1028   $ log 'limit(0:7 & branch("re:"), 3, 4)'
       
  1029   4
       
  1030   5
       
  1031   6
       
  1032   $ log 'limit(7:0 & branch("re:"), 3, 4)'
       
  1033   3
       
  1034   2
       
  1035   1
       
  1036   $ log 'last(0:7 & branch("re:"), 2)'
       
  1037   6
       
  1038   7
       
  1039 
  1019 Test order of first/last revisions
  1040 Test order of first/last revisions
  1020 
  1041 
  1021   $ hg debugrevspec -s 'first(4:0, 3) & 3:'
  1042   $ hg debugrevspec -s 'first(4:0, 3) & 3:'
  1022   * set:
  1043   * set:
  1023   <filteredset
  1044   <filteredset
  1024     <baseset
  1045     <baseset slice=0:3
  1025       <limit n=3, offset=0,
  1046       <spanset- 0:5>>,
  1026         <spanset- 0:5>>>,
       
  1027     <spanset+ 3:10>>
  1047     <spanset+ 3:10>>
  1028   4
  1048   4
  1029   3
  1049   3
  1030 
  1050 
  1031   $ hg debugrevspec -s '3: & first(4:0, 3)'
  1051   $ hg debugrevspec -s '3: & first(4:0, 3)'
  1032   * set:
  1052   * set:
  1033   <filteredset
  1053   <filteredset
  1034     <spanset+ 3:10>,
  1054     <spanset+ 3:10>,
  1035     <baseset
  1055     <baseset slice=0:3
  1036       <limit n=3, offset=0,
  1056       <spanset- 0:5>>>
  1037         <spanset- 0:5>>>>
       
  1038   3
  1057   3
  1039   4
  1058   4
  1040 
  1059 
  1041   $ hg debugrevspec -s 'last(4:0, 3) & :1'
  1060   $ hg debugrevspec -s 'last(4:0, 3) & :1'
  1042   * set:
  1061   * set:
  1043   <filteredset
  1062   <filteredset
  1044     <baseset
  1063     <baseset slice=0:3
  1045       <last n=3,
  1064       <spanset+ 0:5>>,
  1046         <spanset+ 0:5>>>,
       
  1047     <spanset+ 0:2>>
  1065     <spanset+ 0:2>>
  1048   1
  1066   1
  1049   0
  1067   0
  1050 
  1068 
  1051   $ hg debugrevspec -s ':1 & last(4:0, 3)'
  1069   $ hg debugrevspec -s ':1 & last(4:0, 3)'
  1052   * set:
  1070   * set:
  1053   <filteredset
  1071   <filteredset
  1054     <spanset+ 0:2>,
  1072     <spanset+ 0:2>,
  1055     <baseset
  1073     <baseset slice=0:3
  1056       <last n=3,
  1074       <spanset+ 0:5>>>
  1057         <spanset+ 0:5>>>>
       
  1058   0
  1075   0
  1059   1
  1076   1
  1060 
  1077 
  1061 Test matching
  1078 Test matching
  1062 
  1079 
  1948         define)
  1965         define)
  1949       follow)
  1966       follow)
  1950     define)
  1967     define)
  1951   * set:
  1968   * set:
  1952   <filteredset
  1969   <filteredset
  1953     <baseset
  1970     <baseset slice=0:1
  1954       <limit n=1, offset=0,
  1971       <baseset [1, 0, 2]>>,
  1955         <baseset [1, 0, 2]>>>,
       
  1956     <spanset- 0:3>>
  1972     <spanset- 0:3>>
  1957   1
  1973   1
  1958 
  1974 
  1959   $ try --optimize '2:0 & not last(0 + 2 + 1)'
  1975   $ try --optimize '2:0 & not last(0 + 2 + 1)'
  1960   (and
  1976   (and
  1985     define)
  2001     define)
  1986   * set:
  2002   * set:
  1987   <filteredset
  2003   <filteredset
  1988     <spanset- 0:3>,
  2004     <spanset- 0:3>,
  1989     <not
  2005     <not
  1990       <baseset
  2006       <baseset slice=0:1
  1991         <last n=1,
  2007         <baseset [1, 2, 0]>>>>
  1992           <baseset [1, 2, 0]>>>>>
       
  1993   2
  2008   2
  1994   0
  2009   0
  1995 
  2010 
  1996  for 'A & (op)(B)', 'B' should not be affected by the order of 'A':
  2011  for 'A & (op)(B)', 'B' should not be affected by the order of 'A':
  1997 
  2012 
  3611         ('symbol', '2')))
  3626         ('symbol', '2')))
  3612     (not
  3627     (not
  3613       ('symbol', '2')))
  3628       ('symbol', '2')))
  3614   * set:
  3629   * set:
  3615   <filteredset
  3630   <filteredset
  3616     <baseset
  3631     <baseset slice=0:2
  3617       <limit n=2, offset=0,
  3632       <baseset [1, 2, 3]>>,
  3618         <baseset [1, 2, 3]>>>,
       
  3619     <not
  3633     <not
  3620       <baseset [2]>>>
  3634       <baseset [2]>>>
  3621   1
  3635   1
  3622   $ try 'max(1 or 2) and not 2'
  3636   $ try 'max(1 or 2) and not 2'
  3623   (and
  3637   (and
  3667         ('symbol', '1')))
  3681         ('symbol', '1')))
  3668     (not
  3682     (not
  3669       ('symbol', '2')))
  3683       ('symbol', '2')))
  3670   * set:
  3684   * set:
  3671   <filteredset
  3685   <filteredset
  3672     <baseset
  3686     <baseset slice=0:1
  3673       <last n=1,
  3687       <baseset [2, 1]>>,
  3674         <baseset [2, 1]>>>,
       
  3675     <not
  3688     <not
  3676       <baseset [2]>>>
  3689       <baseset [2]>>>
  3677 
  3690 
  3678 issue4289 - ordering of built-ins
  3691 issue4289 - ordering of built-ins
  3679   $ hg log -M -q -r 3:2
  3692   $ hg log -M -q -r 3:2