mercurial/hg.py
changeset 29765 e93408080646
parent 29645 3b4d69b3988d
child 29906 a77d48219edd
--- a/mercurial/hg.py	Sun Aug 07 17:00:45 2016 +0200
+++ b/mercurial/hg.py	Sun Aug 07 17:10:47 2016 +0200
@@ -259,10 +259,11 @@
         fp.write("default = %s\n" % default)
         fp.close()
 
-    if bookmarks:
-        fp = destrepo.vfs('shared', 'w')
-        fp.write(sharedbookmarks + '\n')
-        fp.close()
+    with destrepo.wlock():
+        if bookmarks:
+            fp = destrepo.vfs('shared', 'w')
+            fp.write(sharedbookmarks + '\n')
+            fp.close()
 
 def _postshareupdate(repo, update, checkout=None):
     """Maybe perform a working directory update after a shared repo is created.