##// END OF EJS Templates
simplestore: shore up lookup errors...
Gregory Szorc -
r37426:dd275372 default
parent child Browse files
Show More
@@ -152,8 +152,10 b' class filestorage(object):'
152 def rev(self, node):
152 def rev(self, node):
153 validatenode(node)
153 validatenode(node)
154
154
155 # Will raise KeyError.
155 try:
156 self._indexbynode[node]
156 self._indexbynode[node]
157 except KeyError:
158 raise error.LookupError(node, self._indexpath, _('no node'))
157
159
158 for rev, entry in self._indexbyrev.items():
160 for rev, entry in self._indexbyrev.items():
159 if entry[b'node'] == node:
161 if entry[b'node'] == node:
@@ -171,11 +173,8 b' class filestorage(object):'
171 return self.node(node)
173 return self.node(node)
172
174
173 if len(node) == 20:
175 if len(node) == 20:
174 try:
176 self.rev(node)
175 self.rev(node)
177 return node
176 return node
177 except LookupError:
178 pass
179
178
180 try:
179 try:
181 rev = int(node)
180 rev = int(node)
@@ -196,10 +195,10 b' class filestorage(object):'
196 rawnode = bin(node)
195 rawnode = bin(node)
197 self.rev(rawnode)
196 self.rev(rawnode)
198 return rawnode
197 return rawnode
199 except (TypeError, LookupError):
198 except TypeError:
200 pass
199 pass
201
200
202 raise LookupError(node, self._path, _('invalid lookup input'))
201 raise error.LookupError(node, self._path, _('invalid lookup input'))
203
202
204 def linkrev(self, rev):
203 def linkrev(self, rev):
205 validaterev(rev)
204 validaterev(rev)
@@ -280,8 +279,6 b' class filestorage(object):'
280 if node == nullid:
279 if node == nullid:
281 return b''
280 return b''
282
281
283 self._indexbynode[node]
284
285 rev = self.rev(node)
282 rev = self.rev(node)
286 flags = self.flags(rev)
283 flags = self.flags(rev)
287
284
General Comments 0
You need to be logged in to leave comments. Login now