changeset 48107:dcd97b082b3b

dirstate: deprecate `__getitem__` access If we want to drop `state` usage, we need to deprecate this. Differential Revision: https://phab.mercurial-scm.org/D11544
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 29 Sep 2021 02:34:32 +0200
parents 82e142b9ad18
children d4e715d2be0b
files mercurial/dirstate.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Wed Sep 29 18:39:02 2021 +0200
+++ b/mercurial/dirstate.py	Wed Sep 29 02:34:32 2021 +0200
@@ -327,6 +327,8 @@
         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