# HG changeset patch # User Pierre-Yves David # Date 2021-07-07 22:35:06 # Node ID b2082426f03a6ec7ad5f802c607d06b57921e09b # Parent aa2296893168f36ede481713c6123afd6dfa86ce dirstate: deprecate the `add` method outside of update/merge context All core users have been updated. Differential Revision: https://phab.mercurial-scm.org/D11114 diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -708,6 +708,13 @@ class dirstate(object): 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):