This is an archive of the discontinued Mercurial Phabricator instance.

hgext3rd: add hg continue and hg abort
Needs RevisionPublic

Authored by phillco on Nov 7 2017, 1:46 PM.
Tags
None
Subscribers

Details

Reviewers
quark
durham
Group Reviewers
Restricted Project
Summary

I hate having to remember and type which command I need to abort or continue.
Why make the user do that work? Life is short, and we already know what
statefiles exist and how to deal with them.

We could even have it loop until no statefiles are left, to deal with issues
where both a rebase state and a merge state are left.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

phillco created this revision.Nov 7 2017, 1:46 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 7 2017, 1:46 PM
phillco updated this revision to Diff 3316.Nov 7 2017, 1:47 PM
phillco updated this revision to Diff 3317.
quark requested changes to this revision.Nov 7 2017, 5:01 PM
quark added a subscriber: quark.
quark added inline comments.
hgext3rd/continue.py
28

Instead of issuing a new dispatch request, you can lookup the command function using cmdutil.findcmd and execute that function directly.

hgext3rd/undo.py
127–129

Why is this change?

This revision now requires changes to proceed.Nov 7 2017, 5:01 PM
phillco added inline comments.Nov 7 2017, 5:04 PM
hgext3rd/continue.py
28

That might work better. I'll try it.

hgext3rd/undo.py
127–129

It might be obviated by your suggestion. I think it's related to dispatching twice. I'll debug it more if we actually want to go this way.

phillco updated this revision to Diff 3348.Nov 8 2017, 12:33 PM
quark added inline comments.Nov 8 2017, 2:28 PM
hgext3rd/continue.py
7

Add the from __future__ import absolute_import here.

20

Use from . import conflicttinfo instead.

durham requested changes to this revision.Nov 9 2017, 11:37 AM
durham added a subscriber: durham.

Probably needs a test once it's not a POC

hgext3rd/conflictinfo.py
68

Is merge/state used in any case other than hg merge? I have this feeling it is? If so, update --clean could lose user data and I don't think it's necessarily clear that 'hg abort' would do that.

hgext3rd/continue.py
34

Can we print a message saying what we're continueing/aborting? Like "continuing rebase (via hg rebase --continue) ..." or "aborting merge (via hg update --clean) ...". That way users know what action is being continued and knows what actually happening so they can figure out how to undo it if necessary.

This revision now requires changes to proceed.Nov 9 2017, 11:37 AM
phillco added inline comments.Nov 9 2017, 12:15 PM
hgext3rd/conflictinfo.py
68

Yeh, that's fair. It's a shame merge (the command) doesn't have a distinct statefile from merge.update (the function). Since we don't need to support the hg merge case at FB, I'll just have it detect the merge state file and print something in that case.

phillco edited the summary of this revision. (Show Details)Dec 13 2017, 7:05 PM