debugsparse: stop taking the store lock
authorArseniy Alekseyev <aalekseyev@janestreet.com>
Thu, 15 Aug 2024 13:52:14 +0100
changeset 51805 0d7ccb163b4f
parent 51804 e69e3d585f07
child 51806 95cdc01f313d
debugsparse: stop taking the store lock debugsparse is a workspace-only opperation, or it better be workspace-only. Let's make it to stop taking the store lock.
mercurial/sparse.py
--- a/mercurial/sparse.py	Thu Aug 15 14:54:22 2024 +0100
+++ b/mercurial/sparse.py	Thu Aug 15 13:52:14 2024 +0100
@@ -612,7 +612,7 @@
     repo, includes, excludes, profiles, force=False, removing=False
 ):
     """Update the sparse config and working directory state."""
-    with repo.lock():
+    with repo.wlock():
         raw = repo.vfs.tryread(b'sparse')
         oldincludes, oldexcludes, oldprofiles = parseconfig(
             repo.ui, raw, b'sparse'
@@ -730,7 +730,7 @@
 
     The new config is written out and a working directory refresh is performed.
     """
-    with repo.wlock(), repo.lock(), repo.dirstate.changing_parents(repo):
+    with repo.wlock(), repo.dirstate.changing_parents(repo):
         raw = repo.vfs.tryread(b'sparse')
         oldinclude, oldexclude, oldprofiles = parseconfig(
             repo.ui, raw, b'sparse'