dirstate: deprecate the `add` method outside of update/merge context
All core users have been updated.
Differential Revision: https://phab.mercurial-scm.org/D11114
--- 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):