tests/test-pager.t
changeset 32541 3b569745af6c
parent 32337 46ba2cdda476
child 32940 75be14993fda
equal deleted inserted replaced
32540:f4cd4c49e302 32541:3b569745af6c
     1   $ cat >> fakepager.py <<EOF
     1   $ cat >> fakepager.py <<EOF
     2   > import sys
     2   > import sys
       
     3   > printed = False
     3   > for line in sys.stdin:
     4   > for line in sys.stdin:
     4   >     sys.stdout.write('paged! %r\n' % line)
     5   >     sys.stdout.write('paged! %r\n' % line)
       
     6   >     printed = True
       
     7   > if not printed:
       
     8   >     sys.stdout.write('paged empty output!\n')
     5   > EOF
     9   > EOF
     6 
    10 
     7 Enable ui.formatted because pager won't fire without it, and set up
    11 Enable ui.formatted because pager won't fire without it, and set up
     8 pager and tell it to use our fake pager that lets us see when the
    12 pager and tell it to use our fake pager that lets us see when the
     9 pager was running.
    13 pager was running.
   279    7: a 7
   283    7: a 7
   280    8: a 8
   284    8: a 8
   281    9: a 9
   285    9: a 9
   282   10: a 10
   286   10: a 10
   283 
   287 
       
   288 A command with --output option:
       
   289 
       
   290   $ hg cat -r0 a
       
   291   paged! 'a\n'
       
   292   $ hg cat -r0 a --output=-
       
   293   paged! 'a\n'
       
   294   $ hg cat -r0 a --output=out
       
   295   $ rm out
       
   296 
   284 Put annotate in the ignore list for pager:
   297 Put annotate in the ignore list for pager:
   285   $ cat >> $HGRCPATH <<EOF
   298   $ cat >> $HGRCPATH <<EOF
   286   > [pager]
   299   > [pager]
   287   > ignore = annotate
   300   > ignore = annotate
   288   > EOF
   301   > EOF