Mercurial > hg
comparison mercurial/commands.py @ 50064:b54801fec664
dirstate-guard: remove the usage in `import`
It is now redundant with the transaction spawning the same scope.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 14 Feb 2023 00:42:00 +0100 |
parents | e356e8b65d70 |
children | 927da152800c |
comparison
equal
deleted
inserted
replaced
50063:a9562ea222be | 50064:b54801fec664 |
---|---|
4245 cmdutil.bailifchanged(repo) | 4245 cmdutil.bailifchanged(repo) |
4246 | 4246 |
4247 if not opts.get(b'no_commit'): | 4247 if not opts.get(b'no_commit'): |
4248 lock = repo.lock | 4248 lock = repo.lock |
4249 tr = lambda: repo.transaction(b'import') | 4249 tr = lambda: repo.transaction(b'import') |
4250 dsguard = util.nullcontextmanager | |
4251 else: | 4250 else: |
4252 lock = util.nullcontextmanager | 4251 lock = util.nullcontextmanager |
4253 tr = util.nullcontextmanager | 4252 tr = util.nullcontextmanager |
4254 dsguard = lambda: dirstateguard.dirstateguard(repo, b'import') | 4253 with lock(), tr(): |
4255 with lock(), tr(), dsguard(): | |
4256 parents = repo[None].parents() | 4254 parents = repo[None].parents() |
4257 for patchurl in patches: | 4255 for patchurl in patches: |
4258 if patchurl == b'-': | 4256 if patchurl == b'-': |
4259 ui.status(_(b'applying patch from stdin\n')) | 4257 ui.status(_(b'applying patch from stdin\n')) |
4260 patchfile = ui.fin | 4258 patchfile = ui.fin |