# HG changeset patch # User Raphaël Gomès # Date 2022-03-28 15:24:41 # Node ID 9bb700223f000be88912382adee80b8a7afe5fcb # Parent 6e7ae547e38d881302bbf7f4ee23253330e8ad45 dirstate-cext: properly invalidate mtime and data in `set_untracked` This was forgotten about in the initial implementation and was revealed while adding the `dirstate-v2` variant of `test-issue660.t`. Neither the existing Python implementation nor the upcoming Rust implementation suffer from this bug since they respectively have `None` and `Option` to represent the lack of information. Differential Revision: https://phab.mercurial-scm.org/D12414 diff --git a/mercurial/cext/parsers.c b/mercurial/cext/parsers.c --- a/mercurial/cext/parsers.c +++ b/mercurial/cext/parsers.c @@ -517,6 +517,8 @@ static PyObject *dirstate_item_set_track static PyObject *dirstate_item_set_untracked(dirstateItemObject *self) { self->flags &= ~dirstate_flag_wc_tracked; + self->flags &= ~dirstate_flag_has_meaningful_data; + self->flags &= ~dirstate_flag_has_mtime; self->mode = 0; self->size = 0; self->mtime_s = 0;