diff -r a9562ea222be -r b54801fec664 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'-':