[PATCH 5 of 6 V1] opener: check exception for ENOENT

Adrian Buehlmann adrian at cadifra.com
Tue Jan 11 07:41:59 CST 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1294751416 -3600
# Node ID 883a56de3fe6ae2ccb5eed130c07c5a03e51710c
# Parent  205f5b4dfe515987cf29eb921f6d87d3e4076c62
opener: check exception for ENOENT

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -919,7 +919,9 @@ class opener(object):
                     fd = open(f)
                     nlink = nlinks(f)
                     fd.close()
-            except (OSError, IOError):
+            except (OSError, IOError), e:
+                if e.errno != errno.ENOENT:
+                    raise
                 nlink = 0
                 if not os.path.isdir(dirname):
                     makedirs(dirname, self.createmode)


More information about the Mercurial-devel mailing list