changeset 33:ff8d64625aa3

Added retry_merge. Fixed bug in "after merge" commit.
author Jari Korhonen <jtkorhonen@gmail.com>
date Sat, 19 Jun 2010 00:23:09 +0300
parents 4f307720272f
children 43e3b271d293
files common.h mainwindow.cpp mainwindow.h
diffstat 3 files changed, 38 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/common.h	Tue Jun 15 03:16:40 2010 +0300
+++ b/common.h	Sat Jun 19 00:23:09 2010 +0300
@@ -8,7 +8,7 @@
 #include <QtCore>
 
 #define APPNAME                         "HgExplorer"
-#define APPVERSION                      "0.5.0"
+#define APPVERSION                      "0.5.1"
 #define MY_ICON_SIZE                    32
 #define REPOMENU_TITLE                  "Repository actions"
 #define WORKFOLDERMENU_TITLE            "Workfolder actions"
--- a/mainwindow.cpp	Tue Jun 15 03:16:40 2010 +0300
+++ b/mainwindow.cpp	Sat Jun 19 00:23:09 2010 +0300
@@ -36,6 +36,7 @@
     readSettings();
 
     tabPage = 0;
+    justMerged = false;
     hgExp = new HgExpWidget((QWidget *) this, remoteRepoPath, workFolderPath, initialFileTypesBits);
     setCentralWidget(hgExp);
 
@@ -291,9 +292,9 @@
             {
                 QString currentFile = hgExp -> getCurrentFileListLine();
 
-                if (areAllSelectedCommitable(hgExp -> workFolderFileList))
+                if ((justMerged == false) && (areAllSelectedCommitable(hgExp -> workFolderFileList)))
                 {
-                    //User wants to commit selected file(s)
+                    //User wants to commit selected file(s) (and this is not merge commit, which would fail if we selected files)
                     params << "commit" << "--message" << comment << "--user" << userInfo;
 
                     QList <QListWidgetItem *> selList = hgExp -> workFolderFileList -> selectedItems();
@@ -427,6 +428,19 @@
     }
 }
 
+void MainWindow::hgRetryMerge()
+{
+    if (runningAction == ACT_NONE)
+    {
+        QStringList params;
+
+        params << "resolve" << "--all";
+        runner -> startProc(getHgBinaryName(), workFolderPath, params);
+        runningAction = ACT_RETRY_MERGE;
+    }
+}
+
+
 void MainWindow::hgMerge()
 {
     if (runningAction == ACT_NONE)
@@ -886,6 +900,13 @@
                     case ACT_MERGE:
                         QMessageBox::information(this, "merge", runner -> getStdOut());
                         shouldHgStat = true;
+                        justMerged = true;
+                        break;
+
+                    case ACT_RETRY_MERGE:
+                        QMessageBox::information(this, "retry merge", runner -> getStdOut());
+                        shouldHgStat = true;
+                        justMerged = true;
                         break;
 
                     default:
@@ -942,6 +963,7 @@
     connect(hgUpdateAct, SIGNAL(triggered()), this, SLOT(hgUpdate()));
     connect(hgRevertAct, SIGNAL(triggered()), this, SLOT(hgRevert()));
     connect(hgMergeAct, SIGNAL(triggered()), this, SLOT(hgMerge()));
+    connect(hgRetryMergeAct, SIGNAL(triggered()), this, SLOT(hgRetryMerge()));
 
     connect(settingsAct, SIGNAL(triggered()), this, SLOT(settings()));
 
@@ -1022,6 +1044,7 @@
     hgUpdateAct -> setEnabled(localRepoActionsEnabled);
     hgCommitAct -> setEnabled(localRepoActionsEnabled);
     hgMergeAct -> setEnabled(localRepoActionsEnabled);
+    hgRetryMergeAct -> setEnabled(localRepoActionsEnabled);
     hgResolveListAct -> setEnabled(localRepoActionsEnabled);
     hgResolveMarkAct -> setEnabled(localRepoActionsEnabled);
     hgAnnotateAct -> setEnabled(localRepoActionsEnabled);
@@ -1088,6 +1111,7 @@
             if (hgExp -> localRepoHeadsList->count() < 2)
             {
                 hgMergeAct -> setEnabled(false);
+                hgRetryMergeAct -> setEnabled(false);
             }
 
             QString currentFile = hgExp -> getCurrentFileListLine();
@@ -1200,6 +1224,9 @@
     hgResolveMarkAct = new QAction(tr("Resolve (mark)"), this);
     hgResolveMarkAct -> setStatusTip(tr("Resolve (mark): Mark selected file status as resolved"));
 
+    hgRetryMergeAct = new QAction(tr("Retry merge"), this);
+    hgRetryMergeAct -> setStatusTip(tr("Retry merge after failed merge attempt."));
+
     hgServeAct = new QAction(tr("Serve (via http)"), this);
     hgServeAct -> setStatusTip(tr("Serve local repository via http for workgroup access"));
 
@@ -1226,6 +1253,7 @@
     advancedMenu -> addSeparator();
     advancedMenu -> addAction(hgAnnotateAct);
     advancedMenu -> addSeparator();
+    advancedMenu -> addAction(hgRetryMergeAct);
     advancedMenu -> addAction(hgResolveListAct);
     advancedMenu -> addAction(hgResolveMarkAct);
     advancedMenu -> addSeparator();
--- a/mainwindow.h	Tue Jun 15 03:16:40 2010 +0300
+++ b/mainwindow.h	Sat Jun 19 00:23:09 2010 +0300
@@ -40,7 +40,8 @@
     ACT_MERGE,
     ACT_RESOLVE_LIST,
     ACT_SERVE,
-    ACT_RESOLVE_MARK
+    ACT_RESOLVE_MARK,
+    ACT_RETRY_MERGE,
 };
 
 
@@ -85,6 +86,7 @@
     void hgUpdate();
     void hgRevert();
     void hgMerge();
+    void hgRetryMerge();
     void settings();
     void hgCloneFromRemote();
     void hgInit();
@@ -130,6 +132,7 @@
     QAction *settingsAct;
     QAction *exitAct;
 
+    //Repo actions
     QAction *hgIncomingAct;
     QAction *hgPushAct;
     QAction *hgPullAct;
@@ -143,6 +146,7 @@
     QAction *hgUpdateAct;
     QAction *hgCommitAct;
     QAction *hgMergeAct;
+    QAction *hgRetryMergeAct;
     QAction *hgUpdateToRevAct;
     QAction *hgAnnotateAct;
     QAction *hgResolveListAct;
@@ -166,8 +170,9 @@
     HGACTIONS   runningAction;
     HgRunner    *runner;
 
-    int         tabPage;
+    int             tabPage;
     unsigned char   initialFileTypesBits;
+    bool            justMerged;
 };
 
 #endif