Show More
@@ -884,7 +884,13 b' class hgweb(object):' | |||
|
884 | 884 | req.write(self.filelog(self.filectx(req))) |
|
885 | 885 | |
|
886 | 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 | 894 | req.httphdr("application/mercurial-0.1", length=len(resp)) |
|
889 | 895 | req.write(resp) |
|
890 | 896 |
@@ -262,12 +262,11 b' class httprepository(remoterepository):' | |||
|
262 | 262 | fp.close() |
|
263 | 263 | |
|
264 | 264 | def lookup(self, key): |
|
265 | try: | |
|
266 | d = self.do_cmd("lookup", key = key).read() | |
|
267 | return bin(d[:-1]) | |
|
268 | except: | |
|
269 | self.ui.warn('Not able to look up revision named "%s"\n' % (key,)) | |
|
270 | raise | |
|
265 | d = self.do_cmd("lookup", key = key).read() | |
|
266 | success, data = d[:-1].split(' ', 1) | |
|
267 | if int(success): | |
|
268 | return bin(data) | |
|
269 | raise hg.RepoError(data) | |
|
271 | 270 | |
|
272 | 271 | def heads(self): |
|
273 | 272 | d = self.do_read("heads") |
General Comments 0
You need to be logged in to leave comments.
Login now