Mercurial > hg
comparison tests/test-rebase-abort.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 | 527ce85c2e60 |
comparison
equal
deleted
inserted
replaced
45825:8f07f5a9c3de | 45826:21733e8c924f |
---|---|
80 rebasing 3:3163e20567cc "L1" | 80 rebasing 3:3163e20567cc "L1" |
81 rebasing 4:46f0b057b5c0 tip "L2" | 81 rebasing 4:46f0b057b5c0 tip "L2" |
82 merging common | 82 merging common |
83 warning: conflicts while merging common! (edit, then use 'hg resolve --mark') | 83 warning: conflicts while merging common! (edit, then use 'hg resolve --mark') |
84 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | 84 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') |
85 [1] | 85 [240] |
86 | 86 |
87 Insert unsupported advisory merge record: | 87 Insert unsupported advisory merge record: |
88 | 88 |
89 $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x | 89 $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x |
90 $ hg debugmergestate | 90 $ hg debugmergestate |
147 rebasing 3:3163e20567cc "L1" | 147 rebasing 3:3163e20567cc "L1" |
148 rebasing 4:46f0b057b5c0 tip "L2" | 148 rebasing 4:46f0b057b5c0 tip "L2" |
149 merging common | 149 merging common |
150 warning: conflicts while merging common! (edit, then use 'hg resolve --mark') | 150 warning: conflicts while merging common! (edit, then use 'hg resolve --mark') |
151 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | 151 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') |
152 [1] | 152 [240] |
153 | 153 |
154 $ mv .hg/rebasestate .hg/rebasestate.back | 154 $ mv .hg/rebasestate .hg/rebasestate.back |
155 $ hg update --quiet --clean 2 | 155 $ hg update --quiet --clean 2 |
156 $ hg --config extensions.mq= strip --quiet "destination()" | 156 $ hg --config extensions.mq= strip --quiet "destination()" |
157 $ mv .hg/rebasestate.back .hg/rebasestate | 157 $ mv .hg/rebasestate.back .hg/rebasestate |
217 note: not rebasing 3:a6484957d6b9 "B bis", its destination already has all its changes | 217 note: not rebasing 3:a6484957d6b9 "B bis", its destination already has all its changes |
218 rebasing 4:145842775fec tip "C1" | 218 rebasing 4:145842775fec tip "C1" |
219 merging c | 219 merging c |
220 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | 220 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
221 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | 221 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') |
222 [1] | 222 [240] |
223 | 223 |
224 $ hg tglog | 224 $ hg tglog |
225 % 4:draft 'C1' | 225 % 4:draft 'C1' |
226 | | 226 | |
227 o 3:draft 'B bis' | 227 o 3:draft 'B bis' |
276 $ hg rebase -d master -r foo | 276 $ hg rebase -d master -r foo |
277 rebasing 3:6c0f977a22d8 foo tip "C" | 277 rebasing 3:6c0f977a22d8 foo tip "C" |
278 merging c | 278 merging c |
279 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | 279 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
280 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | 280 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') |
281 [1] | 281 [240] |
282 $ hg abort | 282 $ hg abort |
283 rebase aborted | 283 rebase aborted |
284 $ hg log -G --template "{rev} {desc} {bookmarks}" | 284 $ hg log -G --template "{rev} {desc} {bookmarks}" |
285 @ 3 C foo | 285 @ 3 C foo |
286 | | 286 | |
314 created new head | 314 created new head |
315 | 315 |
316 $ hg rebase -d @ -b foo --tool=internal:fail | 316 $ hg rebase -d @ -b foo --tool=internal:fail |
317 rebasing 2:070cf4580bb5 foo tip "b2" | 317 rebasing 2:070cf4580bb5 foo tip "b2" |
318 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | 318 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') |
319 [1] | 319 [240] |
320 | 320 |
321 $ mv .hg/rebasestate ./ # so we're allowed to hg up like in mercurial <2.6.3 | 321 $ mv .hg/rebasestate ./ # so we're allowed to hg up like in mercurial <2.6.3 |
322 $ hg up -C 0 # user does other stuff in the repo | 322 $ hg up -C 0 # user does other stuff in the repo |
323 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 323 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
324 | 324 |
461 $ hg ci -m "conflicting 2" | 461 $ hg ci -m "conflicting 2" |
462 | 462 |
463 $ hg rebase -d 1 --tool 'internal:fail' | 463 $ hg rebase -d 1 --tool 'internal:fail' |
464 rebasing 2:e4ea5cdc9789 "conflicting 1" | 464 rebasing 2:e4ea5cdc9789 "conflicting 1" |
465 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | 465 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') |
466 [1] | 466 [240] |
467 $ hg abort | 467 $ hg abort |
468 rebase aborted | 468 rebase aborted |
469 $ hg summary | 469 $ hg summary |
470 parent: 3:b16646383533 tip | 470 parent: 3:b16646383533 tip |
471 conflicting 2 | 471 conflicting 2 |
502 | 502 |
503 $ hg rebase -d 'public()' --tool :merge -q | 503 $ hg rebase -d 'public()' --tool :merge -q |
504 note: not rebasing 3:0682fd3dabf5 "disappear draft", its destination already has all its changes | 504 note: not rebasing 3:0682fd3dabf5 "disappear draft", its destination already has all its changes |
505 warning: conflicts while merging root! (edit, then use 'hg resolve --mark') | 505 warning: conflicts while merging root! (edit, then use 'hg resolve --mark') |
506 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') | 506 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') |
507 [1] | 507 [240] |
508 $ hg abort | 508 $ hg abort |
509 rebase aborted | 509 rebase aborted |
510 $ cd .. | 510 $ cd .. |
511 | 511 |