This is an archive of the discontinued Mercurial Phabricator instance.

histedit: extract InterventionRequired transaction handling to utils
ClosedPublic

Authored by martinvonz on Jul 12 2017, 5:38 PM.

Details

Summary

rebase will have similar logic, so let's extract it. Besides, it makes
the histedit code more readable.

We may want to parametrize acceptintervention() by the exception(s)
that should result in transaction close.

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

martinvonz created this revision.Jul 12 2017, 5:38 PM
martinvonz updated this revision to Diff 100.Jul 12 2017, 7:58 PM

LGTM apart from the condition change

mercurial/util.py
599

The initial check was slighty more precise (if tr is not None), any specific reason for the change?

martinvonz added inline comments.Jul 13 2017, 12:05 PM
mercurial/util.py
599

We generally prefer "not X" over "is not None" when they're functionally equivalent (and I do think they are here).

durham accepted this revision.Jul 13 2017, 3:49 PM
durham added inline comments.
mercurial/util.py
594

Technically this will apply to dsguard as well, so 'tr' isn't quite precise. But I think it's better to use 'tr' than invent some third term.

martinvonz updated this revision to Diff 116.Jul 13 2017, 4:01 PM
This revision was automatically updated to reflect the committed changes.