# HG changeset patch # User Matt Mackall # Date 2011-11-06 17:57:24 # Node ID ccb7de21625a6a29af7dd02b82ef2dd15f6e79e2 # Parent cf729af2696347d622dd2aec484d61c9371af613 phases: handle errors other than ENOENT appropriately diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -7,6 +7,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, bin, hex allphases = range(2) @@ -24,8 +25,9 @@ def readroots(repo): roots[int(phase)].add(bin(nh)) finally: f.close() - except IOError: - pass # default value are enough + except IOError, inst: + if inst.errno != errno.ENOENT: + raise return roots def writeroots(repo):