##// END OF EJS Templates
catapult: fix broken run-tests catapult tracing...
Kyle Lippincott -
r40523:d9535814 default
parent child Browse files
Show More
@@ -1382,20 +1382,27 b' class TTest(Test):'
1382 session = str(uuid.uuid4())
1382 session = str(uuid.uuid4())
1383 if PYTHON3:
1383 if PYTHON3:
1384 session = session.encode('ascii')
1384 session = session.encode('ascii')
1385 def toggletrace(cmd):
1385 hgcatapult = os.getenv('HGCATAPULTSERVERPIPE')
1386 def toggletrace(cmd=None):
1387 if not hgcatapult or hgcatapult == os.devnull:
1388 return
1389
1390 if active:
1391 script.append(
1392 b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
1393 session, active[0]))
1394 if cmd is None:
1395 return
1396
1386 if isinstance(cmd, str):
1397 if isinstance(cmd, str):
1387 quoted = shellquote(cmd.strip())
1398 quoted = shellquote(cmd.strip())
1388 else:
1399 else:
1389 quoted = shellquote(cmd.strip().decode('utf8')).encode('utf8')
1400 quoted = shellquote(cmd.strip().decode('utf8')).encode('utf8')
1390 quoted = quoted.replace(b'\\', b'\\\\')
1401 quoted = quoted.replace(b'\\', b'\\\\')
1391 if active:
1402 script.append(
1392 script.append(
1403 b'echo START %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
1393 b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
1404 session, quoted))
1394 session, active[0]))
1405 active[0:] = [quoted]
1395 script.append(
1396 b'echo START %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
1397 session, quoted))
1398 active[0:] = [quoted]
1399
1406
1400 script = []
1407 script = []
1401
1408
@@ -1424,7 +1431,6 b' class TTest(Test):'
1424 if os.getenv('MSYSTEM'):
1431 if os.getenv('MSYSTEM'):
1425 script.append(b'alias pwd="pwd -W"\n')
1432 script.append(b'alias pwd="pwd -W"\n')
1426
1433
1427 hgcatapult = os.getenv('HGCATAPULTSERVERPIPE')
1428 if hgcatapult and hgcatapult != os.devnull:
1434 if hgcatapult and hgcatapult != os.devnull:
1429 # Kludge: use a while loop to keep the pipe from getting
1435 # Kludge: use a while loop to keep the pipe from getting
1430 # closed by our echo commands. The still-running file gets
1436 # closed by our echo commands. The still-running file gets
@@ -1536,6 +1542,9 b' class TTest(Test):'
1536 if skipping is not None:
1542 if skipping is not None:
1537 after.setdefault(pos, []).append(' !!! missing #endif\n')
1543 after.setdefault(pos, []).append(' !!! missing #endif\n')
1538 addsalt(n + 1, False)
1544 addsalt(n + 1, False)
1545 # Need to end any current per-command trace
1546 if active:
1547 toggletrace()
1539 return salt, script, after, expected
1548 return salt, script, after, expected
1540
1549
1541 def _processoutput(self, exitcode, output, salt, after, expected):
1550 def _processoutput(self, exitcode, output, salt, after, expected):
General Comments 0
You need to be logged in to leave comments. Login now