# HG changeset patch # User Pierre-Yves David # Date 1625434914 -7200 # Node ID 7a4ba68f2373900c4b94e250b820239bad4ec98e # Parent 85ce6ed51b9cf407591730cd5533993176fcbd85 dirstate-item: deprecate tuple access on the class This should help us to catch and update the last user of this, especially in extensions. People will need to run the test with --pure to actually catch it, but this is better than nothing. Differential Revision: https://phab.mercurial-scm.org/D10992 diff -r 85ce6ed51b9c -r 7a4ba68f2373 mercurial/pure/parsers.py --- a/mercurial/pure/parsers.py Mon Jul 05 06:44:49 2021 +0200 +++ b/mercurial/pure/parsers.py Sun Jul 04 23:41:54 2021 +0200 @@ -63,12 +63,20 @@ def __getitem__(self, idx): if idx == 0 or idx == -4: + msg = b"do not use item[x], use item.state" + util.nouideprecwarn(msg, b'6.0', stacklevel=2) return self._state elif idx == 1 or idx == -3: + msg = b"do not use item[x], use item.mode" + util.nouideprecwarn(msg, b'6.0', stacklevel=2) return self._mode elif idx == 2 or idx == -2: + msg = b"do not use item[x], use item.size" + util.nouideprecwarn(msg, b'6.0', stacklevel=2) return self._size elif idx == 3 or idx == -1: + msg = b"do not use item[x], use item.mtime" + util.nouideprecwarn(msg, b'6.0', stacklevel=2) return self._mtime else: raise IndexError(idx)