diff -r 090fc6a95e50 -r a5701ffc10e4 mercurial/sparse.py --- a/mercurial/sparse.py Thu Jul 08 18:51:45 2021 +0200 +++ b/mercurial/sparse.py Thu Jul 08 18:59:55 2021 +0200 @@ -646,7 +646,7 @@ The updated sparse config is written out and the working directory is refreshed, as needed. """ - with repo.wlock(): + with repo.wlock(), repo.dirstate.parentchange(): # read current configuration raw = repo.vfs.tryread(b'sparse') includes, excludes, profiles = parseconfig(repo.ui, raw, b'sparse')