comparison mercurial/sshserver.py @ 3447:ef1032c223e7

sshrepo: add passing of lookup exceptions
author Eric Hopper <hopper@omnifarious.org>
date Sat, 09 Sep 2006 18:25:06 -0700
parents 0b450267cf47
children abaee83ce0a6
comparison
equal deleted inserted replaced
3446:0b450267cf47 3447:ef1032c223e7
49 return cmd != '' 49 return cmd != ''
50 50
51 def do_lookup(self): 51 def do_lookup(self):
52 arg, key = self.getarg() 52 arg, key = self.getarg()
53 assert arg == 'key' 53 assert arg == 'key'
54 self.respond(hex(self.repo.lookup(key)) + "\n") 54 try:
55 r = hex(self.repo.lookup(key))
56 success = 1
57 except Exception,inst:
58 r = str(inst)
59 success = 0
60 self.respond("%s %s\n" % (success, r))
55 61
56 def do_heads(self): 62 def do_heads(self):
57 h = self.repo.heads() 63 h = self.repo.heads()
58 self.respond(" ".join(map(hex, h)) + "\n") 64 self.respond(" ".join(map(hex, h)) + "\n")
59 65