# HG changeset patch # User Anton Shestakov # Date 1554558562 -7200 # Node ID faf99d48eda991e3f693d2e9ac7cf4b452370293 # Parent f0bda6a6d93bd2f6b6cfb6bf6780acb0d69e4ab8 stack: fix phasecache._phasesets check logic When _phasesets is not None, it's a list, and it contains set()s of revisions in a specific phase, starting from public, draft, secret and so on. But since repos are supposed to have the majority of revisions in public phase, the first element of this list is not a (potentially huge) set, but None. Previously this code tried to check if there's any element that is None, and was always finding None at index 0, so the short path was executed every time and the rest of the function was never used. diff -r f0bda6a6d93b -r faf99d48eda9 hgext3rd/topic/stack.py --- a/hgext3rd/topic/stack.py Tue Apr 02 12:41:57 2019 +0530 +++ b/hgext3rd/topic/stack.py Sat Apr 06 15:49:22 2019 +0200 @@ -42,8 +42,8 @@ The intend is to build something more efficient than what revsets do in this area. """ - phasecache = repo._phasecache - if not phasecache._phasesets or None in phasecache._phasesets: + phasesets = repo._phasecache._phasesets + if not phasesets or None in phasesets[phases.draft:]: return repo.revs('(not public()) - obsolete()') result = set()