dirstate-guard: remove the usage in `import`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 14 Feb 2023 00:42:00 +0100
changeset 50120 b54801fec664
parent 50119 a9562ea222be
child 50121 927da152800c
dirstate-guard: remove the usage in `import` It is now redundant with the transaction spawning the same scope.
mercurial/commands.py
--- a/mercurial/commands.py	Tue Feb 14 00:39:49 2023 +0100
+++ b/mercurial/commands.py	Tue Feb 14 00:42:00 2023 +0100
@@ -4247,12 +4247,10 @@
         if not opts.get(b'no_commit'):
             lock = repo.lock
             tr = lambda: repo.transaction(b'import')
-            dsguard = util.nullcontextmanager
         else:
             lock = util.nullcontextmanager
             tr = util.nullcontextmanager
-            dsguard = lambda: dirstateguard.dirstateguard(repo, b'import')
-        with lock(), tr(), dsguard():
+        with lock(), tr():
             parents = repo[None].parents()
             for patchurl in patches:
                 if patchurl == b'-':