comparison mercurial/commands.py @ 31670:adace35f931d

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 27 Mar 2017 16:00:34 +0200
parents 7e3b145f8247
children 0f8ba0bc1154
comparison
equal deleted inserted replaced
31669:a719f3315366 31670:adace35f931d
46 revsetlang, 46 revsetlang,
47 scmutil, 47 scmutil,
48 server, 48 server,
49 sshserver, 49 sshserver,
50 streamclone, 50 streamclone,
51 tags as tagsmod,
51 templatekw, 52 templatekw,
52 ui as uimod, 53 ui as uimod,
53 util, 54 util,
54 ) 55 )
55 56
5170 # don't allow tagging the null rev 5171 # don't allow tagging the null rev
5171 if (not opts.get('remove') and 5172 if (not opts.get('remove') and
5172 scmutil.revsingle(repo, rev_).rev() == nullrev): 5173 scmutil.revsingle(repo, rev_).rev() == nullrev):
5173 raise error.Abort(_("cannot tag null revision")) 5174 raise error.Abort(_("cannot tag null revision"))
5174 5175
5175 repo.tag(names, r, message, opts.get('local'), opts.get('user'), date, 5176 tagsmod.tag(repo, names, r, message, opts.get('local'),
5176 editor=editor) 5177 opts.get('user'), date, editor=editor)
5177 finally: 5178 finally:
5178 release(lock, wlock) 5179 release(lock, wlock)
5179 5180
5180 @command('tags', formatteropts, '') 5181 @command('tags', formatteropts, '')
5181 def tags(ui, repo, **opts): 5182 def tags(ui, repo, **opts):