Show More
@@ -9,6 +9,21 b' import time' | |||||
9 |
|
9 | |||
10 | # we cannot use mercurial.testing as long as python2 is not dropped as the test will only install the mercurial module for python2 in python2 run |
|
10 | # we cannot use mercurial.testing as long as python2 is not dropped as the test will only install the mercurial module for python2 in python2 run | |
11 |
|
11 | |||
|
12 | DEBUG_FILE = os.environ.get('SIGPIPE_REMOTE_DEBUG_FILE') | |||
|
13 | if DEBUG_FILE is None: | |||
|
14 | debug_stream = sys.stderr.buffer | |||
|
15 | else: | |||
|
16 | debug_stream = open(DEBUG_FILE, 'bw', buffering=0) | |||
|
17 | ||||
|
18 | SYNCFILE1 = os.environ.get('SYNCFILE1') | |||
|
19 | SYNCFILE2 = os.environ.get('SYNCFILE2') | |||
|
20 | if SYNCFILE1 is None: | |||
|
21 | print('SIGPIPE-HELPER: missing variable $SYNCFILE1', file=sys.stderr) | |||
|
22 | sys.exit(255) | |||
|
23 | if SYNCFILE2 is None: | |||
|
24 | print('SIGPIPE-HELPER: missing variable $SYNCFILE2', file=sys.stderr) | |||
|
25 | sys.exit(255) | |||
|
26 | ||||
12 |
|
27 | |||
13 | def _timeout_factor(): |
|
28 | def _timeout_factor(): | |
14 | """return the current modification to timeout""" |
|
29 | """return the current modification to timeout""" | |
@@ -56,21 +71,6 b' stdout_reader = os.fdopen(piped_stdout[0' | |||||
56 | stderr_writer = os.fdopen(piped_stderr[1], "rb") |
|
71 | stderr_writer = os.fdopen(piped_stderr[1], "rb") | |
57 | stderr_reader = os.fdopen(piped_stderr[0], "rb") |
|
72 | stderr_reader = os.fdopen(piped_stderr[0], "rb") | |
58 |
|
73 | |||
59 | DEBUG_FILE = os.environ.get('SIGPIPE_REMOTE_DEBUG_FILE') |
|
|||
60 | if DEBUG_FILE is None: |
|
|||
61 | debug_stream = sys.stderr.buffer |
|
|||
62 | else: |
|
|||
63 | debug_stream = open(DEBUG_FILE, 'bw', buffering=0) |
|
|||
64 |
|
||||
65 | SYNCFILE1 = os.environ.get('SYNCFILE1') |
|
|||
66 | SYNCFILE2 = os.environ.get('SYNCFILE2') |
|
|||
67 | if SYNCFILE1 is None: |
|
|||
68 | print('SIGPIPE-HELPER: missing variable $SYNCFILE1', file=sys.stderr) |
|
|||
69 | sys.exit(255) |
|
|||
70 | if SYNCFILE2 is None: |
|
|||
71 | print('SIGPIPE-HELPER: missing variable $SYNCFILE2', file=sys.stderr) |
|
|||
72 | sys.exit(255) |
|
|||
73 |
|
||||
74 | debug_stream.write(b'SIGPIPE-HELPER: Starting\n') |
|
74 | debug_stream.write(b'SIGPIPE-HELPER: Starting\n') | |
75 |
|
75 | |||
76 | TESTLIB_DIR = os.path.dirname(sys.argv[0]) |
|
76 | TESTLIB_DIR = os.path.dirname(sys.argv[0]) |
General Comments 0
You need to be logged in to leave comments.
Login now