tests/test-chg.t
branchstable
changeset 45185 a17454a189d1
parent 45010 62bdb288c449
child 45188 837840018306
equal deleted inserted replaced
45184:3781e9f74b27 45185:a17454a189d1
   148   > crash = $TESTTMP/crash.py
   148   > crash = $TESTTMP/crash.py
   149   > EOF
   149   > EOF
   150 
   150 
   151   $ chg crash --pager=on --config ui.formatted=True 2>/dev/null
   151   $ chg crash --pager=on --config ui.formatted=True 2>/dev/null
   152   crash-pager: going to crash
   152   crash-pager: going to crash
       
   153   [255]
       
   154 
       
   155 no stdout data should be printed after pager quits, and the buffered data
       
   156 should never persist (issue6207)
       
   157 
       
   158 "killed!" may be printed if terminated by SIGPIPE, which isn't important
       
   159 in this test.
       
   160 
       
   161   $ cat > $TESTTMP/bulkwrite.py <<'EOF'
       
   162   > import time
       
   163   > from mercurial import error, registrar
       
   164   > cmdtable = {}
       
   165   > command = registrar.command(cmdtable)
       
   166   > @command(b'bulkwrite')
       
   167   > def bulkwrite(ui, repo, *pats, **opts):
       
   168   >     ui.write(b'going to write massive data\n')
       
   169   >     ui.flush()
       
   170   >     t = time.time()
       
   171   >     while time.time() - t < 2:
       
   172   >         ui.write(b'x' * 1023 + b'\n')  # will be interrupted by SIGPIPE
       
   173   >     raise error.Abort(b"write() doesn't block")
       
   174   > EOF
       
   175 
       
   176   $ cat > $TESTTMP/fakepager.py <<'EOF'
       
   177   > import sys
       
   178   > import time
       
   179   > sys.stdout.write('paged! %r\n' % sys.stdin.readline())
       
   180   > time.sleep(1)  # new data will be written
       
   181   > EOF
       
   182 
       
   183   $ cat >> .hg/hgrc <<EOF
       
   184   > [extensions]
       
   185   > bulkwrite = $TESTTMP/bulkwrite.py
       
   186   > EOF
       
   187 
       
   188   $ chg bulkwrite --pager=on --color no --config ui.formatted=True
       
   189   paged! 'going to write massive data\n'
       
   190   killed! (?)
       
   191   [255]
       
   192 
       
   193   $ chg bulkwrite --pager=on --color no --config ui.formatted=True
       
   194   paged! 'going to write massive data\n'
       
   195   killed! (?)
   153   [255]
   196   [255]
   154 
   197 
   155   $ cd ..
   198   $ cd ..
   156 
   199 
   157 server lifecycle
   200 server lifecycle