Show More
@@ -1,6 +1,14 b'' | |||||
1 | # A minimal client for Mercurial's command server |
|
1 | # A minimal client for Mercurial's command server | |
2 |
|
2 | |||
3 | import os, sys, signal, struct, socket, subprocess, time, cStringIO |
|
3 | from __future__ import absolute_import, print_function | |
|
4 | import cStringIO | |||
|
5 | import os | |||
|
6 | import signal | |||
|
7 | import socket | |||
|
8 | import struct | |||
|
9 | import subprocess | |||
|
10 | import sys | |||
|
11 | import time | |||
4 |
|
12 | |||
5 | def connectpipe(path=None): |
|
13 | def connectpipe(path=None): | |
6 | cmdline = ['hg', 'serve', '--cmdserver', 'pipe'] |
|
14 | cmdline = ['hg', 'serve', '--cmdserver', 'pipe'] | |
@@ -69,7 +77,7 b' def sep(text):' | |||||
69 |
|
77 | |||
70 | def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None, |
|
78 | def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None, | |
71 | outfilter=lambda x: x): |
|
79 | outfilter=lambda x: x): | |
72 |
print |
|
80 | print('*** runcommand', ' '.join(args)) | |
73 | sys.stdout.flush() |
|
81 | sys.stdout.flush() | |
74 | server.stdin.write('runcommand\n') |
|
82 | server.stdin.write('runcommand\n') | |
75 | writeblock(server, '\0'.join(args)) |
|
83 | writeblock(server, '\0'.join(args)) | |
@@ -92,10 +100,10 b' def runcommand(server, args, output=sys.' | |||||
92 | elif ch == 'r': |
|
100 | elif ch == 'r': | |
93 | ret, = struct.unpack('>i', data) |
|
101 | ret, = struct.unpack('>i', data) | |
94 | if ret != 0: |
|
102 | if ret != 0: | |
95 |
print |
|
103 | print(' [%d]' % ret) | |
96 | return ret |
|
104 | return ret | |
97 | else: |
|
105 | else: | |
98 |
print |
|
106 | print("unexpected channel %c: %r" % (ch, data)) | |
99 | if ch.isupper(): |
|
107 | if ch.isupper(): | |
100 | return |
|
108 | return | |
101 |
|
109 |
@@ -6,8 +6,6 b'' | |||||
6 | contrib/check-code.py not using absolute_import |
|
6 | contrib/check-code.py not using absolute_import | |
7 | contrib/check-code.py requires print_function |
|
7 | contrib/check-code.py requires print_function | |
8 | contrib/debugshell.py not using absolute_import |
|
8 | contrib/debugshell.py not using absolute_import | |
9 | contrib/hgclient.py not using absolute_import |
|
|||
10 | contrib/hgclient.py requires print_function |
|
|||
11 | contrib/hgfixes/fix_bytes.py not using absolute_import |
|
9 | contrib/hgfixes/fix_bytes.py not using absolute_import | |
12 | contrib/hgfixes/fix_bytesmod.py not using absolute_import |
|
10 | contrib/hgfixes/fix_bytesmod.py not using absolute_import | |
13 | contrib/hgfixes/fix_leftover_imports.py not using absolute_import |
|
11 | contrib/hgfixes/fix_leftover_imports.py not using absolute_import |
General Comments 0
You need to be logged in to leave comments.
Login now