mercurial/sshrepo.py
changeset 13721 3458c15ab2f0
parent 13464 da0ddd62b9d8
child 13819 d16894e29f91
equal deleted inserted replaced
13720:9c4e04fe267e 13721:3458c15ab2f0
   117     __del__ = cleanup
   117     __del__ = cleanup
   118 
   118 
   119     def _callstream(self, cmd, **args):
   119     def _callstream(self, cmd, **args):
   120         self.ui.debug("sending %s command\n" % cmd)
   120         self.ui.debug("sending %s command\n" % cmd)
   121         self.pipeo.write("%s\n" % cmd)
   121         self.pipeo.write("%s\n" % cmd)
   122         for k, v in sorted(args.iteritems()):
   122         _func, names = wireproto.commands[cmd]
       
   123         keys = names.split()
       
   124         wireargs = {}
       
   125         for k in keys:
       
   126             if k == '*':
       
   127                 wireargs['*'] = args
       
   128                 break
       
   129             else:
       
   130                 wireargs[k] = args[k]
       
   131                 del args[k]
       
   132         for k, v in sorted(wireargs.iteritems()):
   123             self.pipeo.write("%s %d\n" % (k, len(v)))
   133             self.pipeo.write("%s %d\n" % (k, len(v)))
   124             self.pipeo.write(v)
   134             if isinstance(v, dict):
       
   135                 for dk, dv in v.iteritems():
       
   136                     self.pipeo.write("%s %d\n" % (dk, len(dv)))
       
   137                     self.pipeo.write(dv)
       
   138             else:
       
   139                 self.pipeo.write(v)
   125         self.pipeo.flush()
   140         self.pipeo.flush()
   126 
   141 
   127         return self.pipei
   142         return self.pipei
   128 
   143 
   129     def _call(self, cmd, **args):
   144     def _call(self, cmd, **args):