Mercurial > kallithea
changeset 8847:73f3ed6a91d9
ssh: handle case where hg serve_forever doesn't serve forever
serve_forever will no longer exit in Mercurial 5.7 .
This changed with https://mercurial-scm.org/repo/hg/rev/b7b8a1538161 .
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 19 Jan 2021 20:24:31 +0100 |
parents | 20e850093f1c |
children | 574cd37f05c4 |
files | kallithea/bin/kallithea_cli_ssh.py kallithea/lib/vcs/ssh/base.py |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/bin/kallithea_cli_ssh.py Mon Jan 11 23:28:09 2021 +0100 +++ b/kallithea/bin/kallithea_cli_ssh.py Tue Jan 19 20:24:31 2021 +0100 @@ -69,7 +69,7 @@ vcs_handler = VcsHandler.make(ssh_command_parts) if vcs_handler is not None: vcs_handler.serve(user_id, key_id, client_ip) - assert False # serve is written so it never will terminate + sys.exit(0) sys.stderr.write("This account can only be used for repository access. SSH command %r is not supported.\n" % ssh_original_command) sys.exit(1)
--- a/kallithea/lib/vcs/ssh/base.py Mon Jan 11 23:28:09 2021 +0100 +++ b/kallithea/lib/vcs/ssh/base.py Tue Jan 19 20:24:31 2021 +0100 @@ -96,7 +96,7 @@ # on Git, or through the 'outgoing' Mercurial hook) is hardcoded to # ignore the environment action and always use 'pull'. set_hook_environment(self.authuser.username, client_ip, self.repo_name, self.vcs_type, 'push') - return self._serve() + self._serve() def _serve(self): """Serve the native protocol for repository access."""