<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 10, 2013 at 9:44 PM, Durham Goode <span dir="ltr"><<a href="mailto:durham@fb.com" target="_blank">durham@fb.com</a>></span> 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 Durham Goode <<a href="mailto:durham@fb.com">durham@fb.com</a>><br>
# Date 1360527819 28800<br>
# Node ID 9c384e0ef7f5c860ea774bbdc5e0c30e3e7421e8<br>
# Parent  013fcd112f13f31a35ea6a40d8cd1c6923cdaf20<br>
dirstate: fix generator/list error when using python 2.7<br>
<br>
util.statfiles returns a generator on python 2.7 with c extensions disabled.<br>
This caused util.statfiles(...) [0] to break in tests. Since we're only<br>
stat'ing one file, I just changed it to call lstat directly.<br>
<br>
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py<br>
--- a/mercurial/dirstate.py<br>
+++ b/mercurial/dirstate.py<br>
@@ -687,7 +687,11 @@<br>
                     # Report ignored items in the dmap as long as they are not<br>
                     # under a symlink directory.<br>
                     if ignore(nf) and audit_path.check(nf):<br>
-                        results[nf] = util.statfiles([join(nf)])[0]<br>
+                        try:<br>
+                            results[nf] = lstat(join(nf))<br>
+                        except OSError:<br>
+                            # file doesn't exist<br></blockquote><div><br></div><div style>If that's what you actually want to catch (like what was done previously), you need to check errno for ENOENT</div><div style>

 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                            results[nf] = None<br>
                     else:<br>
                         # It's either missing or under a symlink directory<br>
                         results[nf] = None<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@selenic.com">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><br></div></div>