( )⚙ D1174 fold: use context manager for locks and transaction

This is an archive of the discontinued Mercurial Phabricator instance.

fold: use context manager for locks and transaction
ClosedPublic

Authored by pulkit on Oct 17 2017, 8:14 PM.
Tags
None
Subscribers

Details

Diff Detail

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

Event Timeline

pulkit created this revision.Oct 17 2017, 8:14 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptOct 17 2017, 8:14 PM
mjpieters requested changes to this revision.Oct 19 2017, 9:46 AM
mjpieters added a subscriber: mjpieters.
mjpieters added inline comments.
hgext3rd/fbamend/fold.py
110–111

This swaps the order of the transaction being entered and the foldcheck being done. I suspect this order matters. Creating a transaction is certainly quite involved, if the foldcheck fails we can avoid all that cost.

Please add a separate with repo.transaction('fold') as tr: after the _foldcheck(...) line.

This revision now requires changes to proceed.Oct 19 2017, 9:46 AM
pulkit added inline comments.Oct 19 2017, 7:49 PM
hgext3rd/fbamend/fold.py
110–111

Macro goodcatch:

pulkit updated this revision to Diff 3138.Oct 27 2017, 6:04 PM
durham accepted this revision.Oct 31 2017, 1:02 PM
This revision was automatically updated to reflect the committed changes.