changeset 50191:99faa396e186

narrow: write the narrow spec in a transaction during share It will be simpler if all write happens within transaction.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 23 Feb 2023 04:42:17 +0100
parents 34db5692d537
children 6794f927bc48
files mercurial/hg.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Thu Feb 23 04:36:19 2023 +0100
+++ b/mercurial/hg.py	Thu Feb 23 04:42:17 2023 +0100
@@ -457,7 +457,9 @@
         template = b'[paths]\ndefault = %s\n'
         destrepo.vfs.write(b'hgrc', util.tonativeeol(template % default))
     if requirements.NARROW_REQUIREMENT in sourcerepo.requirements:
-        with destrepo.wlock():
+        with destrepo.wlock(), destrepo.lock(), destrepo.transaction(
+            b"narrow-share"
+        ):
             narrowspec.copytoworkingcopy(destrepo)