getbundle: raise error if extra arguments are provided for bundle10
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 29 May 2014 14:59:22 -0700
changeset 21656 36200dc6b3bd
parent 21655 35095f332846
child 21657 0ff44e06275d
getbundle: raise error if extra arguments are provided for bundle10 New arguments are most likely to be supported by bundle20 (and above) only.
mercurial/exchange.py
--- a/mercurial/exchange.py	Tue May 27 15:42:03 2014 -0700
+++ b/mercurial/exchange.py	Thu May 29 14:59:22 2014 -0700
@@ -664,6 +664,9 @@
     cg = changegroup.getbundle(repo, source, heads=heads,
                                common=common, bundlecaps=bundlecaps)
     if bundlecaps is None or 'HG2X' not in bundlecaps:
+        if kwargs:
+            raise ValueError(_('unsupported getbundle arguments: %s')
+                             % ', '.join(sorted(kwargs.keys())))
         return cg
     # very crude first implementation,
     # the bundle API will change and the generation will be done lazily.