This is an archive of the discontinued Mercurial Phabricator instance.

exchange: return bundle info from getbundlechunks() (API)
ClosedPublic

Authored by indygreg on Jan 20 2018, 7:44 PM.

Details

Summary

We generally want a mechanism to pass information about the
generated bundle back to callers (in addition to the byte stream).
Ideally we would return a bundler from this function and have the
caller code to an interface. But the bundling APIs are not great
and getbundlechunks() is the best API we have for obtaining bundle
contents in a unified manner.

We change getbundlechunks() to return a dict that we can use to
communicate metadata.

We populate that dict with the bundle version number to demonstrate
some value.

.. api::

exchange.getbundlechunks() now returns a 2-tuple instead of just
an iterator.

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

indygreg created this revision.Jan 20 2018, 7:44 PM

Just an idea, instead of changing the return API of getbundlechunks, would it be possible of returning a (newly introduced) bundlechunks object which is also an iterator and where we could store such info?

Just an idea, instead of changing the return API of getbundlechunks, would it be possible of returning a (newly introduced) bundlechunks object which is also an iterator and where we could store such info?

Not a bad idea, but that's an idea for when we're not scrambling to get an rc out the door.

durin42 accepted this revision.Jan 22 2018, 3:04 PM
This revision is now accepted and ready to land.Jan 22 2018, 3:04 PM
This revision was automatically updated to reflect the committed changes.