[PATCH 1 of 5] scmutil: list kind in abort

timeless timeless at mozdev.org
Sun Jan 10 18:57:48 UTC 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1451184347 0
#      Sun Dec 27 02:45:47 2015 +0000
# Node ID 81f7508339fc28775b31ab1724c88eda6d11e85e
# Parent  76fc5ac23473a25216f9cba2f977d1f56aa9df92
scmutil: list kind in abort

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -143,10 +143,10 @@
         raise error.Abort(_("the name '%s' is reserved") % lbl)
     for c in (':', '\0', '\n', '\r'):
         if c in lbl:
-            raise error.Abort(_("%r cannot be used in a name") % c)
+            raise error.Abort(_("%r cannot be used in a %s name") % (c, kind))
     try:
         int(lbl)
-        raise error.Abort(_("cannot use an integer as a name"))
+        raise error.Abort(_("cannot use an integer as a %s name") % kind)
     except ValueError:
         pass
 
diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t
--- a/tests/test-bookmarks.t
+++ b/tests/test-bookmarks.t
@@ -307,7 +307,7 @@
 bookmark with integer name
 
   $ hg bookmark 10
-  abort: cannot use an integer as a name
+  abort: cannot use an integer as a bookmark name
   [255]
 
 incompatible options
@@ -369,12 +369,12 @@
 invalid bookmark
 
   $ hg bookmark 'foo:bar'
-  abort: ':' cannot be used in a name
+  abort: ':' cannot be used in a bookmark name
   [255]
 
   $ hg bookmark 'foo
   > bar'
-  abort: '\n' cannot be used in a name
+  abort: '\n' cannot be used in a bookmark name
   [255]
 
 the bookmark extension should be ignored now that it is part of core
diff --git a/tests/test-branches.t b/tests/test-branches.t
--- a/tests/test-branches.t
+++ b/tests/test-branches.t
@@ -57,12 +57,12 @@
 invalid characters
 
   $ hg branch 'foo:bar'
-  abort: ':' cannot be used in a name
+  abort: ':' cannot be used in a branch name
   [255]
 
   $ hg branch 'foo
   > bar'
-  abort: '\n' cannot be used in a name
+  abort: '\n' cannot be used in a branch name
   [255]
 
 trailing or leading spaces should be stripped before testing duplicates
diff --git a/tests/test-tag.t b/tests/test-tag.t
--- a/tests/test-tag.t
+++ b/tests/test-tag.t
@@ -120,10 +120,10 @@
 
   $ hg tag -l 'xx
   > newline'
-  abort: '\n' cannot be used in a name
+  abort: '\n' cannot be used in a tag name
   [255]
   $ hg tag -l 'xx:xx'
-  abort: ':' cannot be used in a name
+  abort: ':' cannot be used in a tag name
   [255]
 
 cloning local tags


More information about the Mercurial-devel mailing list