comparison 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
comparison
equal deleted inserted replaced
36:5986d0758069 37:46260ce88b71
905 presentLongStdoutToUser(runner -> getStdOut()); 905 presentLongStdoutToUser(runner -> getStdOut());
906 shouldHgStat = true; 906 shouldHgStat = true;
907 break; 907 break;
908 908
909 case ACT_PULL: 909 case ACT_PULL:
910 QMessageBox::information(this, "pull", runner -> getStdOut()); 910 QMessageBox::information(this, "Pull", runner -> getStdOut());
911 shouldHgStat = true; 911 shouldHgStat = true;
912 break; 912 break;
913 913
914 case ACT_PUSH: 914 case ACT_PUSH:
915 QMessageBox::information(this, "push", runner -> getStdOut()); 915 QMessageBox::information(this, "Push", runner -> getStdOut());
916 shouldHgStat = true; 916 shouldHgStat = true;
917 break; 917 break;
918 918
919 case ACT_INIT: 919 case ACT_INIT:
920 enableDisableActions(); 920 enableDisableActions();
921 shouldHgStat = true; 921 shouldHgStat = true;
922 break; 922 break;
923 923
924 case ACT_CLONEFROMREMOTE: 924 case ACT_CLONEFROMREMOTE:
925 QMessageBox::information(this, "clone", runner -> getStdOut()); 925 QMessageBox::information(this, "Clone", runner -> getStdOut());
926 enableDisableActions(); 926 enableDisableActions();
927 shouldHgStat = true; 927 shouldHgStat = true;
928 break; 928 break;
929 929
930 case ACT_LOG: 930 case ACT_LOG:
958 case ACT_HG_IGNORE: 958 case ACT_HG_IGNORE:
959 shouldHgStat = true; 959 shouldHgStat = true;
960 break; 960 break;
961 961
962 case ACT_UPDATE: 962 case ACT_UPDATE:
963 QMessageBox::information(this, "update", runner -> getStdOut()); 963 QMessageBox::information(this, tr("Update"), runner -> getStdOut());
964 shouldHgStat = true; 964 shouldHgStat = true;
965 break; 965 break;
966 966
967 case ACT_MERGE: 967 case ACT_MERGE:
968 QMessageBox::information(this, "merge", runner -> getStdOut()); 968 QMessageBox::information(this, tr("Merge"), runner -> getStdOut());
969 shouldHgStat = true; 969 shouldHgStat = true;
970 justMerged = true; 970 justMerged = true;
971 break; 971 break;
972 972
973 case ACT_RETRY_MERGE: 973 case ACT_RETRY_MERGE:
974 QMessageBox::information(this, "retry merge", runner -> getStdOut()); 974 QMessageBox::information(this, "Merge retry", runner -> getStdOut());
975 shouldHgStat = true; 975 shouldHgStat = true;
976 justMerged = true; 976 justMerged = true;
977 break; 977 break;
978 978
979 default: 979 default:
980 break; 980 break;
981 } 981 }
982 } 982 }
983 983
984
984 //Typical sequence goes stat -> heads -> parents -> log 985 //Typical sequence goes stat -> heads -> parents -> log
985 if (runningAction == ACT_STAT) 986 if (runningAction == ACT_STAT)
986 { 987 {
987 runningAction = ACT_NONE; 988 runningAction = ACT_NONE;
988 hgHeads(); 989 hgHeads();
994 } 995 }
995 else if (runningAction == ACT_PARENTS) 996 else if (runningAction == ACT_PARENTS)
996 { 997 {
997 runningAction = ACT_NONE; 998 runningAction = ACT_NONE;
998 hgLog(); 999 hgLog();
1000 }
1001 else if ((runningAction == ACT_MERGE) && (exitCode != 0))
1002 {
1003 //If we had a failed merge, offer to retry
1004 if (QMessageBox::Ok == QMessageBox::information(this, tr("Retry merge ?"), tr("Merge attempt failed. retry ?"), QMessageBox::Ok | QMessageBox::Cancel))
1005 {
1006 runningAction = ACT_NONE;
1007 hgRetryMerge();
1008 }
1009 else
1010 {
1011 runningAction = ACT_NONE;
1012 hgStat();
1013 }
999 } 1014 }
1000 else 1015 else
1001 { 1016 {
1002 runningAction = ACT_NONE; 1017 runningAction = ACT_NONE;
1003 if (shouldHgStat) 1018 if (shouldHgStat)