dirstate: remove deprecated API
authorRaphaël Gomès <rgomes@octobus.net>
Thu, 23 Dec 2021 14:49:28 +0100
changeset 48531 934a6213fee9
parent 48530 61fe7e17f21b
child 48538 a3210c171b63
dirstate: remove deprecated API Differential Revision: https://phab.mercurial-scm.org/D11953
mercurial/dirstate.py
mercurial/interfaces/dirstate.py
--- a/mercurial/dirstate.py	Thu Dec 23 14:49:05 2021 +0100
+++ b/mercurial/dirstate.py	Thu Dec 23 14:49:28 2021 +0100
@@ -321,27 +321,6 @@
             return util.pconvert(path)
         return path
 
-    def __getitem__(self, key):
-        """Return the current state of key (a filename) in the dirstate.
-
-        States are:
-          n  normal
-          m  needs merging
-          r  marked for removal
-          a  marked for addition
-          ?  not tracked
-
-        XXX The "state" is a bit obscure to be in the "public" API. we should
-        consider migrating all user of this to going through the dirstate entry
-        instead.
-        """
-        msg = b"don't use dirstate[file], use dirstate.get_entry(file)"
-        util.nouideprecwarn(msg, b'6.1', stacklevel=2)
-        entry = self._map.get(key)
-        if entry is not None:
-            return entry.state
-        return b'?'
-
     def get_entry(self, path):
         """return a DirstateItem for the associated path"""
         entry = self._map.get(path)
--- a/mercurial/interfaces/dirstate.py	Thu Dec 23 14:49:05 2021 +0100
+++ b/mercurial/interfaces/dirstate.py	Thu Dec 23 14:49:28 2021 +0100
@@ -66,17 +66,6 @@
     def pathto(f, cwd=None):
         pass
 
-    def __getitem__(key):
-        """Return the current state of key (a filename) in the dirstate.
-
-        States are:
-          n  normal
-          m  needs merging
-          r  marked for removal
-          a  marked for addition
-          ?  not tracked
-        """
-
     def __contains__(key):
         """Check if bytestring `key` is known to the dirstate."""