Changeset - 73f3ed6a91d9
[Not reviewed]
default
0 2 0
Mads Kiilerich (mads) - 5 years ago 2021-01-19 20:24:31
mads@kiilerich.com
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 .
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/kallithea_cli_ssh.py
Show inline comments
 
@@ -66,13 +66,13 @@ def ssh_serve(user_id, key_id):
 
        sys.stderr.write('Error parsing SSH command %r: %s\n' % (ssh_original_command, e))
 
        sys.exit(1)
 
    for VcsHandler in [MercurialSshHandler, GitSshHandler]:
 
        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)
 

	
 

	
 
@cli_base.register_command(config_file_initialize_app=True)
kallithea/lib/vcs/ssh/base.py
Show inline comments
 
@@ -93,13 +93,13 @@ class BaseSshHandler(object):
 
        # process_pushed_raw_ids (which it is called as Git post-receive hook,
 
        # or Mercurial 'changegroup' hook).
 
        # For pull actions, the actual hook in log_pull_action (called directly
 
        # 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."""
 
        raise NotImplementedError
 

	
 
    def exit(self, error):
0 comments (0 inline, 0 general)