dirstate: deprecated `drop` outside of `update/merge`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 08 Jul 2021 10:28:20 +0200
changeset 47663 6f8d6dd32e61
parent 47662 1a79bb8c572c
child 47664 119b9c8db94d
dirstate: deprecated `drop` outside of `update/merge` All core users have been migrated. Differential Revision: https://phab.mercurial-scm.org/D11116
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Thu Jul 08 03:30:11 2021 +0200
+++ b/mercurial/dirstate.py	Thu Jul 08 10:28:20 2021 +0200
@@ -747,6 +747,13 @@
 
     def drop(self, f):
         '''Drop a file from the dirstate'''
+        if not self.pendingparentchange():
+            util.nouideprecwarn(
+                b"do not use `drop` outside of update/merge context."
+                b" Use `set_untracked`",
+                b'6.0',
+                stacklevel=2,
+            )
         self._drop(f)
 
     def _drop(self, filename):