Mercurial > hg > mercurial-crew
comparison mercurial/repair.py @ 28526:f1c316fd91f9
with: use context manager in rebuildfncache
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 15 Jan 2016 13:14:49 -0800 |
parents | 0da102e4f203 |
children | 60ea60fea5f3 |
comparison
equal
deleted
inserted
replaced
28525:ed9950ba091e | 28526:f1c316fd91f9 |
---|---|
294 ui.write(_('%d items added, %d removed from fncache\n') % | 294 ui.write(_('%d items added, %d removed from fncache\n') % |
295 (addcount, removecount)) | 295 (addcount, removecount)) |
296 fnc.entries = newentries | 296 fnc.entries = newentries |
297 fnc._dirty = True | 297 fnc._dirty = True |
298 | 298 |
299 tr = repo.transaction('fncache') | 299 with repo.transaction('fncache') as tr: |
300 try: | |
301 fnc.write(tr) | 300 fnc.write(tr) |
302 tr.close() | |
303 finally: | |
304 tr.release() | |
305 else: | 301 else: |
306 ui.write(_('fncache already up to date\n')) | 302 ui.write(_('fncache already up to date\n')) |
307 | 303 |
308 def stripbmrevset(repo, mark): | 304 def stripbmrevset(repo, mark): |
309 """ | 305 """ |