changeset 47913:3911c61f09c6

dirstate: drop the deprecated `remove` method The method was deprecated in 5.9. Differential Revision: https://phab.mercurial-scm.org/D11348
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 24 Aug 2021 21:11:42 +0200
parents 91afee6f959e
children 8e46934c58d2
files contrib/dirstatenonnormalcheck.py hgext/sparse.py mercurial/dirstate.py mercurial/interfaces/dirstate.py
diffstat 4 files changed, 0 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/dirstatenonnormalcheck.py	Tue Aug 24 21:09:20 2021 +0200
+++ b/contrib/dirstatenonnormalcheck.py	Tue Aug 24 21:11:42 2021 +0200
@@ -60,7 +60,6 @@
             # We don't do all these checks when paranoid is disable as it would
             # make the extension run very slowly on large repos
             extensions.wrapfunction(dirstatecl, 'write', _checkdirstate)
-            extensions.wrapfunction(dirstatecl, 'remove', _checkdirstate)
             extensions.wrapfunction(dirstatecl, 'merge', _checkdirstate)
             extensions.wrapfunction(dirstatecl, 'drop', _checkdirstate)
             extensions.wrapfunction(dirstatecl, 'set_tracked', _checkdirstate)
--- a/hgext/sparse.py	Tue Aug 24 21:09:20 2021 +0200
+++ b/hgext/sparse.py	Tue Aug 24 21:11:42 2021 +0200
@@ -258,7 +258,6 @@
         b'set_tracked',
         b'set_untracked',
         b'copy',
-        b'remove',
         b'merge',
     ]
     hint = _(
--- a/mercurial/dirstate.py	Tue Aug 24 21:09:20 2021 +0200
+++ b/mercurial/dirstate.py	Tue Aug 24 21:11:42 2021 +0200
@@ -762,31 +762,6 @@
         self._addpath(filename, added=True)
         self._map.copymap.pop(filename, None)
 
-    def remove(self, f):
-        '''Mark a file removed'''
-        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.0',
-                stacklevel=2,
-            )
-        else:
-            util.nouideprecwarn(
-                b"do not use `remove` outside of update/merge context."
-                b" Use `set_untracked`",
-                b'6.0',
-                stacklevel=2,
-            )
-        self._dirty = True
-        self._updatedfiles.add(f)
-        entry = self._map.get(f)
-        if entry is None:
-            # Assuming we are in a update/merge case
-            self.update_file(f, p1_tracked=True, wc_tracked=False)
-        else:
-            self.set_untracked(f)
-
     def merge(self, f):
         '''Mark a file merged.'''
         if self.pendingparentchange():
--- a/mercurial/interfaces/dirstate.py	Tue Aug 24 21:09:20 2021 +0200
+++ b/mercurial/interfaces/dirstate.py	Tue Aug 24 21:11:42 2021 +0200
@@ -132,9 +132,6 @@
     def copies():
         pass
 
-    def remove(f):
-        '''Mark a file removed.'''
-
     def merge(f):
         '''Mark a file merged.'''