mercurial/wireproto.py
changeset 33764 297d1b70685c
parent 33499 0407a51b9d8c
child 33765 e2fc2122029c
--- a/mercurial/wireproto.py	Wed Aug 09 21:04:03 2017 -0700
+++ b/mercurial/wireproto.py	Wed Aug 09 21:51:45 2017 -0700
@@ -120,9 +120,13 @@
         self._remote = remote
 
     def __getattr__(self, name):
-        if not getattr(self._remote, name, False):
-            raise AttributeError(
-                'Attempted to iterbatch non-batchable call to %r' % name)
+        # Validate this method is batchable, since submit() only supports
+        # batchable methods.
+        fn = getattr(self._remote, name)
+        if not getattr(fn, 'batchable', None):
+            raise error.ProgrammingError('Attempted to batch a non-batchable '
+                                         'call to %r' % name)
+
         return super(remoteiterbatcher, self).__getattr__(name)
 
     def submit(self):