Mercurial > hg
changeset 50063:a9562ea222be
dirstate-guard: replace a usage in `rebase` with a transaction
Opening the transaction sooner will provide us with the same benefit.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 14 Feb 2023 00:39:49 +0100 |
parents | 6526c2fb777c |
children | b54801fec664 |
files | hgext/rebase.py |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/rebase.py Tue Feb 14 00:31:41 2023 +0100 +++ b/hgext/rebase.py Tue Feb 14 00:39:49 2023 +0100 @@ -30,7 +30,6 @@ commands, copies, destutil, - dirstateguard, error, extensions, logcmdutil, @@ -1494,10 +1493,10 @@ def commitnode(repo, editor, extra, user, date, commitmsg): """Commit the wd changes with parents p1 and p2. Return node of committed revision.""" - dsguard = util.nullcontextmanager() + tr = util.nullcontextmanager if not repo.ui.configbool(b'rebase', b'singletransaction'): - dsguard = dirstateguard.dirstateguard(repo, b'rebase') - with dsguard: + tr = lambda: repo.transaction(b'rebase') + with tr(): # Commit might fail if unresolved files exist newnode = repo.commit( text=commitmsg, user=user, date=date, extra=extra, editor=editor