tests/dummyssh
author Idan Kamara <idankk86@gmail.com>
Thu, 14 Jul 2011 11:46:15 +0300
branchstable
changeset 14882 bb2cffe81a94
parent 14186 8513bd2e7259
child 15768 cdf9c43445df
permissions -rwxr-xr-x
cmdserver: take repo.baseui as our ui The ui passed to server() is really repo.ui, that is it contains its local configuration as well. When running commands that use a different repo than the servers cached repo, we don't want to use that ui as the baseui for the new repo.

#!/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()
r = os.system(sys.argv[2])
sys.exit(bool(r))