dirstate: deprecated `remove` outside of `update/merge`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 08 Jul 2021 03:30:11 +0200
changeset 47662 1a79bb8c572c
parent 47661 b2082426f03a
child 47663 6f8d6dd32e61
dirstate: deprecated `remove` outside of `update/merge` All core users have been migrated. Differential Revision: https://phab.mercurial-scm.org/D11115
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Thu Jul 08 00:35:06 2021 +0200
+++ b/mercurial/dirstate.py	Thu Jul 08 03:30:11 2021 +0200
@@ -724,6 +724,13 @@
 
     def remove(self, f):
         '''Mark a file removed'''
+        if not self.pendingparentchange():
+            util.nouideprecwarn(
+                b"do not use `remove` outside of update/merge context."
+                b" Use `set_untracked`",
+                b'6.0',
+                stacklevel=2,
+            )
         self._remove(f)
 
     def _remove(self, filename):