dirstate: fix generator/list error when using python 2.7
authorDurham Goode <durham@fb.com>
Sun, 10 Feb 2013 12:23:39 -0800
changeset 18663 05cf40f9b0ec
parent 18662 c5f7e83d47cd
child 18664 30d899febef8
dirstate: fix generator/list error when using python 2.7 util.statfiles returns a generator on python 2.7 with c extensions disabled. This caused util.statfiles(...) [0] to break in tests. Since we're only stat'ing one file, I just changed it to call lstat directly.
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Mon Feb 11 16:21:48 2013 +0100
+++ b/mercurial/dirstate.py	Sun Feb 10 12:23:39 2013 -0800
@@ -703,7 +703,11 @@
                     # Report ignored items in the dmap as long as they are not
                     # under a symlink directory.
                     if ignore(nf) and audit_path.check(nf):
-                        results[nf] = util.statfiles([join(nf)])[0]
+                        try:
+                            results[nf] = lstat(join(nf))
+                        except OSError:
+                            # file doesn't exist
+                            results[nf] = None
                     else:
                         # It's either missing or under a symlink directory
                         results[nf] = None