##// END OF EJS Templates
hgweb: fix unbundle....
Alexis S. L. Carvalho -
r2558:11203020 default
parent child Browse files
Show More
@@ -932,10 +932,11 b' class hgweb(object):'
932
932
933 try:
933 try:
934 ret = self.repo.addchangegroup(fp, 'serve')
934 ret = self.repo.addchangegroup(fp, 'serve')
935 req.write('%d\n' % ret)
936 req.write(sys.stdout.getvalue())
937 finally:
935 finally:
936 val = sys.stdout.getvalue()
938 sys.stdout = old_stdout
937 sys.stdout = old_stdout
938 req.write('%d\n' % ret)
939 req.write(val)
939 finally:
940 finally:
940 lock.release()
941 lock.release()
941 finally:
942 finally:
@@ -27,6 +27,7 b' def launch(application):'
27
27
28 headers_set = []
28 headers_set = []
29 headers_sent = []
29 headers_sent = []
30 out = sys.stdout
30
31
31 def write(data):
32 def write(data):
32 if not headers_set:
33 if not headers_set:
@@ -35,13 +36,13 b' def launch(application):'
35 elif not headers_sent:
36 elif not headers_sent:
36 # Before the first output, send the stored headers
37 # Before the first output, send the stored headers
37 status, response_headers = headers_sent[:] = headers_set
38 status, response_headers = headers_sent[:] = headers_set
38 sys.stdout.write('Status: %s\r\n' % status)
39 out.write('Status: %s\r\n' % status)
39 for header in response_headers:
40 for header in response_headers:
40 sys.stdout.write('%s: %s\r\n' % header)
41 out.write('%s: %s\r\n' % header)
41 sys.stdout.write('\r\n')
42 out.write('\r\n')
42
43
43 sys.stdout.write(data)
44 out.write(data)
44 sys.stdout.flush()
45 out.flush()
45
46
46 def start_response(status,response_headers,exc_info=None):
47 def start_response(status,response_headers,exc_info=None):
47 if exc_info:
48 if exc_info:
General Comments 0
You need to be logged in to leave comments. Login now