mercurial/bookmarks.py
changeset 27685 9fbae70faf65
parent 27276 38024b75241a
child 27698 dad6404ccddb
--- a/mercurial/bookmarks.py	Thu Dec 17 21:24:08 2015 -0500
+++ b/mercurial/bookmarks.py	Tue Dec 01 13:08:05 2015 -0500
@@ -165,10 +165,19 @@
             raise
         return None
     try:
-        # No readline() in osutil.posixfile, reading everything is cheap
+        # No readline() in osutil.posixfile, reading everything is
+        # cheap.
+        # Note that it's possible for readlines() here to raise
+        # IOError, since we might be reading the active mark over
+        # static-http which only tries to load the file when we try
+        # to read from it.
         mark = encoding.tolocal((file.readlines() or [''])[0])
         if mark == '' or mark not in repo._bookmarks:
             mark = None
+    except IOError as inst:
+        if inst.errno != errno.ENOENT:
+            raise
+        return None
     finally:
         file.close()
     return mark