##// END OF EJS Templates
dummyssh: use subprocess instead of os.call...
marmoute -
r48440:119673fb default
parent child Browse files
Show More
@@ -1,26 +1,27
1 1 #!/usr/bin/env python3
2 2
3 3 from __future__ import absolute_import
4 4
5 5 import os
6 import subprocess
6 7 import sys
7 8
8 9 os.chdir(os.getenv('TESTTMP'))
9 10
10 11 if sys.argv[1] != "user@dummy":
11 12 sys.exit(-1)
12 13
13 14 os.environ["SSH_CLIENT"] = "%s 1 2" % os.environ.get('LOCALIP', '127.0.0.1')
14 15
15 16 log = open("dummylog", "ab")
16 17 log.write(b"Got arguments")
17 18 for i, arg in enumerate(sys.argv[1:]):
18 19 log.write(b" %d:%s" % (i + 1, arg.encode('latin1')))
19 20 log.write(b"\n")
20 21 log.close()
21 22 hgcmd = sys.argv[2]
22 23 if os.name == 'nt':
23 24 # hack to make simple unix single quote quoting work on windows
24 25 hgcmd = hgcmd.replace("'", '"')
25 r = os.system(hgcmd)
26 r = subprocess.call(hgcmd, shell=True)
26 27 sys.exit(bool(r))
General Comments 0
You need to be logged in to leave comments. Login now