Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/server.py @ 46907:ffd3e823a7e5
urlutil: extract `url` related code from `util` into the new module
The new module is well fitting for this new code. And this will be useful to
make the gathered code collaborate more later.
Differential Revision: https://phab.mercurial-scm.org/D10374
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 12 Apr 2021 03:01:04 +0200 |
parents | d4ba4d51f85f |
children | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
46906:33524c46a092 | 46907:ffd3e823a7e5 |
---|---|
20 hgweb, | 20 hgweb, |
21 pycompat, | 21 pycompat, |
22 util, | 22 util, |
23 ) | 23 ) |
24 | 24 |
25 from .utils import procutil | 25 from .utils import ( |
26 procutil, | |
27 urlutil, | |
28 ) | |
26 | 29 |
27 | 30 |
28 def runservice( | 31 def runservice( |
29 opts, | 32 opts, |
30 parentfn=None, | 33 parentfn=None, |
182 | 185 |
183 | 186 |
184 def _createhgwebservice(ui, repo, opts): | 187 def _createhgwebservice(ui, repo, opts): |
185 # this way we can check if something was given in the command-line | 188 # this way we can check if something was given in the command-line |
186 if opts.get(b'port'): | 189 if opts.get(b'port'): |
187 opts[b'port'] = util.getport(opts.get(b'port')) | 190 opts[b'port'] = urlutil.getport(opts.get(b'port')) |
188 | 191 |
189 alluis = {ui} | 192 alluis = {ui} |
190 if repo: | 193 if repo: |
191 baseui = repo.baseui | 194 baseui = repo.baseui |
192 alluis.update([repo.baseui, repo.ui]) | 195 alluis.update([repo.baseui, repo.ui]) |