changeset 50135:31be0b46fd47

narrow: use `running_status` in `updateworkingcopy` This is the way.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 22 Feb 2023 00:41:27 +0100
parents 0d6173373fa5
children b38b53c5674e
files mercurial/narrowspec.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/narrowspec.py	Mon Feb 20 17:26:41 2023 +0100
+++ b/mercurial/narrowspec.py	Wed Feb 22 00:41:27 2023 +0100
@@ -322,10 +322,16 @@
     addedmatch = matchmod.differencematcher(newmatch, oldmatch)
     removedmatch = matchmod.differencematcher(oldmatch, newmatch)
 
+    assert repo.currentwlock() is not None
     ds = repo.dirstate
-    lookup, status, _mtime_boundary = ds.status(
-        removedmatch, subrepos=[], ignored=True, clean=True, unknown=True
-    )
+    with ds.running_status(repo):
+        lookup, status, _mtime_boundary = ds.status(
+            removedmatch,
+            subrepos=[],
+            ignored=True,
+            clean=True,
+            unknown=True,
+        )
     trackeddirty = status.modified + status.added
     clean = status.clean
     if assumeclean: