tests/test-extension.t
changeset 48360 e4acdf5d94a2
parent 48016 5caec48d9a01
child 48361 0d0ce2529540
equal deleted inserted replaced
48359:e4e2ce328599 48360:e4acdf5d94a2
   647 
   647 
   648 Python 3's lazy importer verifies modules exist before returning the lazy
   648 Python 3's lazy importer verifies modules exist before returning the lazy
   649 module stub. Our custom lazy importer for Python 2 always returns a stub.
   649 module stub. Our custom lazy importer for Python 2 always returns a stub.
   650 
   650 
   651   $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity) || true
   651   $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity) || true
   652   *** failed to import extension checkrelativity from $TESTTMP/checkrelativity.py: No module named 'extlibroot.lsub1.lsub2.notexist' (py3 !)
   652   *** failed to import extension "checkrelativity" from $TESTTMP/checkrelativity.py: No module named 'extlibroot.lsub1.lsub2.notexist'
   653   hg: unknown command 'checkrelativity' (py3 !)
   653   hg: unknown command 'checkrelativity' (py3 !)
   654   (use 'hg help' for a list of commands) (py3 !)
   654   (use 'hg help' for a list of commands) (py3 !)
   655 
   655 
   656 #endif
   656 #endif
   657 
   657 
  1880   > hgext.mq = !
  1880   > hgext.mq = !
  1881   > hgext/mq = !
  1881   > hgext/mq = !
  1882   > EOF
  1882   > EOF
  1883 
  1883 
  1884   $ hg deprecatedcmd > /dev/null
  1884   $ hg deprecatedcmd > /dev/null
  1885   *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
  1885   *** failed to import extension "deprecatedcmd" from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
  1886   *** (use @command decorator to register 'deprecatedcmd')
  1886   *** (use @command decorator to register 'deprecatedcmd')
  1887   hg: unknown command 'deprecatedcmd'
  1887   hg: unknown command 'deprecatedcmd'
  1888   (use 'hg help' for a list of commands)
  1888   (use 'hg help' for a list of commands)
  1889   [10]
  1889   [10]
  1890 
  1890 
  1891  the extension shouldn't be loaded at all so the mq works:
  1891  the extension shouldn't be loaded at all so the mq works:
  1892 
  1892 
  1893   $ hg qseries --config extensions.mq= > /dev/null
  1893   $ hg qseries --config extensions.mq= > /dev/null
  1894   *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
  1894   *** failed to import extension "deprecatedcmd" from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
  1895   *** (use @command decorator to register 'deprecatedcmd')
  1895   *** (use @command decorator to register 'deprecatedcmd')
  1896 
  1896 
  1897   $ cd ..
  1897   $ cd ..
  1898 
  1898 
  1899 Test synopsis and docstring extending
  1899 Test synopsis and docstring extending
  1937   $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
  1937   $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
  1938   > [extensions]
  1938   > [extensions]
  1939   > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py
  1939   > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py
  1940   > EOF
  1940   > EOF
  1941   $ hg -R $TESTTMP/opt-unicode-default dummy
  1941   $ hg -R $TESTTMP/opt-unicode-default dummy
  1942   *** failed to import extension test_unicode_default_value from $TESTTMP/test_unicode_default_value.py: unicode *'value' found in cmdtable.dummy (glob)
  1942   *** failed to import extension "test_unicode_default_value" from $TESTTMP/test_unicode_default_value.py: unicode 'value' found in cmdtable.dummy
  1943   *** (use b'' to make it byte string)
  1943   *** (use b'' to make it byte string)
  1944   hg: unknown command 'dummy'
  1944   hg: unknown command 'dummy'
  1945   (did you mean summary?)
  1945   (did you mean summary?)
  1946   [10]
  1946   [10]