Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 50091:e356e8b65d70
dirstate: use `dirstate.change_files` to scope the change in `rename`
This is the way, unless we are not actually touching the working copy.
In such cases we don't need to do something.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 31 Jan 2023 00:05:12 +0100 |
parents | 5c9462adc4b9 |
children | b54801fec664 |
comparison
equal
deleted
inserted
replaced
50090:5c9462adc4b9 | 50091:e356e8b65d70 |
---|---|
6012 This command takes effect with the next commit by default. | 6012 This command takes effect with the next commit by default. |
6013 | 6013 |
6014 Returns 0 on success, 1 if errors are encountered. | 6014 Returns 0 on success, 1 if errors are encountered. |
6015 """ | 6015 """ |
6016 opts = pycompat.byteskwargs(opts) | 6016 opts = pycompat.byteskwargs(opts) |
6017 with repo.wlock(): | 6017 context = repo.dirstate.changing_files |
6018 rev = opts.get(b'at_rev') | |
6019 ctx = None | |
6020 if rev: | |
6021 ctx = logcmdutil.revsingle(repo, rev) | |
6022 if ctx.rev() is not None: | |
6023 | |
6024 def context(repo): | |
6025 return util.nullcontextmanager() | |
6026 | |
6027 opts[b'at_rev'] = ctx.rev() | |
6028 with repo.wlock(), context(repo): | |
6018 return cmdutil.copy(ui, repo, pats, opts, rename=True) | 6029 return cmdutil.copy(ui, repo, pats, opts, rename=True) |
6019 | 6030 |
6020 | 6031 |
6021 @command( | 6032 @command( |
6022 b'resolve', | 6033 b'resolve', |