equal
deleted
inserted
replaced
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): |