changeset 45819:d6279c43fc60

serve: simply return instead of calling sys.exit() in `hg serve --stdio` The shouldn't be a reason to call `sys.exit()` instead of letting the code return normally. I've remove the call in both `hg serve` and `hg debugserve`. Differential Revision: https://phab.mercurial-scm.org/D9271
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 03 Nov 2020 20:20:49 -0800
parents b7b8a1538161
children ee826f43cf4f
files mercurial/commands.py mercurial/debugcommands.py
diffstat 2 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Nov 03 20:18:26 2020 -0800
+++ b/mercurial/commands.py	Tue Nov 03 20:20:49 2020 -0800
@@ -6348,7 +6348,7 @@
             )
         s = wireprotoserver.sshserver(ui, repo)
         s.serve_forever()
-        sys.exit(0)
+        return
 
     service = server.createservice(ui, repo, opts)
     return server.runservice(opts, initfn=service.init, runfn=service.run)
--- a/mercurial/debugcommands.py	Tue Nov 03 20:18:26 2020 -0800
+++ b/mercurial/debugcommands.py	Tue Nov 03 20:20:49 2020 -0800
@@ -3376,7 +3376,6 @@
 
     s = wireprotoserver.sshserver(ui, repo, logfh=logfh)
     s.serve_forever()
-    sys.exit(0)
 
 
 @command(b'debugsetparents', [], _(b'REV1 [REV2]'))