Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:48 -0800] rev 27866
with: use context manager for transaction in rebase
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:47 -0800] rev 27865
with: use context manager for transaction in qimport
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:47 -0800] rev 27864
with: use context manager for transaction in qfinish
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:47 -0800] rev 27863
with: use context manager for transaction in mercurial_sink
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:47 -0800] rev 27862
transaction: turn a transaction into a Python context manager
This lets us greatly simply acquire/release cycles.
If the block completes without raising an exception, the transaction
is closed.
Code pattern before:
try:
tr = repo.transaction('x')
# zillions of lines of code
tr.close()
finally:
tr.release()
And after:
with tr.transaction('x'):
# ...
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27861
with: use context manager for lock in pushphase
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27860
with: use context manager in rebuildfncache again
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27859
with: use context manager in streamclone consumev1
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27858
with: use context manager in manifest
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27857
with: use context manager in rename
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27856
with: use context manager in resolve
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27855
with: use context manager in unbundle
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27854
with: use context manager in update
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27853
with: use context manager in bisect save_state
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27852
with: use context manager in merge update
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27851
with: use context manager in _markchanges
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27850
with: use context manager in maybeperformlegacystreamclone
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:49 -0800] rev 27849
with: use context manager in verify
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:50 -0800] rev 27848
with: use context manager in qrename
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:50 -0800] rev 27847
with: use context manager in qfinish
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:50 -0800] rev 27846
with: use context manager in localrepo recover
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:50 -0800] rev 27845
with: use context manager in streamclone generatev1
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:50 -0800] rev 27844
with: use context manager in subrepo storeclean
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:50 -0800] rev 27843
with: use context manager in subrepo _cachestorehash
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:50 -0800] rev 27842
with: use context manager in largefiles commit
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:50 -0800] rev 27841
with: use context manager in unshelveabort
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:47 -0800] rev 27840
with: use context manager for wlock in transplant
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:47 -0800] rev 27839
with: use context manager for wlock in shelve stripcmd
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:47 -0800] rev 27838
with: use context manager for lock in continue
Bryan O'Sullivan <bryano@fb.com> [Fri, 15 Jan 2016 13:14:47 -0800] rev 27837
with: use context manager for wlock in unshelve