narrow: use `running_status` in `updateworkingcopy`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 22 Feb 2023 00:41:27 +0100
changeset 50135 31be0b46fd47
parent 50134 0d6173373fa5
child 50136 b38b53c5674e
narrow: use `running_status` in `updateworkingcopy` This is the way.
mercurial/narrowspec.py
--- 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: