# HG changeset patch # User Pierre-Yves David # Date 1625763595 -7200 # Node ID a5701ffc10e4e5cb5c2411bacdfbc75b451cf3f8 # Parent 090fc6a95e5004d9ad88c661695f7bdceb75e556 sparse: make sure we adjust the dirstate at the same time as the parent This is more correct and help our API split. Differential Revision: https://phab.mercurial-scm.org/D11028 diff -r 090fc6a95e50 -r a5701ffc10e4 mercurial/context.py --- a/mercurial/context.py Thu Jul 08 18:51:45 2021 +0200 +++ b/mercurial/context.py Thu Jul 08 18:59:55 2021 +0200 @@ -2022,13 +2022,13 @@ self._repo.dirstate.setparents(node) self._repo._quick_access_changeid_invalidate() + sparse.aftercommit(self._repo, node) + # write changes out explicitly, because nesting wlock at # runtime may prevent 'wlock.release()' in 'repo.commit()' # from immediately doing so for subsequent changing files self._repo.dirstate.write(self._repo.currenttransaction()) - sparse.aftercommit(self._repo, node) - def mergestate(self, clean=False): if clean: return mergestatemod.mergestate.clean(self._repo) 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')