Commits

Yuya Nishihara committed 123fa65

update: unroll dlgfunc into run.update

Comments (0)

Files changed (2)

tortoisehg/hgqt/run.py

     _('thg update [-C] [[-r] REV]'))
 def update(ui, repo, *pats, **opts):
     """update/checkout tool"""
-    from tortoisehg.hgqt.update import run
-    return run(ui, *pats, **opts)
+    from tortoisehg.hgqt import update as updatemod
+    rev = None
+    if opts.get('rev'):
+        rev = opts.get('rev')
+    elif len(pats) == 1:
+        rev = pats[0]
+    return updatemod.UpdateDialog(repo, rev, None, opts)
 
 @command('^userconfig',
     [('', 'focus', '', _('field to give initial focus'))],

tortoisehg/hgqt/update.py

 
 from mercurial import error
 
-from tortoisehg.util import hglib, paths
+from tortoisehg.util import hglib
 from tortoisehg.hgqt.i18n import _
 from tortoisehg.hgqt import cmdui, csinfo, qtlib, thgrepo, resolve
 
 
     def command_canceling(self):
         self.cancel_btn.setDisabled(True)
-
-def run(ui, *pats, **opts):
-    repo = thgrepo.repository(ui, path=paths.find_root())
-    rev = None
-    if opts.get('rev'):
-        rev = opts.get('rev')
-    elif len(pats) == 1:
-        rev = pats[0]
-    return UpdateDialog(repo, rev, None, opts)