localrepo: don't attempt to open .hgtags twice if the error isn't ENOENT
authorIdan Kamara <idankk86@gmail.com>
Wed, 15 Jun 2011 23:15:04 +0300
changeset 14646 001788ef4bbb
parent 14645 e4cfdff6d3f4
child 14647 2e9f379de0ac
localrepo: don't attempt to open .hgtags twice if the error isn't ENOENT
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Thu Jun 16 01:58:00 2011 +0200
+++ b/mercurial/localrepo.py	Wed Jun 15 23:15:04 2011 +0300
@@ -272,7 +272,9 @@
 
         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()