mercurial/tags.py
changeset 33255 4f3f08262eb4
parent 31996 e6e1884df298
child 33536 ddacd0e453ae
--- 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):