diff --git a/infinitepush/__init__.py b/infinitepush/__init__.py --- a/infinitepush/__init__.py +++ b/infinitepush/__init__.py @@ -319,6 +319,7 @@ wrapcommand(commands.table, 'update', _update) wrapfunction(discovery, 'checkheads', _checkheads) + wrapfunction(bundle2, '_addpartsfromopts', _addpartsfromopts) wireproto.wirepeer.listkeyspatterns = listkeyspatterns @@ -402,6 +403,13 @@ return return orig(pushop) +def _addpartsfromopts(orig, ui, repo, bundler, *args, **kwargs): + """ adds a stream level part to bundle2 storing whether this is an + infinitepush bundle or not """ + if ui.configbool('infinitepush', 'bundle-stream', False): + bundler.addparam('infinitepush', True) + return orig(ui, repo, bundler, *args, **kwargs) + def wireprotolistkeyspatterns(repo, proto, namespace, patterns): patterns = decodelist(patterns) d = repo.listkeys(encoding.tolocal(namespace), patterns).iteritems() @@ -1232,6 +1240,14 @@ if bundle: bundle.close() +@bundle2.b2streamparamhandler('infinitepush') +def processinfinitepush(unbundler, param, value): + """ process the bundle2 stream level parameter containing whether this push + is an infinitepush or not. """ + if value and unbundler.ui.configbool('infinitepush', + 'bundle-stream', False): + pass + @bundle2.parthandler(scratchbranchparttype, ('bookmark', 'bookprevnode' 'create', 'force', 'pushbackbookmarks', 'cgversion')) diff --git a/tests/test-check-config-hg.t b/tests/test-check-config-hg.t --- a/tests/test-check-config-hg.t +++ b/tests/test-check-config-hg.t @@ -36,6 +36,7 @@ undocumented: fbconduit.reponame (str) undocumented: fbhistedit.exec_in_user_shell (str) undocumented: grep.command (str) + undocumented: infinitepush.bundle-stream (bool) undocumented: morestatus.show (bool) undocumented: nointerrupt.interactiveonly (bool) [True] undocumented: perftweaks.cachenoderevs (bool) [True]