# HG changeset patch # User Pierre-Yves David # Date 1536851285 -7200 # Node ID 84b203a6078890a5403e35f8a341cd02ee0fc09e # Parent c9fc82c4e66d1d24ed28e709999b712eeb7360f6 depthcache: ignore permission and OS errors when writing This cache is related to the obshashrange one and we update it lazily by default. This can be an issue when pulling locally from a read only repository that was not configured for a more aggressive cache warming. The raised permission error was uncaught and could crash the whole process. Errors during Cache update should not block Mercurial operations. diff -r c9fc82c4e66d -r 84b203a60788 hgext3rd/evolve/depthcache.py --- a/hgext3rd/evolve/depthcache.py Thu Sep 13 18:20:50 2018 +0200 +++ b/hgext3rd/evolve/depthcache.py Thu Sep 13 17:08:05 2018 +0200 @@ -198,9 +198,12 @@ if self._cachekey is None or self._cachekey == self._ondiskkey: return - cachevfs = compat.getcachevfs(repo) - cachefile = cachevfs(self._filepath, 'w', atomictemp=True) - headerdata = self._serializecachekey() - cachefile.write(headerdata) - cachefile.write(self._data.tostring()) - cachefile.close() + try: + cachevfs = compat.getcachevfs(repo) + cachefile = cachevfs(self._filepath, 'w', atomictemp=True) + headerdata = self._serializecachekey() + cachefile.write(headerdata) + cachefile.write(self._data.tostring()) + cachefile.close() + except (IOError, OSError) as exc: + repo.ui.debug('depthcache: could not write update %s\n' % exc)