Show More
@@ -98,6 +98,7 b' class lazymap:' | |||||
98 | self.p.load() |
|
98 | self.p.load() | |
99 | return key in self.p.map |
|
99 | return key in self.p.map | |
100 | def __iter__(self): |
|
100 | def __iter__(self): | |
|
101 | yield nullid | |||
101 | for i in xrange(self.p.l): |
|
102 | for i in xrange(self.p.l): | |
102 | try: |
|
103 | try: | |
103 | yield self.p.index[i][6] |
|
104 | yield self.p.index[i][6] | |
@@ -192,12 +193,14 b' class revlog:' | |||||
192 | def lookup(self, id): |
|
193 | def lookup(self, id): | |
193 | try: |
|
194 | try: | |
194 | rev = int(id) |
|
195 | rev = int(id) | |
195 |
if str(rev) != id: raise |
|
196 | if str(rev) != id: raise ValueError | |
|
197 | if rev < 0: rev = self.count() + rev | |||
|
198 | if rev < 0 or rev >= self.count: raise ValueError | |||
196 | return self.node(rev) |
|
199 | return self.node(rev) | |
197 | except: |
|
200 | except (ValueError, OverflowError): | |
198 | c = [] |
|
201 | c = [] | |
199 | for n in self.nodemap: |
|
202 | for n in self.nodemap: | |
200 |
if |
|
203 | if hex(n).startswith(id): | |
201 | c.append(n) |
|
204 | c.append(n) | |
202 | if len(c) > 1: raise KeyError("Ambiguous identifier") |
|
205 | if len(c) > 1: raise KeyError("Ambiguous identifier") | |
203 | if len(c) < 1: raise KeyError("No match found") |
|
206 | if len(c) < 1: raise KeyError("No match found") |
General Comments 0
You need to be logged in to leave comments.
Login now