[PATCH STABLE?] dirstate: propagate IOError other than ENOENT when reading branch

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Jan 7 07:52:33 CST 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1325831879 -3600
# Node ID 7058a6c38ba712ca1560c2fe9f4212d58bae5a93
# Parent  83a140752239f6a1e834f00932275c615a2b9e36
dirstate: propagate IOError other than ENOENT when reading branch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -4,6 +4,7 @@
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
+import errno
 
 from node import nullid
 from i18n import _
@@ -80,7 +81,9 @@
     def _branch(self):
         try:
             return self._opener.read("branch").strip() or "default"
-        except IOError:
+        except IOError, inst:
+            if inst.errno != errno.ENOENT:
+                raise
             return "default"
 
     @propertycache


More information about the Mercurial-devel mailing list