Mercurial > hg
comparison mercurial/hgweb/__init__.py @ 45818:b7b8a1538161
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 03 Nov 2020 20:18:26 -0800 |
parents | 9f70512ae2cf |
children | ee826f43cf4f |
comparison
equal
deleted
inserted
replaced
45817:58e7ee23ddbd | 45818:b7b8a1538161 |
---|---|
7 # GNU General Public License version 2 or any later version. | 7 # GNU General Public License version 2 or any later version. |
8 | 8 |
9 from __future__ import absolute_import | 9 from __future__ import absolute_import |
10 | 10 |
11 import os | 11 import os |
12 import sys | |
12 | 13 |
13 from ..i18n import _ | 14 from ..i18n import _ |
14 | 15 |
15 from .. import ( | 16 from .. import ( |
16 error, | 17 error, |
109 ) | 110 ) |
110 self.ui.flush() # avoid buffering of status message | 111 self.ui.flush() # avoid buffering of status message |
111 | 112 |
112 def run(self): | 113 def run(self): |
113 self.httpd.serve_forever() | 114 self.httpd.serve_forever() |
115 sys.exit(0) | |
114 | 116 |
115 | 117 |
116 def createapp(baseui, repo, webconf): | 118 def createapp(baseui, repo, webconf): |
117 if webconf: | 119 if webconf: |
118 return hgwebdir_mod.hgwebdir(webconf, baseui=baseui) | 120 return hgwebdir_mod.hgwebdir(webconf, baseui=baseui) |