Commits

Steve Borho committed 93f0e36

merge: slightly safe method for aborting merge on errors

Calling self.destroy from idle loop causes GTK crashes.. I think we've
seen that before in quickop.py. Hiding the dialog and returning False causes
a flicker, but it doesn't crash. Good enough for now.

Closes #1492

Comments (0)

Files changed (1)

tortoisehg/hgtk/merge.py

         elif (not rev1 and rev1 != 0):
             gdialog.Prompt(_('Unable to merge'),
                            _('Must supply a target revision'), self).run()
-            gtklib.idle_add_single_call(self.destroy)
-            return
+            gtklib.idle_add_single_call(self.hide)
+            return False
         elif (not rev0 and rev0 != 0):
             rev0 = prevs[0]
         elif rev1 == prevs[0]:
             if modified or added or removed or deleted:
                 gdialog.Prompt(_('Unable to merge'),
                                _('Outstanding uncommitted changes'), self).run()
-                gtklib.idle_add_single_call(self.destroy)
-                return
+                gtklib.idle_add_single_call(self.hide)
+                return False
             self.repo.ui.quiet = True
             commands.update(self.repo.ui, self.repo, rev=rev0, check=True)
             self.repo.ui.quiet = False