# HG changeset patch # User Idan Kamara # Date 2011-06-15 20:15:04 # Node ID 001788ef4bbb8aa2ad1f3d5788c0740a17a6560e # Parent e4cfdff6d3f40d25eb5a4117112ba4a8e8d7dfb4 localrepo: don't attempt to open .hgtags twice if the error isn't ENOENT diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -272,7 +272,9 @@ class localrepository(repo.repository): try: fp = self.wfile('.hgtags', 'rb+') - except IOError: + except IOError, e: + if e.errno != errno.ENOENT: + raise fp = self.wfile('.hgtags', 'ab') else: prevtags = fp.read()