Commits

Yuya Nishihara committed b9cb476

sync: unroll dlgfunc into run.sync

Comments (0)

Files changed (2)

tortoisehg/hgqt/run.py

 @command('^sync|synchronize', [], _('thg sync [PEER]'))
 def sync(ui, repo, *pats, **opts):
     """Synchronize with other repositories"""
-    from tortoisehg.hgqt.sync import run
-    return run(ui, *pats, **opts)
+    from tortoisehg.hgqt import sync as syncmod
+    w = syncmod.SyncWidget(repo, None, **opts)
+    if pats:
+        w.setUrl(hglib.tounicode(pats[0]))
+    return w
 
 @command('^tag',
     [('f', 'force', None, _('replace existing tag')),

tortoisehg/hgqt/sync.py

 
         self.outopts = outopts
         QDialog.accept(self)
-
-
-def run(ui, *pats, **opts):
-    repo = thgrepo.repository(ui, path=paths.find_root())
-    w = SyncWidget(repo, None, **opts)
-    if pats:
-        w.setUrl(hglib.tounicode(pats[0]))
-    return w