diff --git a/infinitepush/__init__.py b/infinitepush/__init__.py --- a/infinitepush/__init__.py +++ b/infinitepush/__init__.py @@ -318,6 +318,7 @@ wrapcommand(commands.table, 'update', _update) wrapfunction(discovery, 'checkheads', _checkheads) + wrapfunction(bundle2, '_addpartsfromopts', __addpartsfromopts) wireproto.wirepeer.listkeyspatterns = listkeyspatterns @@ -401,6 +402,13 @@ return return orig(pushop) +def __addpartsfromopts(orig, ui, repo, bundler, source, outgoing, opts): + """ adds a stream level part to bundle2 storing whether this is an + infinitepush bundle or not """ + if ui.config('infinitepush', 'bundle-stream', False): + bundler.addparam('infinitepush', True) + return orig(ui, repo, bundler, source, outgoing, opts) + def wireprotolistkeyspatterns(repo, proto, namespace, patterns): patterns = decodelist(patterns) d = repo.listkeys(encoding.tolocal(namespace), patterns).iteritems() @@ -1226,6 +1234,13 @@ 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.config('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 (str) undocumented: morestatus.show (bool) undocumented: nointerrupt.interactiveonly (bool) [True] undocumented: perftweaks.cachenoderevs (bool) [True]