changeset 47701:0e87c90f1cd5

dirstate: deprecate `dirstate.remove` in all cases This will make sure that code will use the newer, more semantic API sooner than later. Differential Revision: https://phab.mercurial-scm.org/D11143
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 16 Jul 2021 14:06:32 +0200
parents 9217ab0ecdb8
children 0149d17da91b
files mercurial/dirstate.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Mon Jul 19 03:20:28 2021 +0200
+++ b/mercurial/dirstate.py	Fri Jul 16 14:06:32 2021 +0200
@@ -765,7 +765,14 @@
 
     def remove(self, f):
         '''Mark a file removed'''
-        if not self.pendingparentchange():
+        if self.pendingparentchange():
+            util.nouideprecwarn(
+                b"do not use `remove` insde of update/merge context."
+                b" Use `update_file` or `update_file_p1`",
+                b'6.0',
+                stacklevel=2,
+            )
+        else:
             util.nouideprecwarn(
                 b"do not use `remove` outside of update/merge context."
                 b" Use `set_untracked`",