This is an archive of the discontinued Mercurial Phabricator instance.

bundle2: always advertise client support for stream parts
ClosedPublic

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

Details

Summary

Previously, enabling of stream clone over bundle2 was a server-side
only change. And clients would only advertise bundle2 support for
stream clones if an experimental config option was set.

This situation wasn't forward compatible because in the future
(when the feature is enabled on servers by default), an old client
would send a request to the server but it wouldn't send its own
bundle2 capability support for stream parts. Servers would have to
infer that clients not sending this capability were old Mercurial
clients that only sent the capability if the feature was
explicitly enabled. Implicit and inferred behavior makes implementing
servers hard. It's much better to be explicit about client features.

We should either make the config option for bundle2 stream clones
disable the feature client-side as well (so a server doesn't see
a request from a client not advertising stream support). Or we
should always advertise stream support if a client is willing
to accept stream parts.

Since I anticipating stabilizing stream clone support in bundle2
quickly, I think it's safe to always advertise client support
in the bundle2 capabilities. So this commit changes things to
do that.

Because capabilities now vary between client and server, we had
to create variations of the variable substitutions for those
strings.

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:51 PM

This patch seems to contain two changes:

  • Introduce new common patterns $USUAL_BUNDLE_CAPS_SERVER$ and $USUAL_BUNDLE2_CAPS_SERVER$ with all the changes in the tests.
  • Make the client always advertise for the streaming capability.

Would it be possible to split the changes to make it easier to graft them separately? It is important for people who need to backport important features from one version to older ones.

This patch seems to contain two changes:

  • Introduce new common patterns $USUAL_BUNDLE_CAPS_SERVER$ and $USUAL_BUNDLE2_CAPS_SERVER$ with all the changes in the tests.
  • Make the client always advertise for the streaming capability.

Would it be possible to split the changes to make it easier to graft them separately? It is important for people who need to backport important features from one version to older ones.

I'm not sure. The test harness automagically does the string to variable substitution. If we have multiple variables referring to the same source string, I think that may confuse the test harness.

indygreg updated this revision to Diff 4989.Jan 22 2018, 3:32 PM
durin42 accepted this revision.Jan 22 2018, 4:10 PM
This revision is now accepted and ready to land.Jan 22 2018, 4:10 PM
This revision was automatically updated to reflect the committed changes.