comparison mercurial/hgweb/hgweb_mod.py @ 3445:233c733e4af5

httprepo: add support for passing lookup exception data
author Matt Mackall <mpm@selenic.com>
date Wed, 18 Oct 2006 02:08:36 -0500
parents 3505fcd5a231
children 0e68608bd11d
comparison
equal deleted inserted replaced
3444:3505fcd5a231 3445:233c733e4af5
882 882
883 def do_filelog(self, req): 883 def do_filelog(self, req):
884 req.write(self.filelog(self.filectx(req))) 884 req.write(self.filelog(self.filectx(req)))
885 885
886 def do_lookup(self, req): 886 def do_lookup(self, req):
887 resp = hex(self.repo.lookup(req.form['key'][0])) + "\n" 887 try:
888 r = hex(self.repo.lookup(req.form['key'][0]))
889 success = 1
890 except Exception,inst:
891 r = str(inst)
892 success = 0
893 resp = "%s %s\n" % (success, r)
888 req.httphdr("application/mercurial-0.1", length=len(resp)) 894 req.httphdr("application/mercurial-0.1", length=len(resp))
889 req.write(resp) 895 req.write(resp)
890 896
891 def do_heads(self, req): 897 def do_heads(self, req):
892 resp = " ".join(map(hex, self.repo.heads())) + "\n" 898 resp = " ".join(map(hex, self.repo.heads())) + "\n"