mercurial/dirstate.py
changeset 47661 b2082426f03a
parent 47612 a9d75262b992
child 47662 1a79bb8c572c
--- a/mercurial/dirstate.py	Mon Jul 19 22:19:36 2021 +0200
+++ b/mercurial/dirstate.py	Thu Jul 08 00:35:06 2021 +0200
@@ -708,6 +708,13 @@
 
     def add(self, f):
         '''Mark a file added.'''
+        if not self.pendingparentchange():
+            util.nouideprecwarn(
+                b"do not use `add` outside of update/merge context."
+                b" Use `set_tracked`",
+                b'6.0',
+                stacklevel=2,
+            )
         self._add(f)
 
     def _add(self, filename):