diff -r e96ad092fb18 -r e432fb4b4221 mercurial/commands.py --- a/mercurial/commands.py Thu Jul 26 13:58:43 2012 +0900 +++ b/mercurial/commands.py Tue Jun 05 17:00:13 2012 -0700 @@ -5643,6 +5643,11 @@ if opts.get('edit'): message = ui.edit(message, ui.username()) + # don't allow tagging the null rev + if (not opts.get('remove') and + scmutil.revsingle(repo, rev_).rev() == nullrev): + raise util.Abort(_("null revision specified")) + repo.tag(names, r, message, opts.get('local'), opts.get('user'), date) finally: release(lock, wlock)