# HG changeset patch # User Augie Fackler # Date 2017-03-12 01:53:20 # Node ID 1470b0f771c8d78896c5c2965ed87f6f3562b527 # Parent 66f1c244b43a962e3224420f30eaa0b2e0980244 phases: explicitly evaluate list returned by map On Python 3 map() returns a generator, which bool()s to true even if it had an empty input set. Work around this by using list() on the map() result. diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -213,7 +213,7 @@ class phasecache(object): self._phaserevs = revs self._populatephaseroots(repo) for phase in trackedphases: - roots = map(repo.changelog.rev, self.phaseroots[phase]) + roots = list(map(repo.changelog.rev, self.phaseroots[phase])) if roots: for rev in roots: revs[rev] = phase