[Updated] D11953: dirstate: remove deprecated API

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Tue Jan 4 19:59:30 UTC 2022


Closed by commit rHG934a6213fee9: dirstate: remove deprecated API (authored by Alphare).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11953?vs=31576&id=31591

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11953/new/

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

AFFECTED FILES
  mercurial/dirstate.py
  mercurial/interfaces/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/interfaces/dirstate.py b/mercurial/interfaces/dirstate.py
--- a/mercurial/interfaces/dirstate.py
+++ b/mercurial/interfaces/dirstate.py
@@ -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."""
 
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -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)



To: Alphare, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20220104/0f0f02fe/attachment-0001.html>


More information about the Mercurial-patches mailing list