dirstate-guard: replace a usage in `rebase` with a transaction
Opening the transaction sooner will provide us with the same benefit.
--- 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