changeset 33255:4f3f08262eb4

tag: make sure the repository is locked when tagging Otherwise, writing localtag can happen without the lock.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 02 Jul 2017 01:41:37 +0200
parents 9359cd9345a9
children 4ea0b7a613f9
files mercurial/tags.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/tags.py	Sun Jul 02 01:38:08 2017 +0200
+++ b/mercurial/tags.py	Sun Jul 02 01:41:37 2017 +0200
@@ -539,9 +539,10 @@
             raise error.Abort(_('working copy of .hgtags is changed'),
                              hint=_('please commit .hgtags manually'))
 
-    repo.tags() # instantiate the cache
-    _tag(repo.unfiltered(), names, node, message, local, user, date,
-         editor=editor)
+    with repo.wlock():
+        repo.tags() # instantiate the cache
+        _tag(repo.unfiltered(), names, node, message, local, user, date,
+             editor=editor)
 
 def _tag(repo, names, node, message, local, user, date, extra=None,
          editor=False):