Mercurial > hg
annotate tests/test-legacy-exit-code.t @ 47072:4c041c71ec01
revlog: introduce an explicit tracking of what the revlog is about
Since the dawn of time, people have been forced to rely to lossy introspection
of the index filename to determine what the purpose and role of the revlog they
encounter is. This is hacky, error prone, inflexible, abstraction-leaky,
<insert-your-own-complaints-here>.
In f63299ee7e4d Raphaël introduced a new attribute to track this information:
`revlog_kind`. However it is initialized in an odd place and various instances
end up not having it set. In addition is only tracking some of the information
we end up having to introspect in various pieces of code.
So we add a new attribute that holds more data and is more strictly enforced.
This work is done in collaboration with Raphaël.
The `revlog_kind` one will be removed/adapted in the next changeset. We expect
to be able to clean up various existing piece of code and to simplify coming
work around the newer revlog format.
Differential Revision: https://phab.mercurial-scm.org/D10352
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 06 Apr 2021 05:20:24 +0200 |
parents | 95c4cca641f6 |
children | 55c6ebd11cb9 |
rev | line source |
---|---|
45826
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
1 Tests that the exit code is as expected when ui.detailed-exit-code is *not* |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
2 enabled. |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
3 |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
4 $ cat >> $HGRCPATH << EOF |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
5 > [ui] |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
6 > detailed-exit-code=no |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
7 > EOF |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
8 |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
9 $ hg init |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
10 $ echo a > a |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
11 Expect exit code 0 on success |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
12 $ hg ci -Aqm initial |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
13 |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
14 $ hg co nonexistent |
45906
95c4cca641f6
errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents:
45826
diff
changeset
|
15 abort: unknown revision 'nonexistent' |
45826
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
16 [255] |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
17 |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
18 $ hg co 'none()' |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
19 abort: empty revision set |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
20 [255] |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
21 |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
22 $ hg co 'invalid(' |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
23 hg: parse error at 8: not a prefix: end |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
24 (invalid( |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
25 ^ here) |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
26 [255] |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
27 |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
28 $ hg co 'invalid(' |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
29 hg: parse error at 8: not a prefix: end |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
30 (invalid( |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
31 ^ here) |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
32 [255] |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
33 |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
34 $ hg continue |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
35 abort: no operation in progress |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
36 [255] |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
37 |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
38 $ hg st --config a=b |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
39 abort: malformed --config option: 'a=b' (use --config section.name=value) |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
40 [255] |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
41 |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
42 $ echo b > a |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
43 $ hg ci -m second |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
44 $ echo c > a |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
45 $ hg ci -m third |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
46 $ hg --config extensions.rebase= rebase -r . -d 0 -q |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
47 warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
48 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') |
21733e8c924f
errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
49 [1] |