store: only one kind of OSError means "nonexistent entry" stable
authorBryan O'Sullivan <bryano@fb.com>
Wed, 15 Aug 2012 16:31:25 -0700
branchstable
changeset 17374 0cec762790ed
parent 17373 4cbb1137941d
child 17375 499e284f3f32
child 17378 b05e517c2236
child 17441 cb12d3ce5607
store: only one kind of OSError means "nonexistent entry"
mercurial/store.py
--- a/mercurial/store.py	Wed Aug 15 16:30:32 2012 -0700
+++ b/mercurial/store.py	Wed Aug 15 16:31:25 2012 -0700
@@ -7,7 +7,7 @@
 
 from i18n import _
 import osutil, scmutil, util
-import os, stat
+import os, stat, errno
 
 _sha = util.sha1
 
@@ -403,7 +403,9 @@
             try:
                 yield f, ef, self.getsize(ef)
                 existing.append(f)
-            except OSError:
+            except OSError, err:
+                if err.errno != errno.ENOENT:
+                    raise
                 # nonexistent entry
                 rewrite = True
         if rewrite: