<div dir="ltr"><br><br><div class="gmail_quote">On Fri, May 22, 2015 at 2:41 PM Drew Gottlieb <<a href="mailto:drgott@google.com">drgott@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Drew Gottlieb <<a href="mailto:drgott@google.com" target="_blank">drgott@google.com</a>><br>
# Date 1432330774 25200<br>
#      Fri May 22 14:39:34 2015 -0700<br>
# Node ID 5b93e1cbb45cde9ede354ec6473f22734e1311e1<br>
# Parent  f2b98dacb37ddd6713b11a1a871fcdbbc5fd8bb2<br>
match: fix bug in match.visitdir()<br>
<br>
There was a bug in my recent change to visitdir (8545bd381504) due to<br>
the stored generator being iterated over twice. Making the generator into a<br>
list at the start fixes this.<br>
<br>
diff --git a/mercurial/match.py b/mercurial/match.py<br>
--- a/mercurial/match.py<br>
+++ b/mercurial/match.py<br>
@@ -197,7 +197,7 @@<br>
         parentdirs = None<br>
         if (self._includeroots and dir not in self._includeroots and<br>
                 dir not in self._includedirs):<br>
-            parentdirs = util.finddirs(dir)<br>
+            parentdirs = list(util.finddirs(dir))<br></blockquote><div><br></div><div>To whomever will pick up this patch: It may or may not be faster to just call util.finddirs twice where it's used, but I'm planning to rewrite this piece of the function once I'm done with the match.files() stuff anyway (combining _fileroots and _includeroots), so I think it's fine to just accept this version without thinking too much about it.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
             if not any(parent in self._includeroots for parent in parentdirs):<br>
                 return False<br>
         return (not self._fileroots or '.' in self._fileroots or<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@selenic.com" target="_blank">Mercurial-devel@selenic.com</a><br>
<a href="http://selenic.com/mailman/listinfo/mercurial-devel" target="_blank">http://selenic.com/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div></div>