# HG changeset patch # User Pierre-Yves David # Date 2014-05-22 08:49:12 # Node ID 3cb2da25b1713b0da0fde70f6af312d7b7cf987b # Parent 4dca1a06e7ee6c7569d9c3f0b5885a4f068e52bc wireproto: expose the list of getbundle arguments to extensions For now, getbundle accepts a fixed number of arguments: ``heads``, ``common`` and ``bundlecaps``. We make this list exposed at the module level to let extensions add content there. This is important for extensions that wish to use bundle2 for other contents than changegroup. diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -619,9 +619,15 @@ def debugwireargs(repo, proto, one, two, opts = options('debugwireargs', ['three', 'four'], others) return repo.debugwireargs(one, two, **opts) +# List of options accepted by getbundle. +# +# Meant to be extended by extensions. It is the extension's responsibility to +# ensure such options are properly processed in exchange.getbundle. +gboptslist = ['heads', 'common', 'bundlecaps'] + @wireprotocommand('getbundle', '*') def getbundle(repo, proto, others): - opts = options('getbundle', ['heads', 'common', 'bundlecaps'], others) + opts = options('getbundle', gboptslist, others) for k, v in opts.iteritems(): if k in ('heads', 'common'): opts[k] = decodelist(v)