tests/test-profile.t
changeset 38108 fd8eedcc3fd2
parent 35400 4441705b7111
child 39723 5abc47d4ca6b
equal deleted inserted replaced
38107:5a3feb2bc9dd 38108:fd8eedcc3fd2
    67   $ cat >> sleepext.py << EOF
    67   $ cat >> sleepext.py << EOF
    68   > import time
    68   > import time
    69   > from mercurial import registrar, commands
    69   > from mercurial import registrar, commands
    70   > cmdtable = {}
    70   > cmdtable = {}
    71   > command = registrar.command(cmdtable)
    71   > command = registrar.command(cmdtable)
    72   > @command(b'sleep', [], 'hg sleep')
    72   > @command(b'sleep', [], b'hg sleep')
    73   > def sleep(ui, *args, **kwargs):
    73   > def sleep(ui, *args, **kwargs):
    74   >     time.sleep(0.1)
    74   >     time.sleep(0.1)
    75   > EOF
    75   > EOF
    76 
    76 
    77   $ cat >> $HGRCPATH << EOF
    77   $ cat >> $HGRCPATH << EOF
   121   > def profile(ui, fp):
   121   > def profile(ui, fp):
   122   >     print('fooprof: start profile')
   122   >     print('fooprof: start profile')
   123   >     yield
   123   >     yield
   124   >     print('fooprof: end profile')
   124   >     print('fooprof: end profile')
   125   > def extsetup(ui):
   125   > def extsetup(ui):
   126   >     ui.write('fooprof: loaded\n')
   126   >     ui.write(b'fooprof: loaded\n')
   127   > EOF
   127   > EOF
   128 
   128 
   129   $ cat > otherextension.py <<EOF
   129   $ cat > otherextension.py <<EOF
   130   > from __future__ import absolute_import
   130   > from __future__ import absolute_import
   131   > def extsetup(ui):
   131   > def extsetup(ui):
   132   >     ui.write('otherextension: loaded\n')
   132   >     ui.write(b'otherextension: loaded\n')
   133   > EOF
   133   > EOF
   134 
   134 
   135   $ hg init b
   135   $ hg init b
   136   $ cd b
   136   $ cd b
   137   $ cat >> .hg/hgrc <<EOF
   137   $ cat >> .hg/hgrc <<EOF