diff mainwindow.cpp @ 37:46260ce88b71

Version 0.5.4. Offer to retry merge directly after failed merge attempt.
author Jari Korhonen <jtkorhonen@gmail.com>
date Sat, 19 Jun 2010 13:10:06 +0300
parents 5986d0758069
children 4c42d3f5065d
line wrap: on
line diff
--- a/mainwindow.cpp	Sat Jun 19 03:10:51 2010 +0300
+++ b/mainwindow.cpp	Sat Jun 19 13:10:06 2010 +0300
@@ -907,12 +907,12 @@
                         break;
 
                     case ACT_PULL:
-                        QMessageBox::information(this, "pull", runner -> getStdOut());
+                        QMessageBox::information(this, "Pull", runner -> getStdOut());
                         shouldHgStat = true;
                         break;
 
                     case ACT_PUSH:
-                        QMessageBox::information(this, "push", runner -> getStdOut());
+                        QMessageBox::information(this, "Push", runner -> getStdOut());
                         shouldHgStat = true;
                         break;
 
@@ -922,7 +922,7 @@
                         break;
 
                     case ACT_CLONEFROMREMOTE:
-                        QMessageBox::information(this, "clone", runner -> getStdOut());
+                        QMessageBox::information(this, "Clone", runner -> getStdOut());
                         enableDisableActions();
                         shouldHgStat = true;
                         break;
@@ -960,18 +960,18 @@
                         break;
 
                     case ACT_UPDATE:
-                        QMessageBox::information(this, "update", runner -> getStdOut());
+                        QMessageBox::information(this, tr("Update"), runner -> getStdOut());
                         shouldHgStat = true;
                         break;
 
                     case ACT_MERGE:
-                        QMessageBox::information(this, "merge", runner -> getStdOut());
+                        QMessageBox::information(this, tr("Merge"), runner -> getStdOut());
                         shouldHgStat = true;
                         justMerged = true;
                         break;
 
                     case ACT_RETRY_MERGE:
-                        QMessageBox::information(this, "retry merge", runner -> getStdOut());
+                        QMessageBox::information(this, "Merge retry", runner -> getStdOut());
                         shouldHgStat = true;
                         justMerged = true;
                         break;
@@ -981,6 +981,7 @@
                 }
             }
 
+
             //Typical sequence goes stat -> heads -> parents -> log
             if (runningAction == ACT_STAT)
             {
@@ -997,6 +998,20 @@
                 runningAction = ACT_NONE;
                 hgLog();
             }
+            else if ((runningAction == ACT_MERGE) && (exitCode != 0))
+            {
+                //If we had a failed merge, offer to retry
+                if (QMessageBox::Ok == QMessageBox::information(this, tr("Retry merge ?"), tr("Merge attempt failed. retry ?"), QMessageBox::Ok | QMessageBox::Cancel))
+                {
+                    runningAction = ACT_NONE;
+                    hgRetryMerge();
+                }
+                else
+                {
+                    runningAction = ACT_NONE;
+                    hgStat();
+                }
+            }
             else
             {
                 runningAction = ACT_NONE;