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.
#require test-repo pyflakes
Copied from Mercurial core (60ee2593a270)
$ cd "`dirname "$TESTDIR"`"
run pyflakes on all tracked files ending in .py or without a file ending
(skipping binary file random-seed)
$ hg locate -I 'set:(**.py or grep("^#!.*python")) - removed()' 2>/dev/null \
> | xargs pyflakes 2>/dev/null