equal
deleted
inserted
replaced
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', '?')) |