# HG changeset patch # User Pierre-Yves David # Date 2023-02-20 14:52:55 # Node ID de42ba9dd8525565d37c88ac0ebff2fa876857d8 # Parent 65943224c184c008b8457686165e438cfa1a52d0 dirstate: use the new `check_invalidated` decorator for `_changing` WeeeEEeee, less code. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -193,13 +193,11 @@ class dirstate: self._pl @contextlib.contextmanager + @check_invalidated def _changing(self, repo, change_type): if repo.currentwlock() is None: msg = b"trying to change the dirstate without holding the wlock" raise error.ProgrammingError(msg) - if self._invalidated_context: - msg = "trying to use an invalidated dirstate before it has reset" - raise error.ProgrammingError(msg) has_tr = repo.currenttransaction() is not None if not has_tr and self._changing_level == 0 and self._dirty: