sapling/eden/scm/tests/test-deprecate.t
Durham Goode 55ba025a8e tests: fix test-deprecate.t
Summary: I made a change before landing my last diff and didn't retest.

Reviewed By: xavierd

Differential Revision: D21944268

fbshipit-source-id: a5c820cef5b0fc019c7be5d096db9d0e7b3e5a44
2020-06-10 19:29:40 -07:00

48 lines
1.7 KiB
Perl

#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
note: the feature will be completely disabled soon, so please migrate off
$ hg testdeprecate 2
warning: sleeping for 2 seconds because feature 'test-feature' is deprecated: blah blah message
note: the feature will be completely disabled soon, so please migrate off
$ 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
note: the feature will be completely disabled soon, so please migrate off
$ 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]