# HG changeset patch # User Matt Mackall # Date 2016-04-28 20:40:43 # Node ID e3055b46ed1b927f11cf3d74acb83b04b304e657 # Parent a9dd92c48a1c653045df2aa55b87079ce70624b3 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. diff --git a/mercurial/tags.py b/mercurial/tags.py --- a/mercurial/tags.py +++ b/mercurial/tags.py @@ -432,7 +432,10 @@ class hgtagsfnodescache(object): 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