Commit 4b21b956 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk

httpservice: move sys.exit() out of serve_forever()

This is a simple refactoring to show the callers of the method, so
it's easier to reason about the impact of removing the `sys.exit()`
calls in subsequent patches.

Differential Revision: https://phab.mercurial-scm.org/D9270
parent 58e7ee23ddbd
......@@ -6348,6 +6348,7 @@ def serve(ui, repo, **opts):
)
s = wireprotoserver.sshserver(ui, repo)
s.serve_forever()
sys.exit(0)
service = server.createservice(ui, repo, opts)
return server.runservice(opts, initfn=service.init, runfn=service.run)
......
......@@ -3376,6 +3376,7 @@ def debugserve(ui, repo, **opts):
s = wireprotoserver.sshserver(ui, repo, logfh=logfh)
s.serve_forever()
sys.exit(0)
@command(b'debugsetparents', [], _(b'REV1 [REV2]'))
......
......@@ -9,6 +9,7 @@
from __future__ import absolute_import
import os
import sys
from ..i18n import _
......@@ -111,6 +112,7 @@ class httpservice(object):
def run(self):
self.httpd.serve_forever()
sys.exit(0)
def createapp(baseui, repo, webconf):
......
......@@ -8,7 +8,6 @@ from __future__ import absolute_import
import contextlib
import struct
import sys
import threading
from .i18n import _
......@@ -851,7 +850,6 @@ class sshserver(object):
def serve_forever(self):
self.serveuntil(threading.Event())
self._ui.restorefinout(self._fin, self._fout)
sys.exit(0)
def serveuntil(self, ev):
"""Serve until a threading.Event is set."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment