mercurial/narrowspec.py
changeset 50135 31be0b46fd47
parent 48875 6000f5b25c9b
child 50185 99296ca9f29e
--- 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: