##// END OF EJS Templates
wrap string literals in error messages
Martin Geisler -
r8663:45f626a3 default
parent child Browse files
Show More
@@ -68,7 +68,8 b' class hgweb(object):'
68
68
69 def run(self):
69 def run(self):
70 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
70 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
71 raise RuntimeError("This function is only intended to be called while running as a CGI script.")
71 raise RuntimeError("This function is only intended to be "
72 "called while running as a CGI script.")
72 import mercurial.hgweb.wsgicgi as wsgicgi
73 import mercurial.hgweb.wsgicgi as wsgicgi
73 wsgicgi.launch(self)
74 wsgicgi.launch(self)
74
75
@@ -92,7 +92,8 b' class hgwebdir(object):'
92
92
93 def run(self):
93 def run(self):
94 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
94 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
95 raise RuntimeError("This function is only intended to be called while running as a CGI script.")
95 raise RuntimeError("This function is only intended to be "
96 "called while running as a CGI script.")
96 import mercurial.hgweb.wsgicgi as wsgicgi
97 import mercurial.hgweb.wsgicgi as wsgicgi
97 wsgicgi.launch(self)
98 wsgicgi.launch(self)
98
99
@@ -69,8 +69,8 b' class _hgwebhandler(object, BaseHTTPServ'
69 self._start_response("500 Internal Server Error", [])
69 self._start_response("500 Internal Server Error", [])
70 self._write("Internal Server Error")
70 self._write("Internal Server Error")
71 tb = "".join(traceback.format_exception(*sys.exc_info()))
71 tb = "".join(traceback.format_exception(*sys.exc_info()))
72 self.log_error("Exception happened during processing request '%s':\n%s",
72 self.log_error("Exception happened during processing "
73 self.path, tb)
73 "request '%s':\n%s", self.path, tb)
74
74
75 def do_GET(self):
75 def do_GET(self):
76 self.do_POST()
76 self.do_POST()
@@ -126,7 +126,8 b' class _hgwebhandler(object, BaseHTTPServ'
126
126
127 def send_headers(self):
127 def send_headers(self):
128 if not self.saved_status:
128 if not self.saved_status:
129 raise AssertionError("Sending headers before start_response() called")
129 raise AssertionError("Sending headers before "
130 "start_response() called")
130 saved_status = self.saved_status.split(None, 1)
131 saved_status = self.saved_status.split(None, 1)
131 saved_status[0] = int(saved_status[0])
132 saved_status[0] = int(saved_status[0])
132 self.send_response(*saved_status)
133 self.send_response(*saved_status)
@@ -163,7 +164,8 b' class _hgwebhandler(object, BaseHTTPServ'
163 self.send_headers()
164 self.send_headers()
164 if self.length is not None:
165 if self.length is not None:
165 if len(data) > self.length:
166 if len(data) > self.length:
166 raise AssertionError("Content-length header sent, but more bytes than specified are being written.")
167 raise AssertionError("Content-length header sent, but more "
168 "bytes than specified are being written.")
167 self.length = self.length - len(data)
169 self.length = self.length - len(data)
168 self.wfile.write(data)
170 self.wfile.write(data)
169 self.wfile.flush()
171 self.wfile.flush()
@@ -1402,7 +1402,9 b' class localrepository(repo.repository):'
1402 cg = remote.changegroup(fetch, 'pull')
1402 cg = remote.changegroup(fetch, 'pull')
1403 else:
1403 else:
1404 if not remote.capable('changegroupsubset'):
1404 if not remote.capable('changegroupsubset'):
1405 raise util.Abort(_("Partial pull cannot be done because other repository doesn't support changegroupsubset."))
1405 raise util.Abort(_("Partial pull cannot be done because "
1406 "other repository doesn't support "
1407 "changegroupsubset."))
1406 cg = remote.changegroupsubset(fetch, heads, 'pull')
1408 cg = remote.changegroupsubset(fetch, heads, 'pull')
1407 return self.addchangegroup(cg, 'pull', remote.url())
1409 return self.addchangegroup(cg, 'pull', remote.url())
1408 finally:
1410 finally:
General Comments 0
You need to be logged in to leave comments. Login now