Mercurial > hg
diff tests/test-rebase-obsolete.t @ 45826:21733e8c924f
errors: add config that lets user get more detailed exit codes
This adds an experimental config that lets the user get more detailed
exit codes. For example, there will be a specific error code for
input/user errors. This is part of
https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. I've made the
config part of tweakdefaults.
I've made the config enabled by default in tests. My reasoning is that
we want to see that each specific error case gives the right exit code
and we don't want to duplicate all error cases in the entire test
suite. It also makes it easy to grep the `.t` files for `[255]` to
find which cases we have left to fix. The logic for the current exit
codes is quite simple, so I'm not too worried about regressions
there. I've added a test case specifically for the "legacy" exit
codes.
I've set the detailed exit status only for the case of
`InterventionRequired` and `SystemExit` for now (the cases where we
currently return something other than 255), just to show that it
works.
Differential Revision: https://phab.mercurial-scm.org/D9238
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 21 Oct 2020 19:00:16 -0700 |
parents | e9555305c5c6 |
children | 8d72e29ad1e0 |
line wrap: on
line diff
--- a/tests/test-rebase-obsolete.t Sat Nov 07 21:50:28 2020 -0800 +++ b/tests/test-rebase-obsolete.t Wed Oct 21 19:00:16 2020 -0700 @@ -1033,7 +1033,7 @@ merging willconflict warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg resolve --mark willconflict (no more unresolved files) @@ -1788,7 +1788,7 @@ merging D warning: conflicts while merging D! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ cp -R . $TESTTMP/hidden-state2 @@ -1875,7 +1875,7 @@ merging d warning: conflicts while merging d! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --stop 1 new orphan changesets $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" @@ -1937,7 +1937,7 @@ merging d warning: conflicts while merging d! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --stop abort: cannot remove original changesets with unrebased descendants (either enable obsmarkers to allow unstable revisions or use --keep to keep original changesets) @@ -1955,7 +1955,7 @@ merging d warning: conflicts while merging d! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --stop $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" o 7:7fffad344617 test @@ -2017,7 +2017,7 @@ merging d warning: conflicts while merging d! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --stop abort: cannot stop in --collapse session [255] @@ -2050,7 +2050,7 @@ merging d warning: conflicts while merging d! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --stop --dry-run abort: cannot specify both --stop and --dry-run [255] @@ -2118,7 +2118,7 @@ merging d warning: conflicts while merging d! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --stop 1 new orphan changesets $ hg log -GT "{rev}: {node|short} '{desc}' bookmarks: {bookmarks}\n"