tests/test-debugcommands.t
changeset 39901 8a42aa04ef36
parent 39722 4bd6e444c76f
child 39902 8d6ab33a61b2
equal deleted inserted replaced
39900:a89dd6d01df0 39901:8a42aa04ef36
   530 
   530 
   531 Test internal debugstacktrace command
   531 Test internal debugstacktrace command
   532 
   532 
   533   $ cat > debugstacktrace.py << EOF
   533   $ cat > debugstacktrace.py << EOF
   534   > from __future__ import absolute_import
   534   > from __future__ import absolute_import
   535   > import sys
   535   > from mercurial import (
   536   > from mercurial import util
   536   >     pycompat,
       
   537   >     util,
       
   538   > )
   537   > def f():
   539   > def f():
   538   >     util.debugstacktrace(f=sys.stdout)
   540   >     util.debugstacktrace(f=pycompat.stdout)
   539   >     g()
   541   >     g()
   540   > def g():
   542   > def g():
   541   >     util.dst('hello from g\\n', skip=1)
   543   >     util.dst(b'hello from g\\n', skip=1)
   542   >     h()
   544   >     h()
   543   > def h():
   545   > def h():
   544   >     util.dst('hi ...\\nfrom h hidden in g', 1, depth=2)
   546   >     util.dst(b'hi ...\\nfrom h hidden in g', 1, depth=2)
   545   > f()
   547   > f()
   546   > EOF
   548   > EOF
   547   $ "$PYTHON" debugstacktrace.py
   549   $ "$PYTHON" debugstacktrace.py
   548   stacktrace at:
   550   stacktrace at:
   549    debugstacktrace.py:12 in * (glob)
   551    debugstacktrace.py:14 in * (glob)
   550    debugstacktrace.py:5  in f
   552    debugstacktrace.py:7  in f
   551   hello from g at:
   553   hello from g at:
   552    debugstacktrace.py:12 in * (glob)
   554    debugstacktrace.py:14 in * (glob)
   553    debugstacktrace.py:6  in f
   555    debugstacktrace.py:8  in f
   554   hi ...
   556   hi ...
   555   from h hidden in g at:
   557   from h hidden in g at:
   556    debugstacktrace.py:6 in f
   558    debugstacktrace.py:8  in f
   557    debugstacktrace.py:9 in g
   559    debugstacktrace.py:11 in g
   558 
   560 
   559 Test debugcapabilities command:
   561 Test debugcapabilities command:
   560 
   562 
   561   $ hg debugcapabilities ./debugrevlog/
   563   $ hg debugcapabilities ./debugrevlog/
   562   Main capabilities:
   564   Main capabilities: