# HG changeset patch # User Pierre-Yves David # Date 1676331589 -3600 # Node ID a9562ea222be94a9fbcc1faceaabc4fc86b077fb # Parent 6526c2fb777c2c29e31d689de56bf5eaee1cb0e3 dirstate-guard: replace a usage in `rebase` with a transaction Opening the transaction sooner will provide us with the same benefit. diff -r 6526c2fb777c -r a9562ea222be hgext/rebase.py --- 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