Mercurial > hg-stable
changeset 50897:f12d53a6e8b8
closehead: wrap transaction handling in a context manager
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 21 Aug 2023 09:50:31 -0400 |
parents | 259213382862 |
children | 00081fa564ed |
files | hgext/closehead.py |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/closehead.py Sun Aug 20 15:38:35 2023 -0400 +++ b/hgext/closehead.py Mon Aug 21 09:50:31 2023 -0400 @@ -58,11 +58,10 @@ date=opts.get('date'), extra=extra, ) - tr = repo.transaction(b'commit') - ret = repo.commitctx(cctx, True) - bookmarks.update(repo, [rev, None], ret) - cctx.markcommitted(ret) - tr.close() + with repo.transaction(b'commit'): + ret = repo.commitctx(cctx, True) + bookmarks.update(repo, [rev, None], ret) + cctx.markcommitted(ret) revs += tuple(opts.get('rev', [])) revs = logcmdutil.revrange(repo, revs)