destutil: allow to disable the "on head check" in destmerge
'hg merge' refuses to pick a default destination if the working copy is not on
a head. This is a very sensible default for 'hg merge' but 'hg rebase' should
work in this situation. So we introduce a way to disable this check. It will
soon be used by rebase.
destutil: allow to specify an explicit source for the merge
We can now specify from where the merge is performed. The experimental revset
is updated to take revisions as argument, allowing to test the feature.
This will become very useful for pick the 'rebase' default destination. For this
reason, we also exclude all descendants from the rebased set from the candidate
destinations. This descendants exclusion was not necessary for merge as default
destination would not be picked from anything else than a head.
I'm not super excited with the current error messages, but I would prefer to
delay an overall messages rework once 'hg rebase' is done getting a default
destination aligned with 'hg merge'.
destutil: remove current head from list of candidates early
While 'hg merge' will refuse to pick a default destination if the working copy
is not on a head, this will be a common and valid case for rebase. In this
case, we will need to exclude from the candidate destination all descendants
from the rebased set.
We make a step forward in that direction by removing parents of the working
copy from the candidate destinations instead of manually filtering the working
copy parent at the end of the process. This will make the extra step of
filtering descendant much simpler in a future changeset.
destutil: add an 'action' layer to the destmerge message dictionary
We'll introduce messages for 'rebase' soon, so we introduce a way to select
a message based on the action being performed.
rebase: extract rebaseset and destination computation in a function
The whole rebase function is gargantuan and this computation is almost 100 lines
long. We extract it in a dedicated function as it is independent from the rest
of the rebase code.
Having it in its own function will make it easier to rework the default
destination logic.
tests: have a more elaborated test for _destrebase
The previous repo had a single lineage and a single head, pretty boring for
rebase related testing.
histedit: break _histedit function into smaller pieces
We add _getgoal, _validateargs.
This is a part of bigger effort to refactor histedit. Initial steps are to
break _histedit function into smaller pieces which will supposedly be more
understandable. After this is done, I will have a better understanding
of how histedit works and apply that to fix
issue4800.
histedit: break _histedit function into smaller pieces (add _continueaction)
This is a part of bigger effort to refactor histedit. Initial steps are to
break _histedit function into smaller pieces which will supposedly be more
understandable. After this is done, I will have a better understanding
of how histedit works and apply that to fix
issue4800.