Patchwork ***UNCHECKED*** D9271: serve: simply return instead of calling sys.exit() in `hg serve --stdio`

login
register
mail settings
Submitter phabricator
Date Nov. 4, 2020, 4:47 a.m.
Message ID <differential-rev-PHID-DREV-d2doamcwlb6nfeiqadhd-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47546/
State Superseded
Headers show

Comments

phabricator - Nov. 4, 2020, 4:47 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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`.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9271

AFFECTED FILES
  mercurial/commands.py
  mercurial/debugcommands.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -3376,7 +3376,6 @@ 
 
     s = wireprotoserver.sshserver(ui, repo, logfh=logfh)
     s.serve_forever()
-    sys.exit(0)
 
 
 @command(b'debugsetparents', [], _(b'REV1 [REV2]'))
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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)