comparison mercurial/httprepo.py @ 3451: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
comparison
equal deleted inserted replaced
3450:3505fcd5a231 3451:233c733e4af5
260 finally: 260 finally:
261 # if using keepalive, allow connection to be reused 261 # if using keepalive, allow connection to be reused
262 fp.close() 262 fp.close()
263 263
264 def lookup(self, key): 264 def lookup(self, key):
265 try: 265 d = self.do_cmd("lookup", key = key).read()
266 d = self.do_cmd("lookup", key = key).read() 266 success, data = d[:-1].split(' ', 1)
267 return bin(d[:-1]) 267 if int(success):
268 except: 268 return bin(data)
269 self.ui.warn('Not able to look up revision named "%s"\n' % (key,)) 269 raise hg.RepoError(data)
270 raise
271 270
272 def heads(self): 271 def heads(self):
273 d = self.do_read("heads") 272 d = self.do_read("heads")
274 try: 273 try:
275 return map(bin, d[:-1].split(" ")) 274 return map(bin, d[:-1].split(" "))