146 <p> |
146 <p> |
147 Constructor |
147 Constructor |
148 </p> |
148 </p> |
149 <dl> |
149 <dl> |
150 |
150 |
151 <dt><i>repoPath</i></dt> |
151 <dt><i>repoPath</i> (str)</dt> |
152 <dd> |
152 <dd> |
153 root directory of the repository (string) |
153 root directory of the repository |
154 </dd> |
154 </dd> |
155 <dt><i>encoding</i></dt> |
155 <dt><i>encoding</i> (str)</dt> |
156 <dd> |
156 <dd> |
157 encoding to be used by the command server (string) |
157 encoding to be used by the command server |
158 </dd> |
158 </dd> |
159 <dt><i>vcs</i></dt> |
159 <dt><i>vcs</i> (Hg)</dt> |
160 <dd> |
160 <dd> |
161 reference to the VCS object (Hg) |
161 reference to the VCS object |
162 </dd> |
162 </dd> |
163 <dt><i>parent</i></dt> |
163 <dt><i>parent</i> (QObject)</dt> |
164 <dd> |
164 <dd> |
165 reference to the parent object (QObject) |
165 reference to the parent object |
166 </dd> |
166 </dd> |
167 </dl> |
167 </dl> |
168 <a NAME="HgClient.__prompt" ID="HgClient.__prompt"></a> |
168 <a NAME="HgClient.__prompt" ID="HgClient.__prompt"></a> |
169 <h4>HgClient.__prompt</h4> |
169 <h4>HgClient.__prompt</h4> |
170 <b>__prompt</b>(<i>size, message</i>) |
170 <b>__prompt</b>(<i>size, message</i>) |
172 <p> |
172 <p> |
173 Private method to prompt the user for some input. |
173 Private method to prompt the user for some input. |
174 </p> |
174 </p> |
175 <dl> |
175 <dl> |
176 |
176 |
177 <dt><i>size</i></dt> |
177 <dt><i>size</i> (int)</dt> |
178 <dd> |
178 <dd> |
179 maximum length of the requested input (integer) |
179 maximum length of the requested input |
180 </dd> |
180 </dd> |
181 <dt><i>message</i></dt> |
181 <dt><i>message</i> (str)</dt> |
182 <dd> |
182 <dd> |
183 message sent by the server (string) |
183 message sent by the server |
184 </dd> |
184 </dd> |
185 </dl> |
185 </dl> |
186 <dl> |
186 <dl> |
187 <dt>Returns:</dt> |
187 <dt>Returns:</dt> |
188 <dd> |
188 <dd> |
189 data entered by the user (string) |
189 tuple containing data entered by the user and |
|
190 a flag indicating a password input |
|
191 </dd> |
|
192 </dl> |
|
193 <dl> |
|
194 <dt>Return Type:</dt> |
|
195 <dd> |
|
196 tuple of (str, bool) |
190 </dd> |
197 </dd> |
191 </dl> |
198 </dl> |
192 <a NAME="HgClient.__readChannel" ID="HgClient.__readChannel"></a> |
199 <a NAME="HgClient.__readChannel" ID="HgClient.__readChannel"></a> |
193 <h4>HgClient.__readChannel</h4> |
200 <h4>HgClient.__readChannel</h4> |
194 <b>__readChannel</b>(<i></i>) |
201 <b>__readChannel</b>(<i></i>) |
198 </p> |
205 </p> |
199 <dl> |
206 <dl> |
200 <dt>Returns:</dt> |
207 <dt>Returns:</dt> |
201 <dd> |
208 <dd> |
202 tuple of channel designator and channel data |
209 tuple of channel designator and channel data |
203 (string, integer or string or bytes) |
210 </dd> |
|
211 </dl> |
|
212 <dl> |
|
213 <dt>Return Type:</dt> |
|
214 <dd> |
|
215 tuple of (str, int or str or bytes) |
204 </dd> |
216 </dd> |
205 </dl> |
217 </dl> |
206 <a NAME="HgClient.__readHello" ID="HgClient.__readHello"></a> |
218 <a NAME="HgClient.__readHello" ID="HgClient.__readHello"></a> |
207 <h4>HgClient.__readHello</h4> |
219 <h4>HgClient.__readHello</h4> |
208 <b>__readHello</b>(<i></i>) |
220 <b>__readHello</b>(<i></i>) |
211 Private method to read the hello message sent by the command server. |
223 Private method to read the hello message sent by the command server. |
212 </p> |
224 </p> |
213 <dl> |
225 <dl> |
214 <dt>Returns:</dt> |
226 <dt>Returns:</dt> |
215 <dd> |
227 <dd> |
216 tuple of flag indicating success (boolean) and an error message |
228 tuple of flag indicating success and an error message in case |
217 in case of failure (string) |
229 of failure |
|
230 </dd> |
|
231 </dl> |
|
232 <dl> |
|
233 <dt>Return Type:</dt> |
|
234 <dd> |
|
235 tuple of (bool, str) |
218 </dd> |
236 </dd> |
219 </dl> |
237 </dl> |
220 <a NAME="HgClient.__runcommand" ID="HgClient.__runcommand"></a> |
238 <a NAME="HgClient.__runcommand" ID="HgClient.__runcommand"></a> |
221 <h4>HgClient.__runcommand</h4> |
239 <h4>HgClient.__runcommand</h4> |
222 <b>__runcommand</b>(<i>args, inputChannels, outputChannels</i>) |
240 <b>__runcommand</b>(<i>args, inputChannels, outputChannels</i>) |
224 <p> |
242 <p> |
225 Private method to run a command in the server (low level). |
243 Private method to run a command in the server (low level). |
226 </p> |
244 </p> |
227 <dl> |
245 <dl> |
228 |
246 |
229 <dt><i>args</i></dt> |
247 <dt><i>args</i> (list of str)</dt> |
230 <dd> |
248 <dd> |
231 list of arguments for the command (list of string) |
249 list of arguments for the command |
232 </dd> |
250 </dd> |
233 <dt><i>inputChannels</i></dt> |
251 <dt><i>inputChannels</i> (dict)</dt> |
234 <dd> |
252 <dd> |
235 dictionary of input channels. The dictionary must |
253 dictionary of input channels. The dictionary must |
236 have the keys 'I' and 'L' and each entry must be a function |
254 have the keys 'I' and 'L' and each entry must be a function |
237 receiving the number of bytes to write. |
255 receiving the number of bytes to write. |
238 </dd> |
256 </dd> |
239 <dt><i>outputChannels</i></dt> |
257 <dt><i>outputChannels</i> (dict)</dt> |
240 <dd> |
258 <dd> |
241 dictionary of output channels. The dictionary |
259 dictionary of output channels. The dictionary |
242 must have the keys 'o' and 'e' and each entry must be a function |
260 must have the keys 'o' and 'e' and each entry must be a function |
243 receiving the data. |
261 receiving the data. |
244 </dd> |
262 </dd> |
245 </dl> |
263 </dl> |
246 <dl> |
264 <dl> |
247 <dt>Returns:</dt> |
265 <dt>Returns:</dt> |
248 <dd> |
266 <dd> |
249 result code of the command, -1 if the command server wasn't |
267 result code of the command, -1 if the command server wasn't |
250 started or -10, if the command was canceled (integer) |
268 started or -10, if the command was canceled |
|
269 </dd> |
|
270 </dl> |
|
271 <dl> |
|
272 <dt>Return Type:</dt> |
|
273 <dd> |
|
274 int |
251 </dd> |
275 </dd> |
252 </dl> |
276 </dl> |
253 <dl> |
277 <dl> |
254 |
278 |
255 <dt>Raises <b>RuntimeError</b>:</dt> |
279 <dt>Raises <b>RuntimeError</b>:</dt> |
265 <p> |
289 <p> |
266 Private slot connected to the finished signal. |
290 Private slot connected to the finished signal. |
267 </p> |
291 </p> |
268 <dl> |
292 <dl> |
269 |
293 |
270 <dt><i>exitCode</i></dt> |
294 <dt><i>exitCode</i> (int)</dt> |
271 <dd> |
295 <dd> |
272 exit code of the process (integer) |
296 exit code of the process |
273 </dd> |
297 </dd> |
274 <dt><i>exitStatus</i></dt> |
298 <dt><i>exitStatus</i> (QProcess.ExitStatus)</dt> |
275 <dd> |
299 <dd> |
276 exit status of the process (QProcess.ExitStatus) |
300 exit status of the process |
277 </dd> |
301 </dd> |
278 </dl> |
302 </dl> |
279 <a NAME="HgClient.__writeDataBlock" ID="HgClient.__writeDataBlock"></a> |
303 <a NAME="HgClient.__writeDataBlock" ID="HgClient.__writeDataBlock"></a> |
280 <h4>HgClient.__writeDataBlock</h4> |
304 <h4>HgClient.__writeDataBlock</h4> |
281 <b>__writeDataBlock</b>(<i>data</i>) |
305 <b>__writeDataBlock</b>(<i>data</i>) |
309 Public method to check, if the server is executing a command. |
333 Public method to check, if the server is executing a command. |
310 </p> |
334 </p> |
311 <dl> |
335 <dl> |
312 <dt>Returns:</dt> |
336 <dt>Returns:</dt> |
313 <dd> |
337 <dd> |
314 flag indicating the execution of a command (boolean) |
338 flag indicating the execution of a command |
|
339 </dd> |
|
340 </dl> |
|
341 <dl> |
|
342 <dt>Return Type:</dt> |
|
343 <dd> |
|
344 bool |
315 </dd> |
345 </dd> |
316 </dl> |
346 </dl> |
317 <a NAME="HgClient.myprompt" ID="HgClient.myprompt"></a> |
347 <a NAME="HgClient.myprompt" ID="HgClient.myprompt"></a> |
318 <h4>HgClient.myprompt</h4> |
348 <h4>HgClient.myprompt</h4> |
319 <b>myprompt</b>(<i></i>) |
349 <b>myprompt</b>(<i></i>) |
326 Public method to restart the command server. |
356 Public method to restart the command server. |
327 </p> |
357 </p> |
328 <dl> |
358 <dl> |
329 <dt>Returns:</dt> |
359 <dt>Returns:</dt> |
330 <dd> |
360 <dd> |
331 tuple of flag indicating a successful start (boolean) and |
361 tuple of flag indicating a successful start and an error |
332 an error message (string) in case of failure |
362 message in case of failure |
|
363 </dd> |
|
364 </dl> |
|
365 <dl> |
|
366 <dt>Return Type:</dt> |
|
367 <dd> |
|
368 tuple of (bool, str) |
333 </dd> |
369 </dd> |
334 </dl> |
370 </dl> |
335 <a NAME="HgClient.runcommand" ID="HgClient.runcommand"></a> |
371 <a NAME="HgClient.runcommand" ID="HgClient.runcommand"></a> |
336 <h4>HgClient.runcommand</h4> |
372 <h4>HgClient.runcommand</h4> |
337 <b>runcommand</b>(<i>args, prompt=None, inputData=None, output=None, error=None</i>) |
373 <b>runcommand</b>(<i>args, prompt=None, inputData=None, output=None, error=None</i>) |
339 <p> |
375 <p> |
340 Public method to execute a command via the command server. |
376 Public method to execute a command via the command server. |
341 </p> |
377 </p> |
342 <dl> |
378 <dl> |
343 |
379 |
344 <dt><i>args</i></dt> |
380 <dt><i>args</i> (list of str)</dt> |
345 <dd> |
381 <dd> |
346 list of arguments for the command (list of string) |
382 list of arguments for the command |
347 </dd> |
383 </dd> |
348 <dt><i>prompt=</i></dt> |
384 <dt><i>prompt</i> (func(int, str) -> (str, bool))</dt> |
349 <dd> |
385 <dd> |
350 function to reply to prompts by the server. It |
386 function to reply to prompts by the server. It |
351 receives the max number of bytes to return and the contents |
387 receives the max number of bytes to return and the contents |
352 of the output channel received so far. |
388 of the output channel received so far. If an output function is |
353 </dd> |
389 given as well, the prompt data is passed through the output |
354 <dt><i>inputData=</i></dt> |
390 function. The function must return the input data and a flag |
|
391 indicating a password input. |
|
392 </dd> |
|
393 <dt><i>inputData</i> (func(int) -> bytes)</dt> |
355 <dd> |
394 <dd> |
356 function to reply to bulk data requests by the |
395 function to reply to bulk data requests by the |
357 server. It receives the max number of bytes to return. |
396 server. It receives the max number of bytes to return. |
358 </dd> |
397 </dd> |
359 <dt><i>output=</i></dt> |
398 <dt><i>output</i> (func(str))</dt> |
360 <dd> |
399 <dd> |
361 function receiving the data from the server (string). |
400 function receiving the data from the server. If a |
362 If a prompt function is given, this parameter will be ignored. |
401 prompt function is given, it is assumed, that the prompt output |
363 </dd> |
402 is passed via this function. |
364 <dt><i>error=</i></dt> |
403 </dd> |
|
404 <dt><i>error</i> (func(str))</dt> |
365 <dd> |
405 <dd> |
366 function receiving error messages from the server |
406 function receiving error messages from the server |
367 (string) |
407 </dd> |
368 </dd> |
408 </dl> |
369 </dl> |
409 <dl> |
370 <dl> |
410 <dt>Returns:</dt> |
371 <dt>Returns:</dt> |
411 <dd> |
372 <dd> |
412 tuple of output and errors of the command server. In case |
373 output and errors of the command server (string). In case |
|
374 output and/or error functions were given, the respective return |
413 output and/or error functions were given, the respective return |
375 value will be an empty string. |
414 value will be an empty string. |
|
415 </dd> |
|
416 </dl> |
|
417 <dl> |
|
418 <dt>Return Type:</dt> |
|
419 <dd> |
|
420 tuple of (str, str) |
376 </dd> |
421 </dd> |
377 </dl> |
422 </dl> |
378 <a NAME="HgClient.startServer" ID="HgClient.startServer"></a> |
423 <a NAME="HgClient.startServer" ID="HgClient.startServer"></a> |
379 <h4>HgClient.startServer</h4> |
424 <h4>HgClient.startServer</h4> |
380 <b>startServer</b>(<i></i>) |
425 <b>startServer</b>(<i></i>) |
383 Public method to start the command server. |
428 Public method to start the command server. |
384 </p> |
429 </p> |
385 <dl> |
430 <dl> |
386 <dt>Returns:</dt> |
431 <dt>Returns:</dt> |
387 <dd> |
432 <dd> |
388 tuple of flag indicating a successful start (boolean) and |
433 tuple of flag indicating a successful start and an error |
389 an error message (string) in case of failure |
434 message in case of failure |
|
435 </dd> |
|
436 </dl> |
|
437 <dl> |
|
438 <dt>Return Type:</dt> |
|
439 <dd> |
|
440 tuple of (bool, str) |
390 </dd> |
441 </dd> |
391 </dl> |
442 </dl> |
392 <a NAME="HgClient.stopServer" ID="HgClient.stopServer"></a> |
443 <a NAME="HgClient.stopServer" ID="HgClient.stopServer"></a> |
393 <h4>HgClient.stopServer</h4> |
444 <h4>HgClient.stopServer</h4> |
394 <b>stopServer</b>(<i></i>) |
445 <b>stopServer</b>(<i></i>) |