tags: silence hgtagsfnodes reading failures
tryread() doesn't handle "is a directory" errors and presumably
others. We might not want to globally swallow such tryread errors, so
we replace with our own try/except handling.
An upcoming test will use directories as a portable stand-in for
various bizarre circumstances that cache read/write code should be
robust to.
--- a/mercurial/tags.py Thu Apr 28 15:35:54 2016 -0500
+++ b/mercurial/tags.py Thu Apr 28 15:40:43 2016 -0500
@@ -432,7 +432,10 @@
self._raw = array('c')
- data = repo.vfs.tryread(_fnodescachefile)
+ try:
+ data = repo.vfs.read(_fnodescachefile)
+ except (OSError, IOError):
+ data = ""
self._raw.fromstring(data)
# The end state of self._raw is an array that is of the exact length