This is an archive of the discontinued Mercurial Phabricator instance.

abort: added support for histedit
ClosedPublic

Authored by taapas1128 on Jun 27 2019, 3:14 PM.

Details

Summary

This patch adds the support for histedit in hg abort plan.

As seperate hgaborthistedit() function is created to handle
independent calls for abortion of histedit. This function is
then registered as abortfunc for state detection API.

hg abort in case of histedit also supports history-editing-backup
config option.

Results are shown as tests.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

taapas1128 created this revision.Jun 27 2019, 3:14 PM
taapas1128 updated this revision to Diff 15735.Jul 1 2019, 5:51 PM
pulkit added a subscriber: pulkit.Jul 2 2019, 5:45 PM
pulkit added inline comments.
hgext/histedit.py
1922

you need to set locks for the state too. Refer line 1685 in this file.

taapas1128 edited the summary of this revision. (Show Details)Jul 3 2019, 7:02 PM
taapas1128 updated this revision to Diff 15754.
taapas1128 marked an inline comment as done.Jul 3 2019, 7:08 PM
taapas1128 updated this revision to Diff 15769.Jul 4 2019, 5:07 PM
taapas1128 updated this revision to Diff 15782.Jul 6 2019, 2:55 PM

Looking closely, the backup value comes from reading ui.configbool('rewrite', 'backup-bundle') instead of a --no-backup flag. It means we can get rid of the --backup flag to hg abort as there exists no such flag for histedit.

@pulkit Yeah I know that but look at D3965. histedit once did support --no-backup flag. It was dropped off for a different reason.

@pulkit Yeah I know that but look at D3965. histedit once did support --no-backup flag. It was dropped off for a different reason.

Yeah, so we should respect the config option and not re-introduce the flag.

Okay I will do that. So should I remove --no-backup flag altogether from this series of patches because none of the commands support --no-backup then.

Okay I will do that. So should I remove --no-backup flag altogether from this series of patches because none of the commands support --no-backup then.

Yes please remove. Also it will be nice if you fold all the abort related patches into one except D6608.

taapas1128 edited the summary of this revision. (Show Details)Jul 8 2019, 2:18 PM
taapas1128 updated this revision to Diff 15807.
taapas1128 edited the summary of this revision. (Show Details)Jul 9 2019, 8:25 AM
taapas1128 updated this revision to Diff 15834.
pulkit accepted this revision.Jul 10 2019, 8:43 AM
pulkit added inline comments.
tests/test-histedit-no-backup.t
63 ↗(On Diff #15834)

Unwanted new line change, will drop it in flight.

This revision is now accepted and ready to land.Jul 10 2019, 8:43 AM
This revision was automatically updated to reflect the committed changes.