Mercurial > public > mercurial-scm > hg-stable
annotate rust/rhg/src/exitcode.rs @ 46820:821929d59e01
rhg: add support for detailed exit code for ConfigParseError
This patch adds basic support for detailed exit code to rhg with support for
ConfigParseError.
For now, if parsing the config results in error, we silently fallbacks to
`false`. The python version in this case emits a traceback.
Differential Revision: https://phab.mercurial-scm.org/D10253
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 20 Mar 2021 02:03:57 +0530 |
parents | b1f2c2b336ec |
children |
rev | line source |
---|---|
45001 | 1 pub type ExitCode = i32; |
2 | |
45050
513b3ef277a3
rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45001
diff
changeset
|
3 /// Successful exit |
513b3ef277a3
rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45001
diff
changeset
|
4 pub const OK: ExitCode = 0; |
513b3ef277a3
rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45001
diff
changeset
|
5 |
513b3ef277a3
rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45001
diff
changeset
|
6 /// Generic abort |
513b3ef277a3
rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45001
diff
changeset
|
7 pub const ABORT: ExitCode = 255; |
513b3ef277a3
rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45001
diff
changeset
|
8 |
46820
821929d59e01
rhg: add support for detailed exit code for ConfigParseError
Pulkit Goyal <7895pulkit@gmail.com>
parents:
46757
diff
changeset
|
9 // Abort when there is a config related error |
821929d59e01
rhg: add support for detailed exit code for ConfigParseError
Pulkit Goyal <7895pulkit@gmail.com>
parents:
46757
diff
changeset
|
10 pub const CONFIG_ERROR_ABORT: ExitCode = 30; |
821929d59e01
rhg: add support for detailed exit code for ConfigParseError
Pulkit Goyal <7895pulkit@gmail.com>
parents:
46757
diff
changeset
|
11 |
46757
b1f2c2b336ec
rhg: `cat` command: print error messages for missing files
Simon Sapin <simon.sapin@octobus.net>
parents:
46513
diff
changeset
|
12 /// Generic something completed but did not succeed |
b1f2c2b336ec
rhg: `cat` command: print error messages for missing files
Simon Sapin <simon.sapin@octobus.net>
parents:
46513
diff
changeset
|
13 pub const UNSUCCESSFUL: ExitCode = 1; |
b1f2c2b336ec
rhg: `cat` command: print error messages for missing files
Simon Sapin <simon.sapin@octobus.net>
parents:
46513
diff
changeset
|
14 |
46513
ca3f73cc3cf4
rhg: Simplify CommandError based on its use
Simon Sapin <simon.sapin@octobus.net>
parents:
45050
diff
changeset
|
15 /// Command or feature not implemented by rhg |
ca3f73cc3cf4
rhg: Simplify CommandError based on its use
Simon Sapin <simon.sapin@octobus.net>
parents:
45050
diff
changeset
|
16 pub const UNIMPLEMENTED: ExitCode = 252; |