changeset 47757:7375add1ca92

dirstate: deprecate the `add` method All users have been migrated. Differential Revision: https://phab.mercurial-scm.org/D11199
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 19 Jul 2021 08:56:56 +0200
parents 7a06e04cbd68
children ec77f709495c
files mercurial/dirstate.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Sun Jul 18 22:35:37 2021 +0200
+++ b/mercurial/dirstate.py	Mon Jul 19 08:56:56 2021 +0200
@@ -819,9 +819,16 @@
 
     def add(self, f):
         '''Mark a file added.'''
-        if not self.pendingparentchange():
+        if self.pendingparentchange():
             util.nouideprecwarn(
-                b"do not use `add` outside of update/merge context."
+                b"do not use `add` inside of update/merge context."
+                b" Use `update_file`",
+                b'6.0',
+                stacklevel=2,
+            )
+        else:
+            util.nouideprecwarn(
+                b"do not use `remove` outside of update/merge context."
                 b" Use `set_tracked`",
                 b'6.0',
                 stacklevel=2,