Patchwork D11348: dirstate: drop the deprecated `remove` method

login
register
mail settings
Submitter phabricator
Date Aug. 26, 2021, 2:21 p.m.
Message ID <differential-rev-PHID-DREV-jwbgpaohvj3fbk2fmoap-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49663/
State Superseded
Headers show

Comments

phabricator - Aug. 26, 2021, 2:21 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The method was deprecated in 5.9.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/dirstatenonnormalcheck.py
  hgext/sparse.py
  mercurial/dirstate.py
  mercurial/interfaces/dirstate.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/interfaces/dirstate.py b/mercurial/interfaces/dirstate.py
--- a/mercurial/interfaces/dirstate.py
+++ b/mercurial/interfaces/dirstate.py
@@ -132,9 +132,6 @@ 
     def copies():
         pass
 
-    def remove(f):
-        '''Mark a file removed.'''
-
     def merge(f):
         '''Mark a file merged.'''
 
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -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():
diff --git a/hgext/sparse.py b/hgext/sparse.py
--- a/hgext/sparse.py
+++ b/hgext/sparse.py
@@ -258,7 +258,6 @@ 
         b'set_tracked',
         b'set_untracked',
         b'copy',
-        b'remove',
         b'merge',
     ]
     hint = _(
diff --git a/contrib/dirstatenonnormalcheck.py b/contrib/dirstatenonnormalcheck.py
--- a/contrib/dirstatenonnormalcheck.py
+++ b/contrib/dirstatenonnormalcheck.py
@@ -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)