mercurial/commands.py
changeset 5657 47915bf68c44
parent 5636 7e6ddde68a23
child 5658 ae3089cefaab
equal deleted inserted replaced
5656:b940260c4291 5657:47915bf68c44
  2426         raise util.Abort(_("--rev and --remove are incompatible"))
  2426         raise util.Abort(_("--rev and --remove are incompatible"))
  2427     if opts['rev']:
  2427     if opts['rev']:
  2428         rev_ = opts['rev']
  2428         rev_ = opts['rev']
  2429     message = opts['message']
  2429     message = opts['message']
  2430     if opts['remove']:
  2430     if opts['remove']:
  2431         if not name in repo.tags():
  2431         tagtype = repo.tagtype(name)
       
  2432 
       
  2433         if not tagtype:
  2432             raise util.Abort(_('tag %s does not exist') % name)
  2434             raise util.Abort(_('tag %s does not exist') % name)
       
  2435         if opts['local'] and tagtype == 'global':
       
  2436            raise util.Abort(_('%s tag is global') % name)
       
  2437         if not opts['local'] and tagtype == 'local':
       
  2438            raise util.Abort(_('%s tag is local') % name)
       
  2439 
  2433         rev_ = nullid
  2440         rev_ = nullid
  2434         if not message:
  2441         if not message:
  2435             message = _('Removed tag %s') % name
  2442             message = _('Removed tag %s') % name
  2436     elif name in repo.tags() and not opts['force']:
  2443     elif name in repo.tags() and not opts['force']:
  2437         raise util.Abort(_('a tag named %s already exists (use -f to force)')
  2444         raise util.Abort(_('a tag named %s already exists (use -f to force)')