Page MenuHomePhabricator

merge: disallow merge abort in case of an unfinished operation(issue6160)
ClosedPublic

Authored by taapas1128 on Sat, Jul 6, 4:10 AM.

Details

Summary

This patch disallows hg merge --abort in case an operation of higher
precedence i.e unshelve, rebase, histedit are in unfinished states.

This is done so as to avoid partial abort of these operations in case
merge abort is called at an interrupted step.

The patch adds a cmdutil.getunfinishedstate function which checks
for operations under progress and returns a statecheck object for it.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

taapas1128 created this revision.Sat, Jul 6, 4:10 AM
pulkit added a subscriber: pulkit.Mon, Jul 8, 11:21 AM
pulkit added inline comments.
mercurial/commands.py
3953

We should first check if abort before performing this loop instead of checking later.

3955

we don't need to create a new variable. We can operate on state below.

taapas1128 updated this revision to Diff 15793.Mon, Jul 8, 11:46 AM
taapas1128 marked 2 inline comments as done.Mon, Jul 8, 11:47 AM
pulkit added inline comments.Mon, Jul 8, 11:48 AM
mercurial/commands.py
3955

We are performing the same loop in https://phab.mercurial-scm.org/D6566. How about having a utility function which will return the unfinished state, something like getunfinishedstate

okay I will create that in cmdutil.py.

taapas1128 edited the summary of this revision. (Show Details)Mon, Jul 8, 2:16 PM
taapas1128 updated this revision to Diff 15801.
pulkit added a comment.Mon, Jul 8, 5:48 PM

Also, can you add an entry about this to relnotes/next?

mercurial/commands.py
3956

state can be None here.

taapas1128 updated this revision to Diff 15814.Mon, Jul 8, 6:00 PM
taapas1128 marked an inline comment as done.Mon, Jul 8, 6:02 PM

added the entry in relnotes.

mercurial/commands.py
3956

My bad I really shouldn't have missed that.

taapas1128 marked an inline comment as done.Mon, Jul 8, 6:02 PM
pulkit accepted this revision.Tue, Jul 9, 5:45 AM
This revision is now accepted and ready to land.Tue, Jul 9, 5:45 AM