tests/test-annotate.t
changeset 31938 5e3b49defbff
parent 30804 4227f80f72b2
child 31955 4c2c30bc38b4
equal deleted inserted replaced
31937:826e600605f6 31938:5e3b49defbff
   482 
   482 
   483   $ hg revert --all --no-backup --quiet
   483   $ hg revert --all --no-backup --quiet
   484   $ hg id -n
   484   $ hg id -n
   485   20
   485   20
   486 
   486 
   487 Test followlines() revset
   487 Test followlines() revset; we usually check both followlines(pat, range) and
       
   488 followlines(pat, range, descend=True) to make sure both give the same result
       
   489 when they should.
   488 
   490 
   489   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5)'
   491   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5)'
   490   16: baz:0
   492   16: baz:0
   491   19: baz:3
   493   19: baz:3
   492   20: baz:4
   494   20: baz:4
   493   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=20)'
   495   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=20)'
   494   16: baz:0
   496   16: baz:0
   495   19: baz:3
   497   19: baz:3
   496   20: baz:4
   498   20: baz:4
   497   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=.^)'
   499   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19)'
   498   16: baz:0
   500   16: baz:0
   499   19: baz:3
   501   19: baz:3
       
   502   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)'
       
   503   20: baz:4
   500   $ printf "0\n0\n" | cat - baz > baz1
   504   $ printf "0\n0\n" | cat - baz > baz1
   501   $ mv baz1 baz
   505   $ mv baz1 baz
   502   $ hg ci -m 'added two lines with 0'
   506   $ hg ci -m 'added two lines with 0'
   503   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)'
   507   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)'
   504   16: baz:0
   508   16: baz:0
   505   19: baz:3
   509   19: baz:3
   506   20: baz:4
   510   20: baz:4
       
   511   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, descend=True, startrev=19)'
       
   512   20: baz:4
   507   $ echo 6 >> baz
   513   $ echo 6 >> baz
   508   $ hg ci -m 'added line 8'
   514   $ hg ci -m 'added line 8'
   509   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)'
   515   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)'
   510   16: baz:0
   516   16: baz:0
   511   19: baz:3
   517   19: baz:3
       
   518   20: baz:4
       
   519   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)'
   512   20: baz:4
   520   20: baz:4
   513   $ sed 's/3/3+/' baz > baz.new
   521   $ sed 's/3/3+/' baz > baz.new
   514   $ mv baz.new baz
   522   $ mv baz.new baz
   515   $ hg ci -m 'baz:3->3+'
   523   $ hg ci -m 'baz:3->3+'
   516   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)'
   524   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)'
   517   16: baz:0
   525   16: baz:0
   518   19: baz:3
   526   19: baz:3
       
   527   20: baz:4
       
   528   23: baz:3->3+
       
   529   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)'
   519   20: baz:4
   530   20: baz:4
   520   23: baz:3->3+
   531   23: baz:3->3+
   521   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2)'
   532   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2)'
   522   21: added two lines with 0
   533   21: added two lines with 0
   523 
   534 
   534   16: baz:0
   545   16: baz:0
   535   19: baz:3
   546   19: baz:3
   536   20: baz:4
   547   20: baz:4
   537   23: baz:3->3+
   548   23: baz:3->3+
   538   24: qux:4->4+
   549   24: qux:4->4+
       
   550 
       
   551 but are missed when following children
       
   552   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=22, descend=True)'
       
   553   23: baz:3->3+
       
   554 
       
   555 merge
   539   $ hg up 23 --quiet
   556   $ hg up 23 --quiet
   540 
       
   541 merge
       
   542   $ echo 7 >> baz
   557   $ echo 7 >> baz
   543   $ hg ci -m 'one more line, out of line range'
   558   $ hg ci -m 'one more line, out of line range'
   544   created new head
   559   created new head
   545   $ sed 's/3+/3-/' baz > baz.new
   560   $ sed 's/3+/3-/' baz > baz.new
   546   $ mv baz.new baz
   561   $ mv baz.new baz
   578   23: baz:3->3+
   593   23: baz:3->3+
   579   24: qux:4->4+
   594   24: qux:4->4+
   580   26: baz:3+->3-
   595   26: baz:3+->3-
   581   28: merge from other side
   596   28: merge from other side
   582   $ hg up 23 --quiet
   597   $ hg up 23 --quiet
       
   598 
       
   599 we are missing the branch with rename when following children
       
   600   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=25, descend=True)'
       
   601   26: baz:3+->3-
   583 
   602 
   584 check error cases
   603 check error cases
   585   $ hg log -r 'followlines()'
   604   $ hg log -r 'followlines()'
   586   hg: parse error: followlines takes at least 1 positional arguments
   605   hg: parse error: followlines takes at least 1 positional arguments
   587   [255]
   606   [255]