comparison mercurial/commandserver.py @ 28157:e7c9b59dbbcf

commandserver: use _readlist Use _readlist introduced in previous commit to make the code shorter.
author Jun Wu <quark@fb.com>
date Mon, 15 Feb 2016 14:20:41 +0000
parents 75f586a1bf55
children ff5f923fca3c
comparison
equal deleted inserted replaced
28156:75f586a1bf55 28157:e7c9b59dbbcf
212 def runcommand(self): 212 def runcommand(self):
213 """ reads a list of \0 terminated arguments, executes 213 """ reads a list of \0 terminated arguments, executes
214 and writes the return code to the result channel """ 214 and writes the return code to the result channel """
215 from . import dispatch # avoid cycle 215 from . import dispatch # avoid cycle
216 216
217 length = struct.unpack('>I', self._read(4))[0] 217 args = self._readlist()
218 if not length:
219 args = []
220 else:
221 args = self._read(length).split('\0')
222 218
223 # copy the uis so changes (e.g. --config or --verbose) don't 219 # copy the uis so changes (e.g. --config or --verbose) don't
224 # persist between requests 220 # persist between requests
225 copiedui = self.ui.copy() 221 copiedui = self.ui.copy()
226 uis = [copiedui] 222 uis = [copiedui]