This is an archive of the discontinued Mercurial Phabricator instance.

hgweb: don't call sys.exit() in httpservice.run()
ClosedPublic

Authored by martinvonz on Nov 3 2020, 11:44 PM.

Details

Summary

If I'm reading the code correctly, mercurial.server.createservice()
can return an hgweb service or one of three types of command server
services. The caller then calls mercurial.server.runservice(),
passing it the returned service's run method. Only the hgweb service
was calling sys.exit(). It has been that way since 8d44649df03b
(refactor ssh server., 2006-06-04). That commit message doesn't
provide any explanation. Let's clean up and have the code follow the
usual return path into the dispatch module.

After this patch, there should be no remaining places left where we
call sys.exit() except for valid uses in the dispatch and worker
modules.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

martinvonz created this revision.Nov 3 2020, 11:44 PM
mharbison72 accepted this revision.Nov 4 2020, 7:53 PM
mharbison72 added a subscriber: mharbison72.

Will queue to here when I figure out how to push, thanks.

mercurial/hgweb/__init__.py
115

Dropped the unused import.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.