This is an archive of the discontinued Mercurial Phabricator instance.

undo: adds -f flag and gap edge case handling
ClosedPublic

Authored by felixmerk on Jul 11 2017, 5:56 PM.
Tags
None
Subscribers

Details

Reviewers
quark
Group Reviewers
Restricted Project
Commits
rFBHGXfae05e8c1972: undo: adds -f flag and gap edge case handling
Summary

Prevents users from accidentally crossing gaps in their history and adds an
overwride. In most cases undoing across a gap isn't desired as the connection
between the pre and post states is unkown. While undoing across a gap is not
destructive or inherently risky, it is inherently confusing to the user since
we don't know how many and what commands where run. Furthermore, there is no
guarantee that the pre and post states of a gap are actually connected in any
sane way.

Diff Detail

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

Event Timeline

felixmerk created this revision.Jul 11 2017, 5:56 PM
felixmerk added a reviewer: Restricted Project.Jul 11 2017, 6:04 PM
stash added a subscriber: stash.Jul 12 2017, 9:37 AM
stash added inline comments.
hgext3rd/undo.py
85

This function is introduced in parent diff is not used there. Can you move this function in the parent diff?

felixmerk updated this revision to Diff 107.Jul 13 2017, 12:41 AM
felixmerk added inline comments.Jul 13 2017, 12:46 AM
hgext3rd/undo.py
85

Good catch. I'll actually move the call to the parent diff since thats where it belongs.

felixmerk updated this revision to Diff 212.Jul 17 2017, 3:09 PM
felixmerk updated this revision to Diff 316.Jul 19 2017, 5:31 PM
quark accepted this revision.Jul 19 2017, 6:19 PM
quark added a subscriber: quark.

The feature looks good. Some end-user facing text could be improved. But we can revisit them later.

hgext3rd/undo.py
365

What does "in memory" mean here?

402

The text is shown to end-users (hg undo -h). I think implementation details like "a blank command" might be unfriendly to them.

I'd just focus on what end-users care about and keep it short, like:

If the undo extension was turned off then turned on, you might lose the ability to undo to certain states.
This revision is now accepted and ready to land.Jul 19 2017, 6:19 PM
felixmerk updated this revision to Diff 324.Jul 19 2017, 8:45 PM
This revision was automatically updated to reflect the committed changes.