comparison mercurial/dirstate.py @ 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 c87844960a35
children 5fc2dfb073d6
comparison
equal deleted inserted replaced
48106:82e142b9ad18 48107:dcd97b082b3b
325 325
326 XXX The "state" is a bit obscure to be in the "public" API. we should 326 XXX The "state" is a bit obscure to be in the "public" API. we should
327 consider migrating all user of this to going through the dirstate entry 327 consider migrating all user of this to going through the dirstate entry
328 instead. 328 instead.
329 """ 329 """
330 msg = b"don't use dirstate[file], use dirstate.get_entry(file)"
331 util.nouideprecwarn(msg, b'6.1', stacklevel=2)
330 entry = self._map.get(key) 332 entry = self._map.get(key)
331 if entry is not None: 333 if entry is not None:
332 return entry.state 334 return entry.state
333 return b'?' 335 return b'?'
334 336