D4787: narrow: pass 'narrow_widen' as source while generating changegroup
This revision was automatically updated to reflect the committed changes. Closed by commit rHGfa2395659828: narrow: pass narrow_widen as source while generating changegroup (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4787?vs=11560=11567 REVISION DETAIL https://phab.mercurial-scm.org/D4787 AFFECTED FILES hgext/narrow/narrowbundle2.py CHANGE DETAILS diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py --- a/hgext/narrow/narrowbundle2.py +++ b/hgext/narrow/narrowbundle2.py @@ -51,16 +51,15 @@ caps[NARROWCAP] = ['v0'] return caps -def widen_bundle(repo, diffmatcher, common, known, cgversion, source, ellipses): +def widen_bundle(repo, diffmatcher, common, known, cgversion, ellipses): """generates changegroup for widening a narrow clone repo is the localrepository instance diffmatcher is a differencemacther of '(newincludes, newexcludes) - (oldincludes, oldexcludes)' common is set of common revs between server and client known is a set of revs known on the client side (used in ellipses) cgversion is the changegroup version to send -source is the command which called this codepath ellipses is boolean value telling whether to send ellipses data or not returns changegroup data of the changegroup built or return None if there @@ -80,7 +79,7 @@ filematcher=diffmatcher, fullnodes=commonnodes) cgdata = packer.generate(set([nullid]), list(commonnodes), False, - source, changelog=False) + 'narrow_widen', changelog=False) return cgdata @@ -114,8 +113,7 @@ common = set(common or [nullid]) if (oldinclude != include or oldexclude != exclude): -cgdata = widen_bundle(repo, diffmatch, common, [], version, - source, False) +cgdata = widen_bundle(repo, diffmatch, common, [], version, False) if cgdata is not None: part = bundler.newpart('changegroup', data=cgdata) part.addparam('version', version) @@ -194,7 +192,7 @@ shallow=depth is not None, ellipsisroots=newellipsis, fullnodes=newfull) -cgdata = packer.generate(common, newvisit, False, source) +cgdata = packer.generate(common, newvisit, False, 'narrow_widen') part = bundler.newpart('changegroup', data=cgdata) part.addparam('version', version) @@ -212,7 +210,7 @@ shallow=depth is not None, ellipsisroots=ellipsisroots, fullnodes=relevant_nodes) -cgdata = packer.generate(common, visitnodes, False, source) +cgdata = packer.generate(common, visitnodes, False, 'narrow_widen') part = bundler.newpart('changegroup', data=cgdata) part.addparam('version', version) To: pulkit, durin42, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D4787: narrow: pass 'narrow_widen' as source while generating changegroup
pulkit updated this revision to Diff 11560. Herald added a reviewer: martinvonz. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4787?vs=11470=11560 REVISION DETAIL https://phab.mercurial-scm.org/D4787 AFFECTED FILES hgext/narrow/narrowbundle2.py CHANGE DETAILS diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py --- a/hgext/narrow/narrowbundle2.py +++ b/hgext/narrow/narrowbundle2.py @@ -51,16 +51,15 @@ caps[NARROWCAP] = ['v0'] return caps -def widen_bundle(repo, diffmatcher, common, known, cgversion, source, ellipses): +def widen_bundle(repo, diffmatcher, common, known, cgversion, ellipses): """generates changegroup for widening a narrow clone repo is the localrepository instance diffmatcher is a differencemacther of '(newincludes, newexcludes) - (oldincludes, oldexcludes)' common is set of common revs between server and client known is a set of revs known on the client side (used in ellipses) cgversion is the changegroup version to send -source is the command which called this codepath ellipses is boolean value telling whether to send ellipses data or not returns changegroup data of the changegroup built or return None if there @@ -80,7 +79,7 @@ filematcher=diffmatcher, fullnodes=commonnodes) cgdata = packer.generate(set([nullid]), list(commonnodes), False, - source, changelog=False) + 'narrow_widen', changelog=False) return cgdata @@ -114,8 +113,7 @@ common = set(common or [nullid]) if (oldinclude != include or oldexclude != exclude): -cgdata = widen_bundle(repo, diffmatch, common, [], version, - source, False) +cgdata = widen_bundle(repo, diffmatch, common, [], version, False) if cgdata is not None: part = bundler.newpart('changegroup', data=cgdata) part.addparam('version', version) @@ -194,7 +192,7 @@ shallow=depth is not None, ellipsisroots=newellipsis, fullnodes=newfull) -cgdata = packer.generate(common, newvisit, False, source) +cgdata = packer.generate(common, newvisit, False, 'narrow_widen') part = bundler.newpart('changegroup', data=cgdata) part.addparam('version', version) @@ -212,7 +210,7 @@ shallow=depth is not None, ellipsisroots=ellipsisroots, fullnodes=relevant_nodes) -cgdata = packer.generate(common, visitnodes, False, source) +cgdata = packer.generate(common, visitnodes, False, 'narrow_widen') part = bundler.newpart('changegroup', data=cgdata) part.addparam('version', version) To: pulkit, durin42, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D4787: narrow: pass 'narrow_widen' as source while generating changegroup
pulkit added a comment. In https://phab.mercurial-scm.org/D4787#72712, @martinvonz wrote: > > 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! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D4787 To: pulkit, durin42, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D4787: narrow: pass 'narrow_widen' as source while generating changegroup
martinvonz added a comment. > 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). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D4787 To: pulkit, durin42, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D4787: narrow: pass 'narrow_widen' as source while generating changegroup
pulkit created this revision. Herald added a reviewer: durin42. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 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. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D4787 AFFECTED FILES hgext/narrow/narrowbundle2.py CHANGE DETAILS diff --git a/hgext/narrow/narrowbundle2.py b/hgext/narrow/narrowbundle2.py --- a/hgext/narrow/narrowbundle2.py +++ b/hgext/narrow/narrowbundle2.py @@ -51,15 +51,14 @@ caps[NARROWCAP] = ['v0'] return caps -def widen_changegroup(repo, diffmatcher, common, cgversion, source): +def widen_changegroup(repo, diffmatcher, common, cgversion): """generates changegroup for widening a narrow clone repo is the localrepository instance diffmatcher is a differencemacther of '(newincludes, newexcludes) - (oldincludes, oldexcludes)' common is set of common revs between server and client cgversion is the changegroup version to send -source is the command which called this codepath returns changegroup data of the changegroup built or return None if there are no common revs @@ -76,7 +75,7 @@ filematcher=diffmatcher, fullnodes=commonnodes) cgdata = packer.generate(set([nullid]), list(commonnodes), False, - source, changelog=False) + 'narrow_widen', changelog=False) return cgdata @@ -110,7 +109,7 @@ common = set(common or [nullid]) if (oldinclude != include or oldexclude != exclude): -cgdata = widen_changegroup(repo, diffmatch, common, version, source) +cgdata = widen_changegroup(repo, diffmatch, common, version) if cgdata is not None: part = bundler.newpart('changegroup', data=cgdata) part.addparam('version', version) @@ -189,7 +188,7 @@ shallow=depth is not None, ellipsisroots=newellipsis, fullnodes=newfull) -cgdata = packer.generate(common, newvisit, False, source) +cgdata = packer.generate(common, newvisit, False, 'narrow_widen') part = bundler.newpart('changegroup', data=cgdata) part.addparam('version', version) @@ -207,7 +206,7 @@ shallow=depth is not None, ellipsisroots=ellipsisroots, fullnodes=relevant_nodes) -cgdata = packer.generate(common, visitnodes, False, source) +cgdata = packer.generate(common, visitnodes, False, 'narrow_widen') part = bundler.newpart('changegroup', data=cgdata) part.addparam('version', version) To: pulkit, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel