This is an archive of the discontinued Mercurial Phabricator instance.

narrow: pass 'narrow_widen' as source while generating changegroup
ClosedPublic

Authored by pulkit on Sep 28 2018, 4:58 PM.

Details

Summary

Extensions inspect the source parameter and add some custom logic on the basis
of value of that parameter. The parameter is also passed to hooks. So let's pass
the value as 'narrow_widen' to differentiate widening from pull.

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

pulkit created this revision.Sep 28 2018, 4:58 PM

Although this is called as a part of exchange.pull(), we don't want other
extensions to wrap this pull call because it's not a normal pull and it's
widening.

I don't follow this. How does this prevent extensions from wrapping the pull? Do you mean that extensions that inspect the source parameter should not treat it like a normal pull? The source parameter also seems to be passed to hooks, btw (it probably makes sense to differentiate widening from pulling there too).

Although this is called as a part of exchange.pull(), we don't want other
extensions to wrap this pull call because it's not a normal pull and it's
widening.

I don't follow this. How does this prevent extensions from wrapping the pull? Do you mean that extensions that inspect the source parameter should not treat it like a normal pull? The source parameter also seems to be passed to hooks, btw (it probably makes sense to differentiate widening from pulling there too).

Yes, I looked into the code where source parameter is used and it says the extension requires it. I think wrapping pull sounds to generic, I will improve the commit description. Thanks!

pulkit edited the summary of this revision. (Show Details)Oct 1 2018, 12:01 PM
pulkit updated this revision to Diff 11560.Oct 2 2018, 10:19 AM
martinvonz accepted this revision.Oct 2 2018, 12:12 PM
This revision is now accepted and ready to land.Oct 2 2018, 12:12 PM
This revision was automatically updated to reflect the committed changes.