# HG changeset patch # User Mads Kiilerich # Date 2021-01-19 20:24:31 # Node ID 73f3ed6a91d97822c680740b354570f10cdd731b # Parent 20e850093f1cee985a26c39d3f16d5cae5dd7326 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 . diff --git a/kallithea/bin/kallithea_cli_ssh.py b/kallithea/bin/kallithea_cli_ssh.py --- a/kallithea/bin/kallithea_cli_ssh.py +++ b/kallithea/bin/kallithea_cli_ssh.py @@ -69,7 +69,7 @@ def ssh_serve(user_id, key_id): 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) diff --git a/kallithea/lib/vcs/ssh/base.py b/kallithea/lib/vcs/ssh/base.py --- a/kallithea/lib/vcs/ssh/base.py +++ b/kallithea/lib/vcs/ssh/base.py @@ -96,7 +96,7 @@ class BaseSshHandler(object): # 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."""