[PATCH 01 of 18 helps-py3] wireproto: remove todict() and use {} literals instead

Augie Fackler raf at durin42.com
Wed Mar 12 17:40:35 UTC 2014


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1394643651 14400
#      Wed Mar 12 13:00:51 2014 -0400
# Node ID 5442cab57b09e589e461ca27f54274f0cb503665
# Parent  0084fcd5d7e25d26662bb261d1bf64489882b440
wireproto: remove todict() and use {} literals instead

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -145,9 +145,6 @@
 
 # client side
 
-def todict(**args):
-    return args
-
 class wirepeer(peer.peerrepository):
 
     def batch(self):
@@ -166,7 +163,7 @@
     def lookup(self, key):
         self.requirecap('lookup', _('look up remote revision'))
         f = future()
-        yield todict(key=encoding.fromlocal(key)), f
+        yield {'key': encoding.fromlocal(key)}, f
         d = f.value
         success, data = d[:-1].split(" ", 1)
         if int(success):
@@ -186,7 +183,7 @@
     @batchable
     def known(self, nodes):
         f = future()
-        yield todict(nodes=encodelist(nodes)), f
+        yield {'nodes': encodelist(nodes)}, f
         d = f.value
         try:
             yield [bool(int(f)) for f in d]
@@ -236,10 +233,10 @@
             yield False, None
         f = future()
         self.ui.debug('preparing pushkey for "%s:%s"\n' % (namespace, key))
-        yield todict(namespace=encoding.fromlocal(namespace),
-                     key=encoding.fromlocal(key),
-                     old=encoding.fromlocal(old),
-                     new=encoding.fromlocal(new)), f
+        yield {'namespace': encoding.fromlocal(namespace),
+               'key': encoding.fromlocal(key),
+               'old': encoding.fromlocal(old),
+               'new': encoding.fromlocal(new)}, f
         d = f.value
         d, output = d.split('\n', 1)
         try:
@@ -257,7 +254,7 @@
             yield {}, None
         f = future()
         self.ui.debug('preparing listkeys for "%s"\n' % namespace)
-        yield todict(namespace=encoding.fromlocal(namespace)), f
+        yield {'namespace': encoding.fromlocal(namespace)}, f
         d = f.value
         r = {}
         for l in d.splitlines():


More information about the Mercurial-devel mailing list