Patchwork tag: clarify cryptic error message when tagging null revision

login
register
mail settings
Submitter Mads Kiilerich
Date April 11, 2013, 8:35 p.m.
Message ID <33c8339a9bcc40714df8.1365712537@mk-desktop>
Download mbox | patch
Permalink /patch/1279/
State Accepted, archived
Delegated to: Augie Fackler
Headers show

Comments

Mads Kiilerich - April 11, 2013, 8:35 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1365684262 -7200
#      Thu Apr 11 14:44:22 2013 +0200
# Node ID 33c8339a9bcc40714df865a5bdc4cf9b1e669c48
# Parent  6f4c6dc72f0f7cb83e268741c98a61aefbb7e0f4
tag: clarify cryptic error message when tagging null revision

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5597,7 +5597,7 @@ 
         # 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"))
+            raise util.Abort(_("cannot tag null revision"))
 
         repo.tag(names, r, message, opts.get('local'), opts.get('user'), date)
     finally:
diff --git a/tests/test-tag.t b/tests/test-tag.t
--- a/tests/test-tag.t
+++ b/tests/test-tag.t
@@ -264,11 +264,11 @@ 
 
   $ hg init empty
   $ hg tag -R empty nullrev
-  abort: null revision specified
+  abort: cannot tag null revision
   [255]
 
   $ hg tag -R empty -r 00000000000 -f nulltag
-  abort: null revision specified
+  abort: cannot tag null revision
   [255]
 
   $ cd ..