mercurial/hgweb.py
changeset 896 01215ad04283
parent 858 c333dfa8fa1a
parent 895 77b52b864249
child 937 e4f1b76831b2
child 945 f15901d053e1
equal deleted inserted replaced
867:0cd2ee61b10a 896:01215ad04283
   706                   accesslog = sys.stdout, errorlog = sys.stderr):
   706                   accesslog = sys.stdout, errorlog = sys.stderr):
   707 
   707 
   708     import BaseHTTPServer
   708     import BaseHTTPServer
   709 
   709 
   710     class IPv6HTTPServer(BaseHTTPServer.HTTPServer):
   710     class IPv6HTTPServer(BaseHTTPServer.HTTPServer):
   711         address_family = socket.AF_INET6
   711         address_family = getattr(socket, 'AF_INET6', None)
       
   712 
       
   713         def __init__(self, *args, **kwargs):
       
   714             if self.address_family is None:
       
   715                 raise RepoError('IPv6 not available on this system')
       
   716             BaseHTTPServer.HTTPServer.__init__(self, *args, **kwargs)
   712 
   717 
   713     class hgwebhandler(BaseHTTPServer.BaseHTTPRequestHandler):
   718     class hgwebhandler(BaseHTTPServer.BaseHTTPRequestHandler):
   714         def log_error(self, format, *args):
   719         def log_error(self, format, *args):
   715             errorlog.write("%s - - [%s] %s\n" % (self.address_string(),
   720             errorlog.write("%s - - [%s] %s\n" % (self.address_string(),
   716                                                  self.log_date_time_string(),
   721                                                  self.log_date_time_string(),