##// END OF EJS Templates
sshrepo: add passing of lookup exceptions
Eric Hopper -
r3447:ef1032c2 default
parent child Browse files
Show More
@@ -133,9 +133,14 b' class sshrepository(remoterepository):'
133
133
134 def lookup(self, key):
134 def lookup(self, key):
135 d = self.call("lookup", key=key)
135 d = self.call("lookup", key=key)
136 success, data = d[:-1].split(" ", 1)
136 try:
137 try:
137 return bin(d[:-1])
138 if int(success):
139 return bin(data)
140 else:
141 raise data
138 except:
142 except:
143 raise
139 raise hg.RepoError("unexpected response '%s'" % (d[:400] + "..."))
144 raise hg.RepoError("unexpected response '%s'" % (d[:400] + "..."))
140
145
141 def heads(self):
146 def heads(self):
@@ -51,7 +51,13 b' class sshserver(object):'
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()
General Comments 0
You need to be logged in to leave comments. Login now