8 from demandload import demandload |
8 from demandload import demandload |
9 from node import * |
9 from node import * |
10 from i18n import gettext as _ |
10 from i18n import gettext as _ |
11 demandload(globals(), "os re sys signal shutil imp urllib pdb") |
11 demandload(globals(), "os re sys signal shutil imp urllib pdb") |
12 demandload(globals(), "fancyopts ui hg util lock revlog templater bundlerepo") |
12 demandload(globals(), "fancyopts ui hg util lock revlog templater bundlerepo") |
13 demandload(globals(), "fnmatch hgweb mdiff random signal tempfile time") |
13 demandload(globals(), "fnmatch mdiff random signal tempfile time") |
14 demandload(globals(), "traceback errno socket version struct atexit sets bz2") |
14 demandload(globals(), "traceback errno socket version struct atexit sets bz2") |
15 demandload(globals(), "archival changegroup") |
15 demandload(globals(), "archival changegroup") |
|
16 demandload(globals(), "mercurial.hgweb.server:create_server") |
|
17 demandload(globals(), "mercurial.hgweb:hgweb,hgwebdir") |
16 |
18 |
17 class UnknownCommand(Exception): |
19 class UnknownCommand(Exception): |
18 """Exception raised if command is not in the command table.""" |
20 """Exception raised if command is not in the command table.""" |
19 class AmbiguousCommand(Exception): |
21 class AmbiguousCommand(Exception): |
20 """Exception raised if command shortcut matches more than one command.""" |
22 """Exception raised if command shortcut matches more than one command.""" |
2540 os.close(wfd) |
2542 os.close(wfd) |
2541 os.read(rfd, 1) |
2543 os.read(rfd, 1) |
2542 os._exit(0) |
2544 os._exit(0) |
2543 |
2545 |
2544 try: |
2546 try: |
2545 httpd = hgweb.create_server(ui, repo, hgweb.hgwebdir, hgweb.hgweb) |
2547 httpd = create_server(ui, repo, hgwebdir, hgweb) |
2546 except socket.error, inst: |
2548 except socket.error, inst: |
2547 raise util.Abort(_('cannot start server: ') + inst.args[1]) |
2549 raise util.Abort(_('cannot start server: ') + inst.args[1]) |
2548 |
2550 |
2549 if ui.verbose: |
2551 if ui.verbose: |
2550 addr, port = httpd.socket.getsockname() |
2552 addr, port = httpd.socket.getsockname() |