Bug 5838 - Interrupted rebase recovery instructions are wrong
Summary: Interrupted rebase recovery instructions are wrong
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: rebase (show other bugs)
Version: 4.5.2
Hardware: All All
: wish bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-12 10:36 UTC by Matt Harbison
Modified: 2018-06-12 00:00 UTC (History)
2 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Harbison 2018-04-12 10:36 UTC
I hit this on Windows a few weeks ago in the hg repo, when rebase aborted because a file was open.  The transcript below is from Linux with a rebase that aborted because a subrepo wasn't available.

# The parent repo is fully present, but the subrepo revision used in tip is not.
# For whatever reason, the *.local style hostnames aren't working on this system
# now, and that's what is in paths.default.

$ hg rebase -b . -d tip
rebasing 19929:ff68cd4fe339 "..."
abort: error: Name or service not known

# Oops.  Override the path and try again.
$ hg rebase -b . -d tip --config paths.default=http://matt7h-pc:8000
abort: last update was interrupted
(use 'hg update' to get a consistent checkout)

# No flavor of update does anything useful.
$ hg up .
abort: rebase in progress
(use 'hg rebase --continue' or 'hg rebase --abort')
$ hg up -C .
abort: rebase in progress
(use 'hg rebase --continue' or 'hg rebase --abort')

$ hg version
Mercurial Distributed SCM (version 4.5.2+2-9639c433be54)
(see https://mercurial-scm.org for more information)
Comment 1 Bugzilla 2018-05-13 00:00 UTC
Bug was set to UNCONFIRMED for 30 days, bumping
Comment 2 Augie Fackler 2018-06-01 02:13 UTC
I'm not sure what the problem is here? The instructions look valid, but maybe there's some wedged state that's slightly wrong? Can you help me understand how to create this case?
Comment 3 Matt Harbison 2018-06-01 07:41 UTC
The problem is that in this state, it tells you to use `update` when you issue a `rebase` command, and then when you issue the `update`, it tells you to use `rebase` instead.  It seems like when you issue the first rebase, it should instead say “a rebase is already in progress.  Use —continue or —abort.”

It mentions that the problem occurs when rebasing a subrepo that isn’t available locally, so we should be able to craft a test that doesn’t rely on the Windows file locking nonsense.  I’ll see if I can come up with a test case.
Comment 4 Matt Harbison 2018-06-02 00:36 UTC
It looks like this fits nicely into an existing test, without subrepo nonsense.  Based on f715faeaceee in hg-committed:

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
@@ -376,6 +376,18 @@ test aborting an interrupted series (iss
   rebasing 4:e80b69427d80 "c"
   abort: ^C
   [255]
+  $ hg rebase -s 3 -d tip
+  abort: last update was interrupted
+  (use 'hg update' to get a consistent checkout)
+  [255]
+  $ hg up .
+  abort: rebase in progress
+  (use 'hg rebase --continue' or 'hg rebase --abort')
+  [255]
+  $ hg up -C .
+  abort: rebase in progress
+  (use 'hg rebase --continue' or 'hg rebase --abort')
+  [255]
   $ hg rebase --abort
   saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/3d8812cf300d-93041a90-backup.hg
   rebase aborted
Comment 5 HG Bot 2018-06-04 18:40 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/79c54e7c0c52
Matt Harbison <matt_harbison@yahoo.com>
rebase: prioritize indicating an interrupted rebase over update (issue5838)

This should also cover the transplant extension, and any other non clearable
states.

(please test the fix)
Comment 6 Bugzilla 2018-06-12 00:00 UTC
Bug was set to TESTING for 7 days, resolving