--- a/mercurial/commands.py Tue Dec 18 14:01:34 2007 -0600
+++ b/mercurial/commands.py Sun Dec 09 16:32:05 2007 +0900
@@ -2428,8 +2428,15 @@
rev_ = opts['rev']
message = opts['message']
if opts['remove']:
- if not name in repo.tags():
+ tagtype = repo.tagtype(name)
+
+ if not tagtype:
raise util.Abort(_('tag %s does not exist') % name)
+ if opts['local'] and tagtype == 'global':
+ raise util.Abort(_('%s tag is global') % name)
+ if not opts['local'] and tagtype == 'local':
+ raise util.Abort(_('%s tag is local') % name)
+
rev_ = nullid
if not message:
message = _('Removed tag %s') % name