wireproto: use named arguments for commandentry
authorGregory Szorc <gregory.szorc@gmail.com>
Tue, 27 Feb 2018 14:21:29 -0800
changeset 36535 1c16324fdf05
parent 36534 5faeabb07cf5
child 36536 3cd245945ef3
wireproto: use named arguments for commandentry We'll be adding more arguments in upcoming commits. Using named arguments will make the code easier to read. Differential Revision: https://phab.mercurial-scm.org/D2481
mercurial/wireproto.py
--- a/mercurial/wireproto.py	Mon Feb 26 18:01:13 2018 -0800
+++ b/mercurial/wireproto.py	Tue Feb 27 14:21:29 2018 -0800
@@ -604,7 +604,7 @@
         data not captured by the 2-tuple and a new instance containing
         the union of the two objects is returned.
         """
-        return commandentry(func, args)
+        return commandentry(func, args=args)
 
     # Old code treats instances as 2-tuples. So expose that interface.
     def __iter__(self):
@@ -640,7 +640,7 @@
             if k in self:
                 v = self[k]._merge(v[0], v[1])
             else:
-                v = commandentry(v[0], v[1])
+                v = commandentry(v[0], args=v[1])
         else:
             raise ValueError('command entries must be commandentry instances '
                              'or 2-tuples')
@@ -664,7 +664,7 @@
     accepts. ``*`` is a special value that says to accept all arguments.
     """
     def register(func):
-        commands[name] = commandentry(func, args)
+        commands[name] = commandentry(func, args=args)
         return func
     return register