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

login
register
mail settings
Submitter phabricator
Date July 19, 2021, 7:36 a.m.
Message ID <differential-rev-PHID-DREV-jrdir6lvxjzfej6thjxu-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49429/
State Superseded
Headers show

Comments

phabricator - July 19, 2021, 7:36 a.m.
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




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

Patch

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):