comparison mercurial/hgweb/hgweb_mod.py @ 2558:1120302009d7

hgweb: fix unbundle. After the WSGI changes, even if a push over HTTP succeeds, apache complains about "Premature end of script headers: hgwebdir.cgi" and returns a "HTTP Error 500: Internal Server Error", making the local hg abort. The change to either of the files touched by this patch is enough to fix this, but I think changing both is a more robust solution.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 03 Jul 2006 00:33:19 -0300
parents f4b7d71c1c60
children 0875cda033fd
comparison
equal deleted inserted replaced
2557:1727ff712a4e 2558:1120302009d7
930 old_stdout = sys.stdout 930 old_stdout = sys.stdout
931 sys.stdout = cStringIO.StringIO() 931 sys.stdout = cStringIO.StringIO()
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:
942 fp.close() 943 fp.close()
943 os.unlink(tempname) 944 os.unlink(tempname)