[PATCH 3 of 5] tags: use the 'tag' function from the 'tags' module in the 'tag' command

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Mar 27 12:28:26 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1490623234 -7200
#      Mon Mar 27 16:00:34 2017 +0200
# Node ID 7f11598171b4ac200c25b6c72fda9db2e52865e6
# Parent  983954c3aeebf13202b870a476671441bab9f6bf
# EXP-Topic tags
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 7f11598171b4
tags: use the 'tag' function from the 'tags' module in the 'tag' command

There is No need to go through the 'repo' object method anymore.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -48,6 +48,7 @@ from . import (
     server,
     sshserver,
     streamclone,
+    tags as tagsmod,
     templatekw,
     ui as uimod,
     util,
@@ -5172,8 +5173,8 @@ def tag(ui, repo, name1, *names, **opts)
             scmutil.revsingle(repo, rev_).rev() == nullrev):
             raise error.Abort(_("cannot tag null revision"))
 
-        repo.tag(names, r, message, opts.get('local'), opts.get('user'), date,
-                 editor=editor)
+        tagsmod.tag(repo, names, r, message, opts.get('local'),
+                    opts.get('user'), date, editor=editor)
     finally:
         release(lock, wlock)
 


More information about the Mercurial-devel mailing list