D11115: dirstate: deprecated `remove` outside of `update/merge`

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Mon Jul 19 07:36:54 UTC 2021


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  All core users have been migrated.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11115

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -724,6 +724,13 @@
 
     def remove(self, f):
         '''Mark a file removed'''
+        if not self.pendingparentchange():
+            util.nouideprecwarn(
+                b"do not use `remove` outside of update/merge context."
+                b" Use `set_untracked`",
+                b'6.0',
+                stacklevel=2,
+            )
         self._remove(f)
 
     def _remove(self, filename):



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list