Bug 5206 - Add rebase --stop to allow stopping a rebase, finalizing the completed steps without aborting the whole series
Summary: Add rebase --stop to allow stopping a rebase, finalizing the completed steps ...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: rebase (show other bugs)
Version: default branch
Hardware: PC Windows
: wish feature
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-15 12:10 UTC by timeless
Modified: 2018-08-23 00:00 UTC (History)
3 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 timeless 2016-04-15 12:10 UTC
If you have a long series to rebase, you might get to a point where you can't figure out what to do next, but you've done a lot of work, and want to keep that work (including the future associated obsolete markers).

Today, you can't, you have to complete your series or abandon it.

I'm rebasing 78 linear commits.

My rebasestate has ~70 items.

It is really unfortunate to be forced to either give up, or make a new repo just because one is stuck and can't keep the work one has already done.

durin42 proposed "hg rebase --abort --keep", but that won't work, since I actually do want to obsolete the original commits.

The flag I want is probably not generally possible w/o obsolete markers, as there's no way to destroy commits and keep their descendants otherwise. It could work in cases where you have a non linear graph that you're rebasing:

o e

o d
|
o c
|
| o b
|/
o a

If I'm rebasing ((a::)-a) onto e, I should be able to stop at:


o d'
|
o c'
|
o e

o b
|
o a

But supporting that case is less urgent. I think if someone is in this position they can be forced to temporarily accept obsolete markings, and use them long enough to get out of this place. They might even learn to like them...
Comment 1 Matt Mackall 2016-04-15 16:39 UTC
Perhaps --stop.
Comment 2 Pierre-Yves David 2016-04-15 18:12 UTC
+1, I really like the ability of evolve to stop anywhere.

The main issue with rebase --stop is that, without evolution, we cannot clean up the already rebased revision. We can decide to ignore that issue or to only enable --stop when evolution is on (allowunstable flavor). The "evolution only" do not have any drawback and would be a good first step.
Comment 3 timeless 2016-04-15 18:18 UTC
Thinking about it, technically, the other form could be:

create a strip bundle and offer: pull --rebase rebase-bundle.hg. Not ideal, but somewhat workable. (Better if we leave a file w/ notes.)
Comment 4 Bugzilla 2017-01-31 00:00 UTC
Bug was inactive for 290 days, archiving
Comment 5 Martin von Zweigbergk 2017-02-13 12:38 UTC
Not yet implemented
Comment 6 Bugzilla 2017-12-09 00:00 UTC
Bug was inactive for 151 days, archiving
Comment 7 Bugzilla 2018-05-09 00:00 UTC
Bug was inactive for 150 days, archiving
Comment 8 HG Bot 2018-08-15 21:52 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/cc37009e95ca
Sushil khanchi <sushilkhanchi97@gmail.com>
rebase: add --stop option to stop rebase at any point (issue5206)

Before this patch, during a rebase if you get a point where you can't
figure out what to do next, then either you had to complete your series
or abandon all the work you have done during this rebase.

Now, with this feature you can stop at any point by keeping the rebased
csets and mark original csets as obsolete. And if you don't have evolution
extension enabled then you can use --keep option as an alternative which
will keep original csets too, instead of marking them obsolete.

Differential Revision: https://phab.mercurial-scm.org/D3959

(please test the fix)
Comment 9 Bugzilla 2018-08-23 00:00 UTC
Bug was set to TESTING for 7 days, resolving