Mercurial > hg
comparison mercurial/ancestor.py @ 38595:f8b46245b26a
py3: make 'None in lazyancestors' not crash
This looks somewhat weird, but we have callers like 'torev(n) in futurecommon'
around where torev(n) is dictlike.get(n). I could fix callers, but that would
be unnecessarily verbose.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 08 Jul 2018 17:17:54 +0900 |
parents | bd872f64a8ba |
children | e7aa113b14f7 |
comparison
equal
deleted
inserted
replaced
38594:b263133eeb5a | 38595:f8b46245b26a |
---|---|
337 # heap and seen set is complex enough that it slows down both. Keep | 337 # heap and seen set is complex enough that it slows down both. Keep |
338 # them separate. | 338 # them separate. |
339 seen = self._containsseen | 339 seen = self._containsseen |
340 if target in seen: | 340 if target in seen: |
341 return True | 341 return True |
342 # Only integer target is valid, but some callers expect 'None in self' | |
343 # to be False. So we explicitly allow it. | |
344 if target is None: | |
345 return False | |
342 | 346 |
343 parentrevs = self._parentrevs | 347 parentrevs = self._parentrevs |
344 visit = self._containsvisit | 348 visit = self._containsvisit |
345 stoprev = self._stoprev | 349 stoprev = self._stoprev |
346 heappop = heapq.heappop | 350 heappop = heapq.heappop |