src/hg-ssh
changeset 69 e31646deafc8
parent 67 fd16d9a1234b
child 70 abb9ed8972e0
equal deleted inserted replaced
68:a88134f77486 69:e31646deafc8
    64     fail("Illegal command %r" % cmd)
    64     fail("Illegal command %r" % cmd)
    65 
    65 
    66 #logfile = open("/tmp/hg-ssh.%d.txt" % os.getpid(), "w")
    66 #logfile = open("/tmp/hg-ssh.%d.txt" % os.getpid(), "w")
    67 #logfile.write("Started: %s\n" % sys.argv)
    67 #logfile.write("Started: %s\n" % sys.argv)
    68 
    68 
    69 if len(sys.argv) != 1:
    69 if len(sys.argv) != 2:
    70     fail("hg-ssh must have no arguments (%s)" 
    70     fail("hg-ssh must have exactly one argument (%s)" 
    71         % sys.argv)
    71         % sys.argv)
    72 
    72 
       
    73 remote_user = sys.argv[1]
       
    74 os.environ['REMOTE_USER'] = remote_user
       
    75 
    73 rules = ruleset.rules_from_env()
    76 rules = ruleset.rules_from_env()
    74 rules.set(user = getpath(os.environ['REMOTE_USER']))
    77 rules.set(user = getpath(remote_user))
    75 rules.set(branch = None, file = None)
    78 rules.set(branch = None, file = None)
    76 try_cmd(rules, os.environ.get('SSH_ORIGINAL_COMMAND', '?'))
    79 try_cmd(rules, os.environ.get('SSH_ORIGINAL_COMMAND', '?'))