dirstate-guard: remove its usage in `backout`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 14 Feb 2023 00:40:27 +0100
changeset 50065 927da152800c
parent 50064 b54801fec664
child 50066 ebb8648483db
dirstate-guard: remove its usage in `backout` We can simply replace it with a transaction.
mercurial/commands.py
--- a/mercurial/commands.py	Tue Feb 14 00:42:00 2023 +0100
+++ b/mercurial/commands.py	Tue Feb 14 00:40:27 2023 +0100
@@ -28,7 +28,6 @@
     copies,
     debugcommands as debugcommandsmod,
     destutil,
-    dirstateguard,
     discovery,
     encoding,
     error,
@@ -824,7 +823,7 @@
     bheads = repo.branchheads(branch)
     rctx = scmutil.revsingle(repo, hex(parent))
     if not opts.get(b'merge') and op1 != node:
-        with dirstateguard.dirstateguard(repo, b'backout'):
+        with repo.transaction(b"backout"):
             overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')}
             with ui.configoverride(overrides, b'backout'):
                 stats = mergemod.back_out(ctx, parent=repo[parent])