Patchwork D12414: dirstate-cext: properly invalidate mtime and data in `set_untracked`

login
register
mail settings
Submitter phabricator
Date March 28, 2022, 3:29 p.m.
Message ID <differential-rev-PHID-DREV-3qccvnqfq5wwtlvq6l4e-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50759/
State New
Headers show

Comments

phabricator - March 28, 2022, 3:29 p.m.
Alphare created this revision.
Alphare added a comment.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.


  Pending CI refresh

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D12414

AFFECTED FILES
  mercurial/cext/parsers.c

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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_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;