commandserver: use _readlist
authorJun Wu <quark@fb.com>
Mon, 15 Feb 2016 14:20:41 +0000
changeset 28157 e7c9b59dbbcf
parent 28156 75f586a1bf55
child 28158 7cc57a531f0c
commandserver: use _readlist Use _readlist introduced in previous commit to make the code shorter.
mercurial/commandserver.py
--- a/mercurial/commandserver.py	Tue Feb 16 19:11:45 2016 +0000
+++ b/mercurial/commandserver.py	Mon Feb 15 14:20:41 2016 +0000
@@ -214,11 +214,7 @@
         and writes the return code to the result channel """
         from . import dispatch  # avoid cycle
 
-        length = struct.unpack('>I', self._read(4))[0]
-        if not length:
-            args = []
-        else:
-            args = self._read(length).split('\0')
+        args = self._readlist()
 
         # copy the uis so changes (e.g. --config or --verbose) don't
         # persist between requests