Commits

Johan Samyn committed 11993bb

init: launch commit tool after succesful init (gtk)

Closes #1308

Comments (0)

Files changed (1)

tortoisehg/hgtk/hginit.py

                 _('Add special files (.hgignore, ...)'))
         self.optoldrepo = gtk.CheckButton(
                 _('Make repo compatible with Mercurial 1.0'))
+        self.optrunci = gtk.CheckButton(_('Run Commit after init'))
         table.add_row(self.optspfiles, xpad=2)
         table.add_row(self.optoldrepo, xpad=2)
+        table.add_row(self.optrunci, xpad=2)
 
         # set option states
         self.optspfiles.set_active(True)
             self.optoldrepo.set_active(not usefncache)
         except:
             pass
+        self.optrunci.set_active(False)
 
     def dialog_response(self, dialog, response_id):
         # Create button
                     pass
 
         shlib.shell_notify([dest])
-        self.response(gtk.RESPONSE_CLOSE)
+
+        if self.optrunci.get_active():
+            os.chdir(dest)
+            from tortoisehg.hgtk.hgtk import gtkrun
+            from tortoisehg.hgtk.commit import run as cirun
+            ciui = ui.ui()
+            self.hide()
+            gtkrun(cirun, ciui)
+            return
+        else:
+            self.response(gtk.RESPONSE_CLOSE)
 
 def run(ui, *pats, **opts):
     return InitDialog(pats)