tests/test-devel-warnings.t
changeset 32989 149b68224b08
parent 32971 accfa165736b
child 33061 c41cbe98822c
equal deleted inserted replaced
32986:2529e2ae9f4c 32989:149b68224b08
   191 
   191 
   192 (disabled outside of test run)
   192 (disabled outside of test run)
   193 
   193 
   194   $ HGEMITWARNINGS= hg nouiwarning
   194   $ HGEMITWARNINGS= hg nouiwarning
   195 
   195 
       
   196 Test warning on config option access and registration
       
   197 
       
   198   $ cat << EOF > ${TESTTMP}/buggyconfig.py
       
   199   > """A small extension that tests our developer warnings for config"""
       
   200   > 
       
   201   > from mercurial import registrar
       
   202   > 
       
   203   > cmdtable = {}
       
   204   > command = registrar.command(cmdtable)
       
   205   > 
       
   206   > @command('buggyconfig')
       
   207   > def cmdbuggyconfig(ui, repo):
       
   208   >     repo.ui.config('ui', 'quiet', False)
       
   209   >     repo.ui.config('ui', 'interactive', None)
       
   210   > EOF
       
   211 
       
   212   $ hg --config "extensions.buggyconfig=${TESTTMP}/buggyconfig.py" buggyconfig
       
   213   devel-warn: specifying a default value for a registered config item: 'ui.quiet' 'False' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
       
   214 
   196   $ cd ..
   215   $ cd ..