diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2618,7 +2618,11 @@ def tag(ui, repo, name, rev_=None, **opt if not message: message = _('Added tag %s for changeset %s') % (name, short(r)) - repo.tag(name, r, message, opts['local'], opts['user'], opts['date']) + date = opts.get('date') + if date: + date = util.parsedate(date) + + repo.tag(name, r, message, opts['local'], opts['user'], date) def tags(ui, repo): """list repository tags diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -202,13 +202,11 @@ class localrepository(repo.repository): date: date tuple to use if committing''' - date = util.parsedate(date) for x in self.status()[:5]: if '.hgtags' in x: raise util.Abort(_('working copy of .hgtags is changed ' '(please commit .hgtags manually)')) - self._tag(name, node, message, local, user, date) def tags(self):