Show More
@@ -11,8 +11,7 b' from i18n import _, gettext' | |||||
11 | import os, re, sys, difflib, time, tempfile |
|
11 | import os, re, sys, difflib, time, tempfile | |
12 | import hg, util, revlog, bundlerepo, extensions, copies, error |
|
12 | import hg, util, revlog, bundlerepo, extensions, copies, error | |
13 | import patch, help, mdiff, url, encoding, templatekw |
|
13 | import patch, help, mdiff, url, encoding, templatekw | |
14 | import archival, changegroup, cmdutil, sshserver, hbisect |
|
14 | import archival, changegroup, cmdutil, sshserver, hbisect, hgweb, hgweb.server | |
15 | from hgweb import server, hgweb_mod, hgwebdir_mod |
|
|||
16 | import merge as mergemod |
|
15 | import merge as mergemod | |
17 | import minirst |
|
16 | import minirst | |
18 |
|
17 | |||
@@ -2939,18 +2938,18 b' def serve(ui, repo, **opts):' | |||||
2939 | repo.ui.setconfig("web", o, val) |
|
2938 | repo.ui.setconfig("web", o, val) | |
2940 |
|
2939 | |||
2941 | o = opts.get('web_conf') or opts.get('webdir_conf') |
|
2940 | o = opts.get('web_conf') or opts.get('webdir_conf') | |
2942 | if o: |
|
2941 | if not o: | |
2943 | app = hgwebdir_mod.hgwebdir(o, baseui=ui) |
|
2942 | if not repo: | |
2944 | elif repo is not None: |
|
2943 | raise error.RepoError(_("There is no Mercurial repository" | |
2945 | app = hgweb_mod.hgweb(hg.repository(repo.ui, repo.root)) |
|
2944 | " here (.hg not found)")) | |
2946 | else: |
|
2945 | o = repo.root | |
2947 | raise error.RepoError(_("There is no Mercurial repository" |
|
2946 | ||
2948 | " here (.hg not found)")) |
|
2947 | app = hgweb.hgweb(o, baseui=ui) | |
2949 |
|
2948 | |||
2950 | class service(object): |
|
2949 | class service(object): | |
2951 | def init(self): |
|
2950 | def init(self): | |
2952 | util.set_signal_handler() |
|
2951 | util.set_signal_handler() | |
2953 | self.httpd = server.create_server(ui, app) |
|
2952 | self.httpd = hgweb.server.create_server(ui, app) | |
2954 |
|
2953 | |||
2955 | if opts['port'] and not ui.verbose: |
|
2954 | if opts['port'] and not ui.verbose: | |
2956 | return |
|
2955 | return |
General Comments 0
You need to be logged in to leave comments.
Login now