Patchwork D11029: sparse: clear rules in the context of a `parentchanges` context

login
register
mail settings
Submitter phabricator
Date July 8, 2021, 6:08 p.m.
Message ID <differential-rev-PHID-DREV-mivvuova7gjpc2rec6mr-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49341/
State Superseded
Headers show

Comments

phabricator - July 8, 2021, 6:08 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is the same logic as the change we did for narrow.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/sparse.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/sparse.py b/mercurial/sparse.py
--- a/mercurial/sparse.py
+++ b/mercurial/sparse.py
@@ -630,7 +630,7 @@ 
     The remaining sparse config only has profiles, if defined. The working
     directory is refreshed, as needed.
     """
-    with repo.wlock():
+    with repo.wlock(), repo.dirstate.parentchange():
         raw = repo.vfs.tryread(b'sparse')
         includes, excludes, profiles = parseconfig(repo.ui, raw, b'sparse')
 
@@ -708,7 +708,7 @@ 
 
     The new config is written out and a working directory refresh is performed.
     """
-    with repo.wlock():
+    with repo.wlock(), repo.dirstate.parentchange():
         raw = repo.vfs.tryread(b'sparse')
         oldinclude, oldexclude, oldprofiles = parseconfig(
             repo.ui, raw, b'sparse'