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 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") |
16 demandload(globals(), "hgweb.server") |
17 demandload(globals(), "mercurial.hgweb:hgweb,hgwebdir") |
|
18 |
17 |
19 class UnknownCommand(Exception): |
18 class UnknownCommand(Exception): |
20 """Exception raised if command is not in the command table.""" |
19 """Exception raised if command is not in the command table.""" |
21 class AmbiguousCommand(Exception): |
20 class AmbiguousCommand(Exception): |
22 """Exception raised if command shortcut matches more than one command.""" |
21 """Exception raised if command shortcut matches more than one command.""" |
2542 os.close(wfd) |
2541 os.close(wfd) |
2543 os.read(rfd, 1) |
2542 os.read(rfd, 1) |
2544 os._exit(0) |
2543 os._exit(0) |
2545 |
2544 |
2546 try: |
2545 try: |
2547 httpd = create_server(ui, repo, hgwebdir, hgweb) |
2546 httpd = hgweb.server.create_server(ui, repo) |
2548 except socket.error, inst: |
2547 except socket.error, inst: |
2549 raise util.Abort(_('cannot start server: ') + inst.args[1]) |
2548 raise util.Abort(_('cannot start server: ') + inst.args[1]) |
2550 |
2549 |
2551 if ui.verbose: |
2550 if ui.verbose: |
2552 addr, port = httpd.socket.getsockname() |
2551 addr, port = httpd.socket.getsockname() |