From patchwork Fri Oct 1 09:42:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11544: dirstate: deprecate `__getitem__` access From: phabricator X-Patchwork-Id: 49865 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 1 Oct 2021 09:42:45 +0000 marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY If we want to drop `state` usage, we need to deprecate this. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11544 AFFECTED FILES mercurial/dirstate.py CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -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