[PATCH 4 of 5] tag: only checknewlabel for new tags

timeless timeless at mozdev.org
Sun Jan 10 12:57:51 CST 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1451197020 0
#      Sun Dec 27 06:17:00 2015 +0000
# Node ID 8d2ac62c7f35e860bd6fae43d6a03dd0289739b1
# Parent  1fb445a08991a9bce47a19b02aa3752df3d3cb5e
tag: only checknewlabel for new tags

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6713,7 +6713,6 @@
         if len(names) != len(set(names)):
             raise error.Abort(_('tag names must be unique'))
         for n in names:
-            scmutil.checknewlabel(repo, n, 'tag')
             if not n:
                 raise error.Abort(_('tag names cannot consist entirely of '
                                    'whitespace'))
@@ -6742,6 +6741,7 @@
                 message = 'Removed tag %s' % ', '.join(names)
         elif not opts.get('force'):
             for n in names:
+                scmutil.checknewlabel(repo, n, 'tag')
                 if n in repo.tags():
                     raise error.Abort(_("tag '%s' already exists "
                                        "(use -f to force)") % n)


More information about the Mercurial-devel mailing list