# HG changeset patch # User Pierre-Yves David # Date 1536855667 -7200 # Node ID 4ea2a813b82c3d0ea1d159e75337100631c18df5 # Parent 1630756a6a468e375db901648ab2e5a8ac452c86 obscache: ignore permission and OS errors when writing In practice we always update this cache along side a new transaction, with lock taken so permission issues should not happens. However, staying on the safe side is better. Errors during Cache update should not block Mercurial operations. diff -r 1630756a6a46 -r 4ea2a813b82c hgext3rd/evolve/obscache.py --- a/hgext3rd/evolve/obscache.py Thu Sep 13 02:49:58 2018 +0200 +++ b/hgext3rd/evolve/obscache.py Thu Sep 13 18:21:07 2018 +0200 @@ -404,11 +404,14 @@ if self._cachekey is None or self._cachekey == self._ondiskkey: return - cachefile = self._vfs(self._filepath, 'w', atomictemp=True) - headerdata = struct.pack(self._headerformat, *self._cachekey) - cachefile.write(headerdata) - cachefile.write(self._data) - cachefile.close() + try: + cachefile = self._vfs(self._filepath, 'w', atomictemp=True) + headerdata = struct.pack(self._headerformat, *self._cachekey) + cachefile.write(headerdata) + cachefile.write(self._data) + cachefile.close() + except (IOError, OSError) as exc: + repo.ui.debug('obscache: could not write update %s\n' % exc) def load(self, repo): """load data from disk"""