mercurial/commands.py
changeset 4268 f38f90a177dc
parent 4265 94bb953b43e5
parent 4267 8185a1ca8628
child 4276 cb6107f78b92
--- a/mercurial/commands.py	Fri Mar 23 01:04:21 2007 -0500
+++ b/mercurial/commands.py	Sat Mar 24 02:45:08 2007 -0500
@@ -2499,6 +2499,9 @@
         rev_ = nullid
         if not message:
             message = _('Removed tag %s') % name
+    elif name in repo.tags() and not opts['force']:
+        raise util.Abort(_('a tag named %s already exists (use -f to force)')
+                         % name)
     if not rev_ and repo.dirstate.parents()[1] != nullid:
         raise util.Abort(_('uncommitted merge - please provide a '
                            'specific revision'))
@@ -2962,7 +2965,8 @@
          _('hg status [OPTION]... [FILE]...')),
     "tag":
         (tag,
-         [('l', 'local', None, _('make the tag local')),
+         [('f', 'force', None, _('replace existing tag')),
+          ('l', 'local', None, _('make the tag local')),
           ('m', 'message', '', _('message for tag commit log entry')),
           ('d', 'date', '', _('record datecode as commit date')),
           ('u', 'user', '', _('record user as commiter')),