# HG changeset patch # User Paul Crowley # Date 1235128521 0 # Node ID 0a7fc4652793fbe0d1e7aca1493a65796f21d443 # Parent 0e77495e91e238dd420303e6f8ca6f3e692bbc39 todispatch unnecessary diff -r 0e77495e91e2 -r 0a7fc4652793 src/hg-ssh --- a/src/hg-ssh Fri Feb 20 11:10:34 2009 +0000 +++ b/src/hg-ssh Fri Feb 20 11:15:21 2009 +0000 @@ -48,17 +48,17 @@ fail("Disallowing path: %s" % path) return path -def get_cmd(rules, cmd): +def try_cmd(rules, cmd): if cmd.startswith('hg -R ') and cmd.endswith(' serve --stdio'): repo = getpath(cmd[6:-14]) if rules.allow("read", repo=repo): os.environ["HG_REPO_PATH"] = repo - return ['-R', repo, 'serve', '--stdio'] + dispatch.dispatch(['-R', repo, 'serve', '--stdio']) elif cmd.startswith('hg init '): repo = getpath(cmd[8:]) if rules.allow("init", repo=repo): os.environ["HG_REPO_PATH"] = repo - return ['init', repo] + dispatch.dispatch(['init', repo]) fail("Illegal command %r" % cmd) #logfile = open("/tmp/hg-ssh.%d.txt" % os.getpid(), "w") @@ -71,7 +71,5 @@ rules = ruleset.rules_from_env() rules.set(user = getpath(os.environ['REMOTE_USER'])) rules.set(branch = None, file = None) -todispatch = get_cmd(rules, - os.environ.get('SSH_ORIGINAL_COMMAND', '?')) -dispatch.dispatch(todispatch) +try_cmd(rules, os.environ.get('SSH_ORIGINAL_COMMAND', '?'))