Patchwork D11173: dirstate: enforce `possibly_dirty` in `set_tracked`

login
register
mail settings
Submitter phabricator
Date July 19, 2021, 2:10 p.m.
Message ID <differential-rev-PHID-DREV-m5clsunhpv34ffbgu5iw-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49485/
State Superseded
Headers show

Comments

phabricator - July 19, 2021, 2:10 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  There is some usecase (like `hg revert`) that requires more agressive
  `possibly_dirty` setting. So we take a safe path and enforce it in one of the
  main `normallookup` replacement.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -478,6 +478,10 @@ 
         elif not entry.tracked:
             self.normallookup(filename)
             return True
+        # XXX This is probably overkill for more case, but we need this to
+        # fully replace the `normallookup` call with `set_tracked` one.
+        # Consider smoothing this in the future.
+        self.set_possibly_dirty(filename)
         return False
 
     @requires_no_parents_change