changeset 47663:6f8d6dd32e61

dirstate: deprecated `drop` outside of `update/merge` All core users have been migrated. Differential Revision: https://phab.mercurial-scm.org/D11116
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 08 Jul 2021 10:28:20 +0200
parents 1a79bb8c572c
children 119b9c8db94d
files mercurial/dirstate.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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):