##// END OF EJS Templates
revlog: make try block smaller...
Manuel Jacob -
r50142:3e5f1fb2 default
parent child Browse files
Show More
@@ -1525,10 +1525,13 b' class revlog:'
1525 return self._pcache[id]
1525 return self._pcache[id]
1526
1526
1527 if len(id) <= 40:
1527 if len(id) <= 40:
1528 # hex(node)[:...]
1529 l = len(id) // 2 * 2 # grab an even number of digits
1528 try:
1530 try:
1529 # hex(node)[:...]
1530 l = len(id) // 2 * 2 # grab an even number of digits
1531 prefix = bin(id[:l])
1531 prefix = bin(id[:l])
1532 except TypeError:
1533 pass
1534 else:
1532 nl = [e[7] for e in self.index if e[7].startswith(prefix)]
1535 nl = [e[7] for e in self.index if e[7].startswith(prefix)]
1533 nl = [
1536 nl = [
1534 n for n in nl if hex(n).startswith(id) and self.hasnode(n)
1537 n for n in nl if hex(n).startswith(id) and self.hasnode(n)
@@ -1545,8 +1548,6 b' class revlog:'
1545 if maybewdir:
1548 if maybewdir:
1546 raise error.WdirUnsupported
1549 raise error.WdirUnsupported
1547 return None
1550 return None
1548 except TypeError:
1549 pass
1550
1551
1551 def lookup(self, id):
1552 def lookup(self, id):
1552 """locate a node based on:
1553 """locate a node based on:
General Comments 0
You need to be logged in to leave comments. Login now