Mercurial > hg
changeset 29756:46d9a5bb2fb0
journal: take wlock for writting the 'shared' file
As we did for the shared extension itself, we add some locking around the write
of the 'shared' file.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 08 Aug 2016 18:05:10 +0200 |
parents | b37f65b047c7 |
children | 976cd337cac9 |
files | hgext/journal.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/journal.py Sun Aug 07 17:15:19 2016 +0200 +++ b/hgext/journal.py Mon Aug 08 18:05:10 2016 +0200 @@ -165,9 +165,10 @@ def wrappostshare(orig, sourcerepo, destrepo, **kwargs): """Mark this shared working copy as sharing journal information""" - orig(sourcerepo, destrepo, **kwargs) - with destrepo.vfs('shared', 'a') as fp: - fp.write('journal\n') + with destrepo.wlock(): + orig(sourcerepo, destrepo, **kwargs) + with destrepo.vfs('shared', 'a') as fp: + fp.write('journal\n') def unsharejournal(orig, ui, repo, repopath): """Copy shared journal entries into this repo when unsharing"""