shared: take wlock for writting the 'shared' file
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Sun, 07 Aug 2016 17:10:47 +0200
changeset 29753 e93408080646
parent 29752 8a8c1c4b8f24
child 29754 b303b3817d0e
shared: take wlock for writting the 'shared' file I do not see a reason why this should not be covered by the wlock.
mercurial/hg.py
--- 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.