diff --git a/mercurial/sparse.py b/mercurial/sparse.py --- a/mercurial/sparse.py +++ b/mercurial/sparse.py @@ -718,7 +718,7 @@ The new config is written out and a working directory refresh is performed. """ - with repo.wlock(), repo.dirstate.parentchange(): + with repo.wlock(), repo.lock(), repo.dirstate.parentchange(): raw = repo.vfs.tryread(b'sparse') oldinclude, oldexclude, oldprofiles = parseconfig( repo.ui, raw, b'sparse' diff --git a/tests/test-sparse-with-safe-share.t b/tests/test-sparse-with-safe-share.t --- a/tests/test-sparse-with-safe-share.t +++ b/tests/test-sparse-with-safe-share.t @@ -16,10 +16,8 @@ $ echo x > hide $ hg ci -Aqm 'initial' -Verify basic --include +Regression test: checks that this command correctly locks the store +before updating the store [requirements] config. $ hg up -q 0 $ hg debugsparse --include 'hide' - devel-warn: write with no lock: "requires" at: *mercurial/scmutil.py:1558 (writerequires) (glob) - -TODO: bug in sparse when used together with safe-share^