# HG changeset patch # User Pierre-Yves David # Date 2012-01-06 06:37:59 # Node ID e43c140eb08fed717ff26cd45c2dc92db7778e39 # Parent e6c44dbe902ff17b8e966b1a2e668b91c914337b 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 @@ class dirstate(object): 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