# HG changeset patch # User Martin von Zweigbergk # Date 2020-10-22 02:00:16 # Node ID 21733e8c924f528ff70708118d44dddb4d7af54a # Parent 8f07f5a9c3def514525bebd4280fb2dc23b0ae3e 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 diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -1307,6 +1307,9 @@ coreconfigitem( b'ui', b'editor', default=dynamicdefault, ) coreconfigitem( + b'ui', b'detailed-exit-code', default=False, experimental=True, +) +coreconfigitem( b'ui', b'fallbackencoding', default=None, ) coreconfigitem( diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -148,6 +148,8 @@ def callcatch(ui, func): return func() if no exception happens. otherwise do some error handling and return an exit code accordingly. does not handle all exceptions. """ + coarse_exit_code = -1 + detailed_exit_code = -1 try: try: return func() @@ -212,7 +214,8 @@ def callcatch(ui, func): ui.error(b"%s\n" % inst) if inst.hint: ui.error(_(b"(%s)\n") % inst.hint) - return 1 + detailed_exit_code = 240 + coarse_exit_code = 1 except error.WdirUnsupported: ui.error(_(b"abort: working directory revision cannot be specified\n")) except error.Abort as inst: @@ -266,9 +269,13 @@ def callcatch(ui, func): except SystemExit as inst: # Commands shouldn't sys.exit directly, but give a return code. # Just in case catch this and and pass exit code to caller. - return inst.code + detailed_exit_code = 254 + coarse_exit_code = inst.code - return -1 + if ui.configbool(b'ui', b'detailed-exit-code'): + return detailed_exit_code + else: + return coarse_exit_code def checknewlabel(repo, lbl, kind): diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -60,6 +60,8 @@ urlreq = util.urlreq # The config knobs that will be altered (if unset) by ui.tweakdefaults. tweakrc = b""" [ui] +# Gives detailed exit codes for input/user errors, config errors, etc. +detailed-exit-code = True # The rollback command is dangerous. As a rule, don't use it. rollback = False # Make `hg status` report copy information diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1439,6 +1439,7 @@ class Test(unittest.TestCase): hgrc.write(b'[ui]\n') hgrc.write(b'slash = True\n') hgrc.write(b'interactive = False\n') + hgrc.write(b'detailed-exit-code = True\n') hgrc.write(b'merge = internal:merge\n') hgrc.write(b'mergemarkers = detailed\n') hgrc.write(b'promptecho = True\n') diff --git a/tests/test-absorb-unfinished.t b/tests/test-absorb-unfinished.t --- a/tests/test-absorb-unfinished.t +++ b/tests/test-absorb-unfinished.t @@ -21,7 +21,7 @@ Abort absorb if there is an unfinished o merging foo.whole warning: conflicts while merging foo.whole! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg --config extensions.rebase= absorb abort: rebase in progress diff --git a/tests/test-basic.t b/tests/test-basic.t --- a/tests/test-basic.t +++ b/tests/test-basic.t @@ -9,6 +9,7 @@ Create a repository: lfs.usercache=$TESTTMP/.cache/lfs ui.slash=True ui.interactive=False + ui.detailed-exit-code=True ui.merge=internal:merge ui.mergemarkers=detailed ui.promptecho=True diff --git a/tests/test-bookmarks-rebase.t b/tests/test-bookmarks-rebase.t --- a/tests/test-bookmarks-rebase.t +++ b/tests/test-bookmarks-rebase.t @@ -81,7 +81,7 @@ aborted rebase should restore active boo 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 --abort rebase aborted $ hg bookmark @@ -96,7 +96,7 @@ after aborted rebase, restoring a bookma 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 bookmark -d three $ hg rebase --abort rebase aborted diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t --- a/tests/test-commandserver.t +++ b/tests/test-commandserver.t @@ -211,6 +211,7 @@ check that local configs for the cached lfs.usercache=$TESTTMP/.cache/lfs ui.slash=True ui.interactive=False + ui.detailed-exit-code=True ui.merge=internal:merge ui.mergemarkers=detailed ui.foo=bar @@ -222,6 +223,7 @@ check that local configs for the cached *** runcommand -R foo showconfig ui defaults ui.slash=True ui.interactive=False + ui.detailed-exit-code=True ui.merge=internal:merge ui.mergemarkers=detailed ui.nontty=true diff --git a/tests/test-copytrace-heuristics.t b/tests/test-copytrace-heuristics.t --- a/tests/test-copytrace-heuristics.t +++ b/tests/test-copytrace-heuristics.t @@ -92,7 +92,7 @@ Make sure filename heuristics do not whe You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. What do you want to do? u unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ cd .. $ rm -rf repo @@ -249,7 +249,7 @@ With small limit You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. What do you want to do? u unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --abort rebase aborted @@ -711,7 +711,7 @@ When the sourcecommitlimit is small and You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. What do you want to do? u unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] But when we have "sourcecommitlimit > (no. of drafts from base to c1)", we do fullcopytracing diff --git a/tests/test-fix.t b/tests/test-fix.t --- a/tests/test-fix.t +++ b/tests/test-fix.t @@ -869,7 +869,7 @@ fixing the working directory if there ar merging foo.whole warning: conflicts while merging foo.whole! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg --config extensions.rebase= fix --working-dir abort: unresolved conflicts diff --git a/tests/test-histedit-arguments.t b/tests/test-histedit-arguments.t --- a/tests/test-histedit-arguments.t +++ b/tests/test-histedit-arguments.t @@ -151,7 +151,7 @@ temporarily. 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Editing (08d98a8350f3), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ hg graft --continue abort: no graft in progress @@ -337,7 +337,7 @@ Test --continue with --keep > EOF Editing (eb57da33312f), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ echo edit >> alpha $ hg histedit -q --continue $ hg log -G -T '{rev}:{node|short} {desc}' @@ -364,7 +364,7 @@ Test that abort fails gracefully on exce > EOF Editing (8fda0c726bf2), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] Corrupt histedit state file $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit $ mv ../corrupt-histedit .hg/histedit-state @@ -489,7 +489,7 @@ in which case this test should be revisi warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') Fix up the change (pick 8cde254db839) (hg histedit --continue to resume) - [1] + [240] $ hg resolve -m --all (no more unresolved files) continue: hg histedit --continue @@ -498,7 +498,7 @@ in which case this test should be revisi warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') Editing (6f2f0241f119), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ hg resolve -m --all (no more unresolved files) continue: hg histedit --continue diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -437,7 +437,7 @@ rollback should not work after a histedi 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Editing (cb9a9f314b8b), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ HGEDITOR=true hg histedit --continue saved backup bundle to $TESTTMP/r0/.hg/strip-backup/cb9a9f314b8b-cc5ccb0b-histedit.hg diff --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t --- a/tests/test-histedit-fold.t +++ b/tests/test-histedit-fold.t @@ -291,7 +291,7 @@ folded content is dropped during a merge warning: conflicts while merging file! (edit, then use 'hg resolve --mark') Fix up the change (fold 251d831eeec5) (hg histedit --continue to resume) - [1] + [240] There were conflicts, we keep P1 content. This should effectively drop the changes from +6. @@ -364,7 +364,7 @@ dropped revision. warning: conflicts while merging file! (edit, then use 'hg resolve --mark') Fix up the change (fold 251d831eeec5) (hg histedit --continue to resume) - [1] + [240] $ cat > file << EOF > 1 > 2 diff --git a/tests/test-histedit-no-backup.t b/tests/test-histedit-no-backup.t --- a/tests/test-histedit-no-backup.t +++ b/tests/test-histedit-no-backup.t @@ -52,7 +52,7 @@ Test when `backup-bundle` config option merging file Editing (7d5187087c79), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ hg abort 1 files updated, 0 files merged, 0 files removed, 0 files unresolved saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg @@ -74,7 +74,7 @@ Enable config option: merging file Editing (7d5187087c79), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ hg abort 1 files updated, 0 files merged, 0 files removed, 0 files unresolved diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t --- a/tests/test-histedit-obsolete.t +++ b/tests/test-histedit-obsolete.t @@ -45,7 +45,7 @@ Test that histedit learns about obsolesc $ hg histedit -r 'all()' --commands plan Editing (1b2d564fad96), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ hg st A b A c @@ -72,7 +72,7 @@ With some node gone missing during the e $ hg histedit -r 'all()' --commands plan Editing (49d44ab2be1b), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ hg st A b A d @@ -227,7 +227,7 @@ Test that rewriting leaving instability 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Editing (b346ab9a313d), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ echo c >> c $ hg histedit --continue 1 new orphan changesets @@ -361,7 +361,7 @@ New-commit as draft (default) 0 files updated, 0 files merged, 6 files removed, 0 files unresolved Editing (b449568bf7fc), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ echo f >> f $ hg histedit --continue $ hg log -G @@ -403,7 +403,7 @@ New-commit as secret (config) 0 files updated, 0 files merged, 6 files removed, 0 files unresolved Editing (b449568bf7fc), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ echo f >> f $ hg histedit --continue $ hg log -G @@ -529,7 +529,7 @@ attempted later. > EOF Editing (ee118ab9fa44), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] #if abortcommand when in dry-run mode @@ -568,7 +568,7 @@ when in dry-run mode > EOF Editing (ee118ab9fa44), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ hg histedit --continue --config experimental.evolution.track-operation=1 $ hg log -G @ 23:175d6b286a22 (secret) k diff --git a/tests/test-largefiles-update.t b/tests/test-largefiles-update.t --- a/tests/test-largefiles-update.t +++ b/tests/test-largefiles-update.t @@ -594,7 +594,7 @@ it is aborted by conflict. merging normal1 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ cat .hglf/large1 58e24f733a964da346e2407a2bee99d9001184f5 $ cat large1 @@ -762,7 +762,7 @@ added: > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate > EOF $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py - [7] + [254] Check large1 content and status ... and that update will undo modifications: $ cat large1 large1 in #3 diff --git a/tests/test-legacy-exit-code.t b/tests/test-legacy-exit-code.t new file mode 100644 --- /dev/null +++ b/tests/test-legacy-exit-code.t @@ -0,0 +1,49 @@ +Tests that the exit code is as expected when ui.detailed-exit-code is *not* +enabled. + + $ cat >> $HGRCPATH << EOF + > [ui] + > detailed-exit-code=no + > EOF + + $ hg init + $ echo a > a +Expect exit code 0 on success + $ hg ci -Aqm initial + + $ hg co nonexistent + abort: unknown revision 'nonexistent'! + [255] + + $ hg co 'none()' + abort: empty revision set + [255] + + $ hg co 'invalid(' + hg: parse error at 8: not a prefix: end + (invalid( + ^ here) + [255] + + $ hg co 'invalid(' + hg: parse error at 8: not a prefix: end + (invalid( + ^ here) + [255] + + $ hg continue + abort: no operation in progress + [255] + + $ hg st --config a=b + abort: malformed --config option: 'a=b' (use --config section.name=value) + [255] + + $ echo b > a + $ hg ci -m second + $ echo c > a + $ hg ci -m third + $ hg --config extensions.rebase= rebase -r . -d 0 -q + warning: conflicts while merging a! (edit, then use 'hg resolve --mark') + unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') + [1] diff --git a/tests/test-merge-halt.t b/tests/test-merge-halt.t --- a/tests/test-merge-halt.t +++ b/tests/test-merge-halt.t @@ -28,7 +28,7 @@ Testing on-failure=continue merging a failed! merging b failed! unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg resolve --list U a @@ -45,7 +45,7 @@ Testing on-failure=halt merging b merging a failed! merge halted after failed merge (see hg resolve) - [1] + [240] $ hg resolve --list U a @@ -73,7 +73,7 @@ Testing on-failure=prompt merging b failed! continue merge operation (yn)? n merge halted after failed merge (see hg resolve) - [1] + [240] $ hg resolve --list U a @@ -102,7 +102,7 @@ Check that successful tool with failed p merging b failed! continue merge operation (yn)? n merge halted after failed merge (see hg resolve) - [1] + [240] $ hg resolve --list R a @@ -125,7 +125,7 @@ Check that conflicts with conflict check merging b merging a failed! merge halted after failed merge (see hg resolve) - [1] + [240] $ hg resolve --list U a @@ -146,7 +146,7 @@ Check that always-prompt also can halt t was merge of 'b' successful (yn)? n merging b failed! merge halted after failed merge (see hg resolve) - [1] + [240] $ hg resolve --list R a diff --git a/tests/test-qrecord.t b/tests/test-qrecord.t --- a/tests/test-qrecord.t +++ b/tests/test-qrecord.t @@ -458,7 +458,7 @@ qrecord should throw an error when histe 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Editing (ea55e2ae468f), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ echo 'foo bar' > a $ hg qrecord -d '0 0' -m aaa a.patch < y diff --git a/tests/test-rebase-abort.t b/tests/test-rebase-abort.t --- a/tests/test-rebase-abort.t +++ b/tests/test-rebase-abort.t @@ -82,7 +82,7 @@ Conflicting rebase: merging common warning: conflicts while merging common! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] Insert unsupported advisory merge record: @@ -149,7 +149,7 @@ earlier than 2.7 by renaming ".hg/rebase merging common warning: conflicts while merging common! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ mv .hg/rebasestate .hg/rebasestate.back $ hg update --quiet --clean 2 @@ -219,7 +219,7 @@ Rebase and abort without generating new merging c warning: conflicts while merging c! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg tglog % 4:draft 'C1' @@ -278,7 +278,7 @@ rebase abort should not leave working co merging c warning: conflicts while merging c! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg abort rebase aborted $ hg log -G --template "{rev} {desc} {bookmarks}" @@ -316,7 +316,7 @@ user has somehow managed to update to a $ hg rebase -d @ -b foo --tool=internal:fail rebasing 2:070cf4580bb5 foo tip "b2" unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ mv .hg/rebasestate ./ # so we're allowed to hg up like in mercurial <2.6.3 $ hg up -C 0 # user does other stuff in the repo @@ -463,7 +463,7 @@ during a rebase (issue4661) $ hg rebase -d 1 --tool 'internal:fail' rebasing 2:e4ea5cdc9789 "conflicting 1" unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg abort rebase aborted $ hg summary @@ -504,7 +504,7 @@ commit will cause merge conflict on reba note: not rebasing 3:0682fd3dabf5 "disappear draft", its destination already has all its changes warning: conflicts while merging root! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg abort rebase aborted $ cd .. diff --git a/tests/test-rebase-backup.t b/tests/test-rebase-backup.t --- a/tests/test-rebase-backup.t +++ b/tests/test-rebase-backup.t @@ -127,7 +127,7 @@ When backup-bundle = True: merging c warning: conflicts while merging c! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --abort saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/818c1a43c916-2b644d96-backup.hg rebase aborted @@ -143,7 +143,7 @@ When backup-bundle = False: merging c warning: conflicts while merging c! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --abort rebase aborted $ cd .. diff --git a/tests/test-rebase-bookmarks.t b/tests/test-rebase-bookmarks.t --- a/tests/test-rebase-bookmarks.t +++ b/tests/test-rebase-bookmarks.t @@ -173,7 +173,7 @@ rebase --continue with bookmarks present merging c warning: conflicts while merging c! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ echo 'c' > c $ hg resolve --mark c (no more unresolved files) diff --git a/tests/test-rebase-check-restore.t b/tests/test-rebase-check-restore.t --- a/tests/test-rebase-check-restore.t +++ b/tests/test-rebase-check-restore.t @@ -70,7 +70,7 @@ Rebasing B onto E - check keep: and phas merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] Solve the conflict and go on: @@ -127,7 +127,7 @@ Rebase F onto E - check keepbranches: merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] Solve the conflict and go on: diff --git a/tests/test-rebase-collapse.t b/tests/test-rebase-collapse.t --- a/tests/test-rebase-collapse.t +++ b/tests/test-rebase-collapse.t @@ -292,7 +292,7 @@ Preserves external parent You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. What do you want to do? u unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ echo F > E $ hg resolve -m @@ -659,7 +659,7 @@ running into merge conflict and invoking merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ rm A.orig $ hg resolve --mark A (no more unresolved files) @@ -706,7 +706,7 @@ Test aborted editor on final message merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg tglog o 3: 63668d570d21 'C' | @@ -734,7 +734,7 @@ Test aborted editor on final message merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg tglog % 3: 63668d570d21 'C' | diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t --- a/tests/test-rebase-conflicts.t +++ b/tests/test-rebase-conflicts.t @@ -67,7 +67,7 @@ Conflicting rebase: merging common warning: conflicts while merging common! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg status --config commands.status.verbose=1 M common @@ -345,7 +345,7 @@ Test minimization of merge conflicts merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg diff diff -r 328e4ab1f7cc a --- a/a Thu Jan 01 00:00:00 1970 +0000 @@ -365,7 +365,7 @@ Test minimization of merge conflicts merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg diff diff -r 328e4ab1f7cc a --- a/a Thu Jan 01 00:00:00 1970 +0000 @@ -403,7 +403,7 @@ Test rebase with obsstore turned on and merging B warning: conflicts while merging B! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ echo 4 > B $ hg resolve -m @@ -455,7 +455,7 @@ Test where the conflict happens when reb merging conflict warning: conflicts while merging conflict! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg tglog @ 8:draft 'E' | diff --git a/tests/test-rebase-dest.t b/tests/test-rebase-dest.t --- a/tests/test-rebase-dest.t +++ b/tests/test-rebase-dest.t @@ -49,7 +49,7 @@ Requiring dest should not break continue merging c warning: conflicts while merging c! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ echo d > c $ hg resolve --mark --all (no more unresolved files) diff --git a/tests/test-rebase-detach.t b/tests/test-rebase-detach.t --- a/tests/test-rebase-detach.t +++ b/tests/test-rebase-detach.t @@ -298,7 +298,7 @@ Ensure --continue restores a correct sta merging B warning: conflicts while merging B! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg resolve --all -t internal:local (no more unresolved files) continue: hg rebase --continue diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t --- a/tests/test-rebase-inmemory.t +++ b/tests/test-rebase-inmemory.t @@ -465,7 +465,7 @@ In-memory rebase that fails due to merge merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --abort saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/c1e524d4287c-f91f82e1-backup.hg rebase aborted @@ -856,7 +856,7 @@ Test rebasing when the file we are mergi merging foo warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ cd $TESTTMP @@ -889,7 +889,7 @@ Test rebasing when we're in the middle o merging foo warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase -r 3 -d 1 -t:merge3 abort: rebase in progress (use 'hg rebase --continue', 'hg rebase --abort', or 'hg rebase --stop') diff --git a/tests/test-rebase-interruptions.t b/tests/test-rebase-interruptions.t --- a/tests/test-rebase-interruptions.t +++ b/tests/test-rebase-interruptions.t @@ -62,7 +62,7 @@ Rebasing B onto E: merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] Force a commit on C during the interruption: @@ -99,7 +99,7 @@ Resume the rebasing: merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] Solve the conflict and go on: @@ -158,7 +158,7 @@ Rebasing B onto E: merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] Force a commit on B' during the interruption: @@ -230,7 +230,7 @@ Rebasing B onto E: merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] Change phase on B and B' @@ -303,7 +303,7 @@ Continue rebase after upgrading from an merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg tglog @ 5: 45396c49d53b 'B' | @@ -506,7 +506,7 @@ Make sure merge state is cleaned up afte merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ echo a > a $ echo c >> a $ hg resolve --mark a @@ -526,7 +526,7 @@ Now try again with --collapse merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ echo a > a $ echo c >> a $ hg resolve --mark a diff --git a/tests/test-rebase-mq-skip.t b/tests/test-rebase-mq-skip.t --- a/tests/test-rebase-mq-skip.t +++ b/tests/test-rebase-mq-skip.t @@ -156,7 +156,7 @@ already has one local mq patch note: not rebasing 3:6ff5b8feed8e r3 "r3", its destination already has all its changes rebasing 4:094320fec554 r4 "r4" unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ HGMERGE=internal:local hg resolve --all (no more unresolved files) diff --git a/tests/test-rebase-mq.t b/tests/test-rebase-mq.t --- a/tests/test-rebase-mq.t +++ b/tests/test-rebase-mq.t @@ -63,7 +63,7 @@ Rebase - generate a conflict: merging f warning: conflicts while merging f! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] Fix the 1st conflict: @@ -77,7 +77,7 @@ Fix the 1st conflict: merging f warning: conflicts while merging f! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] Fix the 2nd conflict: diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t --- a/tests/test-rebase-obsolete.t +++ b/tests/test-rebase-obsolete.t @@ -1033,7 +1033,7 @@ Create the changes that we will rebase 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 @@ rebasestate may contain hidden hashes. " 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 @@ Test --stop option | 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 @@ Test it aborts if unstable csets is not 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 @@ Test --stop when --keep is passed: 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 @@ Test --stop aborts when --collapse was p 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 @@ Test --stop raise errors with conflictin 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 @@ Test --stop moves bookmarks of original 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" diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t --- a/tests/test-rebase-parameters.t +++ b/tests/test-rebase-parameters.t @@ -480,7 +480,7 @@ Test --tool parameter: $ hg rebase -s 2 -d 1 --tool internal:fail rebasing 2:e4e3f3546619 tip "c2b" unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg summary parent: 1:56daeba07f4b diff --git a/tests/test-rebase-partial.t b/tests/test-rebase-partial.t --- a/tests/test-rebase-partial.t +++ b/tests/test-rebase-partial.t @@ -85,7 +85,7 @@ Abort doesn't lose the commits that were merging file warning: conflicts while merging file! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg rebase --abort rebase aborted $ hg tglog diff --git a/tests/test-rebase-pull.t b/tests/test-rebase-pull.t --- a/tests/test-rebase-pull.t +++ b/tests/test-rebase-pull.t @@ -90,7 +90,7 @@ Abort pull early if another operation (h > EOF Editing (d80cc2da061e), you may commit or record as needed now. (hg histedit --continue to resume) - [1] + [240] $ hg pull --rebase abort: histedit in progress (use 'hg histedit --continue' or 'hg histedit --abort') diff --git a/tests/test-rebase-transaction.t b/tests/test-rebase-transaction.t --- a/tests/test-rebase-transaction.t +++ b/tests/test-rebase-transaction.t @@ -108,7 +108,7 @@ continued merging conflict warning: conflicts while merging conflict! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg tglog o 5: D | diff --git a/tests/test-resolve.t b/tests/test-resolve.t --- a/tests/test-resolve.t +++ b/tests/test-resolve.t @@ -464,7 +464,7 @@ Test 'hg resolve' confirm config option warning: conflicts while merging emp2! (edit, then use 'hg resolve --mark') warning: conflicts while merging emp3! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] Test when commands.resolve.confirm config option is not set: =========================================================== diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -366,7 +366,7 @@ force a conflicted merge to occur merging a/a warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ hg status -v M a/a M b.rename/b @@ -484,7 +484,7 @@ redo the unshelve to get a conflict $ hg unshelve -q warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] attempt to continue @@ -705,7 +705,7 @@ Recreate some conflict again merging a/a warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ hg bookmark test (4|13):33f7f61e6c5e (re) @@ -1387,7 +1387,7 @@ Abort unshelve while merging (issue5123) warning: conflicts while merging bar1! (edit, then use 'hg resolve --mark') warning: conflicts while merging bar2! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ cat > bar1 < A diff --git a/tests/test-shelve2.t b/tests/test-shelve2.t --- a/tests/test-shelve2.t +++ b/tests/test-shelve2.t @@ -219,7 +219,7 @@ unshelve and conflicts with tracked and merging f warning: conflicts while merging f! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] #if phasebased $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}' @@ -290,7 +290,7 @@ unshelve and conflicts with tracked and merging f warning: conflicts while merging f! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ hg st M f ? f.orig @@ -345,7 +345,7 @@ test .orig files go where the user wants $ hg unshelve -q --config 'ui.origbackuppath=.hg/origbackups' warning: conflicts while merging root! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ ls .hg/origbackups root $ rm -rf .hg/origbackups @@ -563,7 +563,7 @@ will be preserved. merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ echo "aaabbbccc" > a $ rm a.orig $ hg resolve --mark a @@ -637,7 +637,7 @@ shelve on new branch, conflict with prev merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] Removing restore branch information from shelvedstate file(making it looks like in previous versions) and running unshelve --continue @@ -715,7 +715,7 @@ Prepare unshelve with a corrupted shelve merging file warning: conflicts while merging file! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ echo somethingsomething > .hg/shelvedstate Unshelve --continue fails with appropriate message if shelvedstate is corrupted @@ -762,7 +762,7 @@ Unshelve respects --keep even if user in merging file warning: conflicts while merging file! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ hg resolve --mark file (no more unresolved files) continue: hg unshelve --continue @@ -819,7 +819,7 @@ New versions of Mercurial know how to re merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] putting v1 shelvedstate file in place of a created v2 $ cat << EOF > .hg/shelvedstate > 1 @@ -860,7 +860,7 @@ Test with the `.shelve` missing, but the merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ hg abort unshelve of 'default' aborted @@ -877,7 +877,7 @@ Unshelve without .shelve metadata (can h merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ cat .hg/shelved/default.shelve node=82e0cb9893247d12667017593ce1e5655860f1ac $ hg abort @@ -905,7 +905,7 @@ Block merge abort when unshelve in progr merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ hg log --template '{desc|firstline} {author} {date|isodate} \n' -r . pending changes temporary commit shelve@localhost 1970-01-01 00:00 +0000 @@ -934,7 +934,7 @@ Demonstrate that the labels are correct $ hg unshelve -q warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') - [1] + [240] $ cat foo r0 <<<<<<< working-copy: 0b2fcf2a90e9 - shelve: pending changes temporary commit diff --git a/tests/test-sparse-profiles.t b/tests/test-sparse-profiles.t --- a/tests/test-sparse-profiles.t +++ b/tests/test-sparse-profiles.t @@ -201,7 +201,7 @@ Verify rebase conflicts pulls in the con warning: conflicts while merging backend.sparse! (edit, then use 'hg resolve --mark') warning: conflicts while merging data.py! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ rm *.orig $ ls -A .hg diff --git a/tests/test-sparse.t b/tests/test-sparse.t --- a/tests/test-sparse.t +++ b/tests/test-sparse.t @@ -201,7 +201,7 @@ Verify rebase temporarily includes exclu merging hide warning: conflicts while merging hide! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') - [1] + [240] $ hg debugsparse [exclude] diff --git a/tests/test-state-extension.t b/tests/test-state-extension.t --- a/tests/test-state-extension.t +++ b/tests/test-state-extension.t @@ -101,7 +101,7 @@ Test extension of unfinished states supp merging file1 warning: conflicts while merging file1! (edit, then use 'hg resolve --mark') unresolved conflicts (see 'hg resolve', then 'hg chainify --continue') - [1] + [240] $ hg status --config commands.status.verbose=True M file1 ? file1.orig