mercurial/repoview.py
branchstable
changeset 29040 a4dc5fe7bf54
parent 28780 faff8c2b5ee3
child 29341 0d83ad967bf8
equal deleted inserted replaced
29039:e3055b46ed1b 29040:a4dc5fe7bf54
   128         wlock = repo.wlock(wait=False)
   128         wlock = repo.wlock(wait=False)
   129         # write cache to file
   129         # write cache to file
   130         newhash = cachehash(repo, hideable)
   130         newhash = cachehash(repo, hideable)
   131         fh = repo.vfs.open(cachefile, 'w+b', atomictemp=True)
   131         fh = repo.vfs.open(cachefile, 'w+b', atomictemp=True)
   132         _writehiddencache(fh, newhash, hidden)
   132         _writehiddencache(fh, newhash, hidden)
       
   133         fh.close()
   133     except (IOError, OSError):
   134     except (IOError, OSError):
   134         repo.ui.debug('error writing hidden changesets cache\n')
   135         repo.ui.debug('error writing hidden changesets cache\n')
   135     except error.LockHeld:
   136     except error.LockHeld:
   136         repo.ui.debug('cannot obtain lock to write hidden changesets cache\n')
   137         repo.ui.debug('cannot obtain lock to write hidden changesets cache\n')
   137     finally:
   138     finally:
   138         if fh:
       
   139             fh.close()
       
   140         if wlock:
   139         if wlock:
   141             wlock.release()
   140             wlock.release()
   142 
   141 
   143 def tryreadcache(repo, hideable):
   142 def tryreadcache(repo, hideable):
   144     """read a cache if the cache exists and is valid, otherwise returns None."""
   143     """read a cache if the cache exists and is valid, otherwise returns None."""