##// END OF EJS Templates
repoview: use try/except/finally
Matt Mackall -
r25086:140c2d1e default
parent child Browse files
Show More
@@ -115,16 +115,15 b' def trywritehiddencache(repo, hideable, '
115 115 """
116 116 wlock = fh = None
117 117 try:
118 try:
119 wlock = repo.wlock(wait=False)
120 # write cache to file
121 newhash = cachehash(repo, hideable)
122 fh = repo.vfs.open(cachefile, 'w+b', atomictemp=True)
123 _writehiddencache(fh, newhash, hidden)
124 except (IOError, OSError):
125 repo.ui.debug('error writing hidden changesets cache')
126 except error.LockHeld:
127 repo.ui.debug('cannot obtain lock to write hidden changesets cache')
118 wlock = repo.wlock(wait=False)
119 # write cache to file
120 newhash = cachehash(repo, hideable)
121 fh = repo.vfs.open(cachefile, 'w+b', atomictemp=True)
122 _writehiddencache(fh, newhash, hidden)
123 except (IOError, OSError):
124 repo.ui.debug('error writing hidden changesets cache')
125 except error.LockHeld:
126 repo.ui.debug('cannot obtain lock to write hidden changesets cache')
128 127 finally:
129 128 if fh:
130 129 fh.close()
General Comments 0
You need to be logged in to leave comments. Login now