# HG changeset patch # User Bryan O'Sullivan # Date 1452892487 28800 # Node ID 4b8e3ffee94f5152e6afb563aec8dff582f3f926 # Parent ed59ae8b025e35c1c7f4f29e91ecaec898bf8326 with: use context manager for transaction in qfinish diff -r ed59ae8b025e -r 4b8e3ffee94f hgext/mq.py --- a/hgext/mq.py Fri Jan 15 13:14:47 2016 -0800 +++ b/hgext/mq.py Fri Jan 15 13:14:47 2016 -0800 @@ -1041,12 +1041,8 @@ oldqbase = repo[qfinished[0]] tphase = repo.ui.config('phases', 'new-commit', phases.draft) if oldqbase.phase() > tphase and oldqbase.p1().phase() <= tphase: - tr = repo.transaction('qfinish') - try: + with repo.transaction('qfinish') as tr: phases.advanceboundary(repo, tr, tphase, qfinished) - tr.close() - finally: - tr.release() def delete(self, repo, patches, opts): if not patches and not opts.get('rev'):