Commits

Yuya Nishihara committed 5cefde9

tag: unroll dlgfunc into run.tag

  • Participants
  • Parent commits b9cb476

Comments (0)

Files changed (2)

tortoisehg/hgqt/run.py

     _('thg tag [-f] [-l] [-m TEXT] [-r REV] [NAME]'))
 def tag(ui, repo, *pats, **opts):
     """tag tool"""
-    from tortoisehg.hgqt.tag import run
-    return run(ui, *pats, **opts)
+    from tortoisehg.hgqt import tag as tagmod
+    kargs = {}
+    tag = len(pats) > 0 and pats[0] or None
+    if tag:
+        kargs['tag'] = tag
+    rev = opts.get('rev')
+    if rev:
+        kargs['rev'] = rev
+    return tagmod.TagDialog(repo, opts=opts, **kargs)
 
 @command('thgstatus',
     [('',  'delay', None, _('wait until the second ticks over')),

tortoisehg/hgqt/tag.py

         # prevent signals from reaching deleted objects
         self.repo.repositoryChanged.disconnect(self.refresh)
         super(TagDialog, self).reject()
-
-def run(ui, *pats, **opts):
-    kargs = {}
-    tag = len(pats) > 0 and pats[0] or None
-    if tag:
-        kargs['tag'] = tag
-    rev = opts.get('rev')
-    if rev:
-        kargs['rev'] = rev
-    from tortoisehg.util import paths
-    from tortoisehg.hgqt import thgrepo
-    repo = thgrepo.repository(ui, path=paths.find_root())
-    return TagDialog(repo, opts=opts, **kargs)