This is an archive of the discontinued Mercurial Phabricator instance.

bundle2: move exception handling into part iterator
ClosedPublic

Authored by durham on Sep 13 2017, 8:38 PM.

Details

Summary

As part of separating the part iteration logic from the part handling logic,
let's move the exception handling to the part iterator class.

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

durham created this revision.Sep 13 2017, 8:38 PM
indygreg accepted this revision.Sep 13 2017, 11:28 PM
indygreg added a subscriber: indygreg.
indygreg added inline comments.
mercurial/bundle2.py
387

I'll fix the typo in flight.

This revision is now accepted and ready to land.Sep 13 2017, 11:28 PM
This revision was automatically updated to reflect the committed changes.
martinvonz added inline comments.
mercurial/bundle2.py
368

Doesn't look like this can actually happen (if used properly in a with-statement)

402

Looks like a small change in behavior here: the debug message below used to always be printed (before this patch and also before this series). Just pointing it out in case you didn't notice. I'll let you decide if it's worth restoring the message by putting it back in a finally-block.

This commit regressed the behavior of ^C during part application (ad41739c6b2b and issue 4784). Before, ^C would abort bundle2 application pretty quickly. Afterwards, it appears we now attempt I/O to seek to the end of the part (or something).

You can test this by running hg clone https://hg.mozilla.org/mozilla-unified and hitting ^C after some changesets are applied. If the process doesn't terminate right away and requires a 2nd ^C to terminate, the behavior is bad.