sapling/eden/scm/tests/test-exitcodemask-t.py
Adam Simpkins ab3a7cb21f Move fb-mercurial sources into an eden/scm subdirectory.
Summary:
In preparation for merging fb-mercurial sources to the Eden repository,
move everything from the top-level directory into an `eden/scm`
subdirectory.
2019-11-13 16:04:48 -08:00

42 lines
1.5 KiB
Python

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
# Command line flag is effective:
sh % "hg add a --config 'ui.exitcodemask=63'" == r"""
abort: '$TESTTMP' is not inside a repository, but this command requires a repository!
(use 'cd' to go to a directory inside a repository and try again)
[63]"""
sh % "'HGPLAIN=1' hg add a --config 'ui.exitcodemask=63'" == r"""
abort: '$TESTTMP' is not inside a repository, but this command requires a repository!
(use 'cd' to go to a directory inside a repository and try again)
[63]"""
# Config files are ignored if HGPLAIN is set:
sh % "setconfig 'ui.exitcodemask=31'"
sh % "hg add a" == r"""
abort: '$TESTTMP' is not inside a repository, but this command requires a repository!
(use 'cd' to go to a directory inside a repository and try again)
[31]"""
sh % "'HGPLAIN=1' hg add a" == r"""
abort: '$TESTTMP' is not inside a repository, but this command requires a repository!
(use 'cd' to go to a directory inside a repository and try again)
[255]"""
# But HGPLAINEXCEPT can override the behavior:
sh % "'HGPLAIN=1' 'HGPLAINEXCEPT=exitcode' hg add a" == r"""
abort: '$TESTTMP' is not inside a repository, but this command requires a repository!
(use 'cd' to go to a directory inside a repository and try again)
[31]"""