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

login
register
mail settings
Submitter Pierre-Yves David
Date March 27, 2017, 4:28 p.m.
Message ID <7f11598171b4ac200c25.1490632106@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/19757/
State Accepted
Headers show

Comments

Pierre-Yves David - March 27, 2017, 4:28 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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)