diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -628,6 +628,9 @@ coreconfigitem('web', 'errorlog', coreconfigitem('web', 'ipv6', default=False, ) +coreconfigitem('web', 'port', + default=8000, +) coreconfigitem('worker', 'backgroundclose', default=dynamicdefault, ) diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -327,7 +327,7 @@ def create_server(ui, app): sys.setdefaultencoding(oldenc) address = ui.config('web', 'address') - port = util.getport(ui.config('web', 'port', 8000)) + port = util.getport(ui.config('web', 'port')) try: return cls(ui, app, (address, port), handler) except socket.error as inst: