tests/dummyssh
author Greg Ward <greg@gerg.ca>
Tue, 14 Apr 2015 12:43:37 -0400
branchstable
changeset 1259 0daf56a2032d
parent 943 5b8d9c2ab480
permissions -rwxr-xr-x
docs: update sharing guide based (mostly) on marmoute's review - don't claim certain scenarios are more/less common, just simple/advanced - mention code review as a multiple-developer scenario (not described in detail yet!) - suggest "hg config --edit --local" instead of "cat >> .hg/hgrc" - use -q less often (and show resulting output) - edit some section headers to be consistent with user guide (example numbers; "amend" instead of "amending") (These are just the small changes; big changes are yet to come.)

#!/usr/bin/env python

import sys
import os

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))