changeset 50043:5cfc48354d0f

dirstate: use `dirstate.change_files` to scope the change in `automv` This is... mostly... the way.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 14 Dec 2022 00:52:06 +0100
parents 237e9d2e1c71
children e8c170a6571d
files hgext/automv.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/automv.py	Wed Dec 14 00:47:22 2022 +0100
+++ b/hgext/automv.py	Wed Dec 14 00:52:06 2022 +0100
@@ -73,7 +73,13 @@
 
     with repo.wlock():
         if renames is not None:
-            scmutil._markchanges(repo, (), (), renames)
+            with repo.dirstate.changing_files(repo):
+                # XXX this should be wider and integrated with the commit
+                # transaction. At the same time as we do the `addremove` logic
+                # for commit.  However we can't really do better with the
+                # current extension structure, and this is not worse than what
+                # happened before.
+                scmutil._markchanges(repo, (), (), renames)
         return orig(ui, repo, *pats, **pycompat.strkwargs(opts))