Mercurial > hg-stable
changeset 21615:3cb2da25b171 stable
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.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 22 May 2014 01:49:12 -0700 |
parents | 4dca1a06e7ee |
children | 9bafe09285f2 99ba1d082287 |
files | mercurial/wireproto.py |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/wireproto.py Wed May 07 17:24:19 2014 -0700 +++ b/mercurial/wireproto.py Thu May 22 01:49:12 2014 -0700 @@ -619,9 +619,15 @@ 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)