This is an archive of the discontinued Mercurial Phabricator instance.

streamclone: new server config and some API changes for narrow stream clones
ClosedPublic

Authored by pulkit on Oct 17 2018, 10:52 AM.

Details

Summary

This patch introduces a new server config server.stream-narrow-clones which if
set to True will advertise that the server supports narrow stream clones.

This patch also pass on the includes and excludes from getbundle command to
streamclone generation code.

There is a test added to show that the includepats and excludepats are correctly
passed.

Upcoming patches will implement storage layer filtering for streamclones and
then we can remove the temporary error and plug in the whole logic together to
make narrow stream clones working.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Oct 17 2018, 10:52 AM

I'll hold off formally accepting until the whole series is up. But this looks pretty good.

We need to land this in 4.8 or less the client-side feature detection logic will require a new server capability (or a bump of the version of the capability string).

mercurial/configitems.py
1014

Perhaps we should mark this as experimental via an inline comment and forego documenting the config option for now?

I'll hold off formally accepting until the whole series is up. But this looks pretty good.
We need to land this in 4.8 or less the client-side feature detection logic will require a new server capability (or a bump of the version of the capability string).

The whole series is up now. Although this is important for us, I realize there is just 1 day left for the freeze and I won't push hard for getting this pushed in this cycle and will graft these csets if looks good. I know you are on a vacation, so thanks for taking time and reviewing.

There are no children reviews of this one. Could you please set the parent-child relationships so the entire stack renders in the web UI?

(I'm assuming there are commits that follow this one - an unimplemented narrow stream clone feature doesn't seem very useful!)

There are no children reviews of this one. Could you please set the parent-child relationships so the entire stack renders in the web UI?
(I'm assuming there are commits that follow this one - an unimplemented narrow stream clone feature doesn't seem very useful!)

Should be good now.

martinvonz added inline comments.
mercurial/configitems.py
1014

Makes sense, but I don't know how to do that, so I'll just rename it to experimental.server.stream-narrow-clones in flight (because we're close to the freeze)

martinvonz accepted this revision.Oct 17 2018, 6:50 PM
This revision is now accepted and ready to land.Oct 17 2018, 6:50 PM
martinvonz added inline comments.Oct 17 2018, 6:58 PM
mercurial/bundle2.py
1691–1692

I had to change these to kwargs.get() to get test-http.t and many others to pass. (I also fixed the typo in the comment above)

mercurial/help/config.txt
1851–1854

I removed this per indygreg's comment

mercurial/streamclone.py
549

I changed this to "server does not support narrow stream clones" to match the error from bundle2.

Btw, why is it raised in two places? Is the one in bundle2 that actually happens? Maybe this should be a ProgrammingError then?

tests/test-narrow-clone-stream.t
37

I changed this to "server does not support narrow stream clones" to match the actual output (test was failing)

This revision was automatically updated to reflect the committed changes.

@martinvonz many thanks for changing things in flight. Any reason why D5138 and D5139 are not considered during review because with them, you won't have to change much things except the config knob to experimental.