tests/test-revset.t
changeset 29779 8e4841944e68
parent 29441 9e8d258708bb
child 29780 abe4eecc3253
equal deleted inserted replaced
29778:e5b794063fd4 29779:8e4841944e68
   476   $ hg book only -r 9
   476   $ hg book only -r 9
   477   $ log 'only(only)'   # Outer "only" is a function, inner "only" is the bookmark
   477   $ log 'only(only)'   # Outer "only" is a function, inner "only" is the bookmark
   478   8
   478   8
   479   9
   479   9
   480 
   480 
       
   481 infix/suffix resolution of ^ operator (issue2884):
       
   482 
       
   483  x^:y means (x^):y
       
   484 
       
   485   $ try --optimize '1^:2'
       
   486   (parent
       
   487     ('symbol', '1')
       
   488     (rangepre
       
   489       ('symbol', '2')))
       
   490   * optimized:
       
   491   (range
       
   492     (parentpost
       
   493       ('symbol', '1'))
       
   494     ('symbol', '2'))
       
   495   * set:
       
   496   <spanset+ 0:2>
       
   497   0
       
   498   1
       
   499   2
       
   500 
       
   501   $ try --optimize '1^::2'
       
   502   (parent
       
   503     ('symbol', '1')
       
   504     (dagrangepre
       
   505       ('symbol', '2')))
       
   506   * optimized:
       
   507   (dagrange
       
   508     (parentpost
       
   509       ('symbol', '1'))
       
   510     ('symbol', '2'))
       
   511   * set:
       
   512   <baseset+ [0, 1, 2]>
       
   513   0
       
   514   1
       
   515   2
       
   516 
       
   517  x^:y should be resolved before omitting group operators
       
   518 
       
   519   $ try --optimize '1^(:2)'
       
   520   (parent
       
   521     ('symbol', '1')
       
   522     (group
       
   523       (rangepre
       
   524         ('symbol', '2'))))
       
   525   * optimized:
       
   526   (parent
       
   527     ('symbol', '1')
       
   528     (range
       
   529       ('string', '0')
       
   530       ('symbol', '2')))
       
   531   hg: parse error: ^ expects a number 0, 1, or 2
       
   532   [255]
       
   533 
       
   534  x^:y should be resolved recursively
       
   535 
       
   536   $ try --optimize 'sort(1^:2)'
       
   537   (func
       
   538     ('symbol', 'sort')
       
   539     (parent
       
   540       ('symbol', '1')
       
   541       (rangepre
       
   542         ('symbol', '2'))))
       
   543   * optimized:
       
   544   (func
       
   545     ('symbol', 'sort')
       
   546     (range
       
   547       (parentpost
       
   548         ('symbol', '1'))
       
   549       ('symbol', '2')))
       
   550   * set:
       
   551   <spanset+ 0:2>
       
   552   0
       
   553   1
       
   554   2
       
   555 
       
   556   $ try --optimize '(3^:4)^:2'
       
   557   (parent
       
   558     (group
       
   559       (parent
       
   560         ('symbol', '3')
       
   561         (rangepre
       
   562           ('symbol', '4'))))
       
   563     (rangepre
       
   564       ('symbol', '2')))
       
   565   * optimized:
       
   566   (range
       
   567     (parentpost
       
   568       (range
       
   569         (parentpost
       
   570           ('symbol', '3'))
       
   571         ('symbol', '4')))
       
   572     ('symbol', '2'))
       
   573   * set:
       
   574   <spanset+ 0:2>
       
   575   0
       
   576   1
       
   577   2
       
   578 
       
   579   $ try --optimize '(3^::4)^::2'
       
   580   (parent
       
   581     (group
       
   582       (parent
       
   583         ('symbol', '3')
       
   584         (dagrangepre
       
   585           ('symbol', '4'))))
       
   586     (dagrangepre
       
   587       ('symbol', '2')))
       
   588   * optimized:
       
   589   (dagrange
       
   590     (parentpost
       
   591       (dagrange
       
   592         (parentpost
       
   593           ('symbol', '3'))
       
   594         ('symbol', '4')))
       
   595     ('symbol', '2'))
       
   596   * set:
       
   597   <baseset+ [0, 1, 2]>
       
   598   0
       
   599   1
       
   600   2
       
   601 
       
   602  x^ in alias should also be resolved
       
   603 
       
   604   $ try --optimize 'A' --config 'revsetalias.A=1^:2'
       
   605   ('symbol', 'A')
       
   606   * expanded:
       
   607   (parent
       
   608     ('symbol', '1')
       
   609     (rangepre
       
   610       ('symbol', '2')))
       
   611   * optimized:
       
   612   (range
       
   613     (parentpost
       
   614       ('symbol', '1'))
       
   615     ('symbol', '2'))
       
   616   * set:
       
   617   <spanset+ 0:2>
       
   618   0
       
   619   1
       
   620   2
       
   621 
       
   622   $ try --optimize 'A:2' --config 'revsetalias.A=1^'
       
   623   (range
       
   624     ('symbol', 'A')
       
   625     ('symbol', '2'))
       
   626   * expanded:
       
   627   (range
       
   628     (parentpost
       
   629       ('symbol', '1'))
       
   630     ('symbol', '2'))
       
   631   * optimized:
       
   632   (range
       
   633     (parentpost
       
   634       ('symbol', '1'))
       
   635     ('symbol', '2'))
       
   636   * set:
       
   637   <spanset+ 0:2>
       
   638   0
       
   639   1
       
   640   2
       
   641 
       
   642  but not beyond the boundary of alias expansion, because the resolution should
       
   643  be made at the parsing stage
       
   644 
       
   645   $ try --optimize '1^A' --config 'revsetalias.A=:2'
       
   646   (parent
       
   647     ('symbol', '1')
       
   648     ('symbol', 'A'))
       
   649   * expanded:
       
   650   (parent
       
   651     ('symbol', '1')
       
   652     (rangepre
       
   653       ('symbol', '2')))
       
   654   * optimized:
       
   655   (range
       
   656     (parentpost
       
   657       ('symbol', '1'))
       
   658     ('symbol', '2'))
       
   659   * set:
       
   660   <spanset+ 0:2>
       
   661   0
       
   662   1
       
   663   2
       
   664 BROKEN: should be parsed as '1^(:2)'
       
   665 
   481 ancestor can accept 0 or more arguments
   666 ancestor can accept 0 or more arguments
   482 
   667 
   483   $ log 'ancestor()'
   668   $ log 'ancestor()'
   484   $ log 'ancestor(1)'
   669   $ log 'ancestor(1)'
   485   1
   670   1