From 5877b7bbef6b042aff331ff2c6961bb4dd4e644a Mon Sep 17 00:00:00 2001 From: Pierre-Yves David Date: Thu, 22 May 2014 01:49:12 -0700 Subject: [PATCH] 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. --- mercurial/wireproto.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py index fb4e388a2c..6bd2e5e046 100644 --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -619,9 +619,15 @@ def debugwireargs(repo, proto, one, two, others): 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)