From patchwork Mon Jul 19 10:43:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11143: dirstate: deprecate `dirstate.remove` in all cases From: phabricator X-Patchwork-Id: 49456 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Mon, 19 Jul 2021 10:43:29 +0000 marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This will make sure that code will use the newer, more semantic API sooner than later. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11143 AFFECTED FILES mercurial/dirstate.py CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -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.1', + stacklevel=2, + ) + else: util.nouideprecwarn( b"do not use `remove` outside of update/merge context." b" Use `set_untracked`",