# HG changeset patch # User Drew Gottlieb # Date 2015-05-22 21:39:34 # Node ID f9a29dc964a34318be1a72ef92e422a6e242a392 # Parent 4311e78a4609ec0df4b3b0a75ab6d130e5df258c match: fix bug in match.visitdir() There was a bug in my recent change to visitdir (8545bd381504) due to the stored generator being iterated over twice. Making the generator into a list at the start fixes this. diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -197,7 +197,7 @@ class match(object): parentdirs = None if (self._includeroots and dir not in self._includeroots and dir not in self._includedirs): - parentdirs = util.finddirs(dir) + parentdirs = list(util.finddirs(dir)) if not any(parent in self._includeroots for parent in parentdirs): return False return (not self._fileroots or '.' in self._fileroots or