tag: make sure the repository is locked when tagging
Otherwise, writing localtag can happen without the lock.
--- 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):