dirstate-cext: properly invalidate mtime and data in `set_untracked` stable
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 28 Mar 2022 17:24:41 +0200
branchstable
changeset 48819 9bb700223f00
parent 48818 6e7ae547e38d
child 48820 d4b66dc500c5
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<T>` to represent the lack of information. Differential Revision: https://phab.mercurial-scm.org/D12414
mercurial/cext/parsers.c
--- a/mercurial/cext/parsers.c	Tue Mar 22 03:19:01 2022 +0100
+++ b/mercurial/cext/parsers.c	Mon Mar 28 17:24:41 2022 +0200
@@ -517,6 +517,8 @@
 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;