# HG changeset patch # User TK Soh # Date 2007-06-15 19:48:21 # Node ID 15e22b483adc8844724ad03afbae6ff38404e63a # Parent 52259d5fb76d0a5ffcf5797e7183ec9a426ebd9f tag: abort when trying to remove nonexistent tags diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2515,6 +2515,8 @@ def tag(ui, repo, name, rev_=None, **opt rev_ = opts['rev'] message = opts['message'] if opts['remove']: + if not name in repo.tags(): + raise util.Abort(_('tag %s does not exist') % name) rev_ = nullid if not message: message = _('Removed tag %s') % name