changeset 47912:91afee6f959e

dirstate: drop the deprecated `add` method The method was deprecated in 5.9. Differential Revision: https://phab.mercurial-scm.org/D11347
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 24 Aug 2021 21:09:20 +0200
parents 3d2c17c5d7f2
children 3911c61f09c6
files contrib/dirstatenonnormalcheck.py hgext/sparse.py mercurial/dirstate.py mercurial/interfaces/dirstate.py
diffstat 4 files changed, 0 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/dirstatenonnormalcheck.py	Tue Aug 24 21:09:01 2021 +0200
+++ b/contrib/dirstatenonnormalcheck.py	Tue Aug 24 21:09:20 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, 'add', _checkdirstate)
             extensions.wrapfunction(dirstatecl, 'remove', _checkdirstate)
             extensions.wrapfunction(dirstatecl, 'merge', _checkdirstate)
             extensions.wrapfunction(dirstatecl, 'drop', _checkdirstate)
--- a/hgext/sparse.py	Tue Aug 24 21:09:01 2021 +0200
+++ b/hgext/sparse.py	Tue Aug 24 21:09:20 2021 +0200
@@ -257,7 +257,6 @@
     editfuncs = [
         b'set_tracked',
         b'set_untracked',
-        b'add',
         b'copy',
         b'remove',
         b'merge',
--- a/mercurial/dirstate.py	Tue Aug 24 21:09:01 2021 +0200
+++ b/mercurial/dirstate.py	Tue Aug 24 21:09:20 2021 +0200
@@ -757,24 +757,6 @@
             self._addpath(f, from_p2=True)
         self._map.copymap.pop(f, None)
 
-    def add(self, f):
-        '''Mark a file added.'''
-        if self.pendingparentchange():
-            util.nouideprecwarn(
-                b"do not use `add` inside of update/merge context."
-                b" Use `update_file`",
-                b'6.0',
-                stacklevel=2,
-            )
-        else:
-            util.nouideprecwarn(
-                b"do not use `add` outside of update/merge context."
-                b" Use `set_tracked`",
-                b'6.0',
-                stacklevel=2,
-            )
-        self._add(f)
-
     def _add(self, filename):
         """internal function to mark a file as added"""
         self._addpath(filename, added=True)
--- a/mercurial/interfaces/dirstate.py	Tue Aug 24 21:09:01 2021 +0200
+++ b/mercurial/interfaces/dirstate.py	Tue Aug 24 21:09:20 2021 +0200
@@ -132,9 +132,6 @@
     def copies():
         pass
 
-    def add(f):
-        '''Mark a file added.'''
-
     def remove(f):
         '''Mark a file removed.'''