2020-06-09 02:18:49 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
|
|
|
$ configure modern
|
|
|
|
|
|
|
|
$ newext deprecatecmd <<EOF
|
|
|
|
> from edenscm.mercurial import registrar
|
|
|
|
> cmdtable = {}
|
|
|
|
> command = registrar.command(cmdtable)
|
|
|
|
> @command('testdeprecate', [], 'hg testdeprecate')
|
|
|
|
> def testdeprecate(ui, repo, level):
|
|
|
|
> ui.deprecate("test-feature", "blah blah message", int(level))
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
$ hg init client
|
|
|
|
$ cd client
|
|
|
|
|
|
|
|
$ hg testdeprecate 0
|
|
|
|
devel-warn: feature 'test-feature' is deprecated: blah blah message
|
|
|
|
at: $TESTTMP/deprecatecmd.py:6 (testdeprecate)
|
|
|
|
$ hg blackbox | grep deprecated
|
|
|
|
* [legacy][deprecated] blah blah message (glob)
|
|
|
|
* [legacy][develwarn] devel-warn: feature 'test-feature' is deprecated: blah blah message (glob)
|
|
|
|
|
|
|
|
$ hg testdeprecate 1
|
|
|
|
warning: feature 'test-feature' is deprecated: blah blah message
|
2020-06-09 07:20:29 +03:00
|
|
|
note: the feature will be completely disabled soon, so please migrate off
|
2020-06-09 02:18:49 +03:00
|
|
|
|
|
|
|
$ hg testdeprecate 2
|
|
|
|
warning: sleeping for 2 seconds because feature 'test-feature' is deprecated: blah blah message
|
2020-06-09 07:20:29 +03:00
|
|
|
note: the feature will be completely disabled soon, so please migrate off
|
2020-06-09 02:18:49 +03:00
|
|
|
|
|
|
|
$ hg testdeprecate 3
|
|
|
|
abort: feature 'test-feature' is disabled: blah blah message
|
|
|
|
(set config `deprecated.bypass-test-feature=True` to temporarily bypass this block)
|
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg testdeprecate 3 --config deprecated.bypass-test-feature=True
|
|
|
|
warning: feature 'test-feature' is deprecated: blah blah message
|
2020-06-09 07:20:29 +03:00
|
|
|
note: the feature will be completely disabled soon, so please migrate off
|
2020-06-09 02:18:49 +03:00
|
|
|
|
|
|
|
$ hg testdeprecate 4
|
|
|
|
abort: feature 'test-feature' is disabled: blah blah message
|
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg testdeprecate 4 --config deprecated.bypass-test-feature=True
|
|
|
|
abort: feature 'test-feature' is disabled: blah blah message
|
|
|
|
[255]
|