Skip to content
Snippets Groups Projects
Commit a5701ffc authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

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
parent 090fc6a9
No related branches found
No related tags found
No related merge requests found
......@@ -2022,8 +2022,10 @@
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())
......@@ -2025,10 +2027,8 @@
# 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)
......
......@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment