tests/dummyssh
author Matt Harbison <matt_harbison@yahoo.com>
Sun, 08 Jan 2017 14:37:44 -0500
changeset 30733 66448a53bdac
parent 29159 26d4ce8ca2bd
child 31007 bfdb0741f9f2
permissions -rwxr-xr-x
test-obsolete: stabilize output on platforms without 'serve' support The conditional was updating the repository, which wasn't reflected in subsequent logs on Windows, so the conditional is narrowed to just the serve commands. The serve operation generates log files, so those are deleted to keep the output of summary consistent.

#!/usr/bin/env python

from __future__ import absolute_import

import os
import sys

os.chdir(os.getenv('TESTTMP'))

if sys.argv[1] != "user@dummy":
    sys.exit(-1)

os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"

log = open("dummylog", "ab")
log.write("Got arguments")
for i, arg in enumerate(sys.argv[1:]):
    log.write(" %d:%s" % (i + 1, arg))
log.write("\n")
log.close()
hgcmd = sys.argv[2]
if os.name == 'nt':
    # hack to make simple unix single quote quoting work on windows
    hgcmd = hgcmd.replace("'", '"')
r = os.system(hgcmd)
sys.exit(bool(r))