This is an archive of the discontinued Mercurial Phabricator instance.

infinitepush: add logic to add a stream level parameter to bundle2
ClosedPublic

Authored by pulkit on Dec 4 2017, 4:20 PM.
Tags
None
Subscribers
None

Details

Summary

The current method to check whether the bundle is a bundle2 push or not
introduces a new bundle2 part and we can only store changegroup using that part.

This patch introduces logic which will add a stream level parameter to bundle2,
reading whose value while unbundling, we can easily decide whether this bundle
is infinitepush bundle or not.
The stream level parameters are read before any of the parts and hence we can be
sured that we get to know whether this push if infinitepush or not before
processing any part.
This will also helps us in storing the whole bundle i.e. changegroup, bookmarks,
obsmarker etc. in the store.
The logic is currently hidden behind a config option.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

pulkit created this revision.Dec 4 2017, 4:20 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptDec 4 2017, 4:20 PM
durham accepted this revision.Dec 4 2017, 11:24 PM

Couple questions inline, but I'll push it once they're answered.

infinitepush/__init__.py
406

Since we don't use source, outgoing, or opts, I'd leave them as **kwargs and pass them along below as **kwargs

410

Hmm, shouldn't this only be added if the push is actually an infinitepush push? Or will that logic come later?

1247

ui.configbool instead of ui.config?

This revision is now accepted and ready to land.Dec 4 2017, 11:24 PM
pulkit updated this revision to Diff 4117.Dec 5 2017, 9:39 AM
pulkit marked 2 inline comments as done.Dec 5 2017, 9:42 AM
pulkit added inline comments.
infinitepush/__init__.py
410

Yes it should, I wanted to make sure I am heading in right direction so that's why for now I put this behind a config which defaults to False.

This revision was automatically updated to reflect the committed changes.
pulkit added inline comments.Dec 5 2017, 4:46 PM
infinitepush/__init__.py
968

@durham I see we are doing the same thing here. Does the logic for checking whether this push is an infinitepush or not is one in line 949-963? I am unable to find the bookmark pattern matching thing which you told me.

durham added inline comments.Dec 7 2017, 4:54 PM
infinitepush/__init__.py
968

Hmm, maybe you are right. Maybe it doesn't exist on the server side yet (it exists on the client side in this file in _scratchbranchmatcher). I guess we can just rely on this parameter for the first iteration, then to the automatic detection at a later point.