Esempio n. 1
0
 def init(self):
     self.stopped = True
     util.set_signal_handler()
     try:
         parentui = ui.parentui or ui
         optlist = ("name templates style address port prefix ipv6"
                    " accesslog errorlog webdir_conf certificate")
         for o in optlist.split():
             if opts[o]:
                 parentui.setconfig("web", o, str(opts[o]))
                 if (repo is not None) and (repo.ui != parentui):
                     repo.ui.setconfig("web", o, str(opts[o]))
         self.httpd = server.create_server(ui, repo)
     except socket.error, inst:
         raise util.Abort(_('cannot start server: ') + inst.args[1])
Esempio n. 2
0
 def init(self):
     self.stopped = True
     util.set_signal_handler()
     try:
         baseui = repo and repo.baseui or ui
         repoui = repo and repo.ui != baseui and repo.ui or None
         optlist = ("name templates style address port prefix ipv6"
                    " accesslog errorlog webdir_conf certificate")
         for o in optlist.split():
             if opts[o]:
                 baseui.setconfig("web", o, str(opts[o]))
                 if repoui:
                     repoui.setconfig("web", o, str(opts[o]))
         o = opts.get('web_conf') or opts.get('webdir_conf')
         if o:
             app = hgwebdir_mod.hgwebdir(o, repo.ui)
         else:
             app = hgweb_mod.hgweb(hg.repository(repo.ui, repo.root))
         self.httpd = server.create_server(ui, app)
     except socket.error, inst:
         raise util.Abort(_('cannot start server: ') + inst.args[1])