comparison mainwindow.cpp @ 200:8c8c04bdf0fa

* Separate out the hg test action into two tests, one for plain hg and one with the extension (so can report separately)
author Chris Cannam
date Tue, 04 Jan 2011 12:42:28 +0000
parents f16fe0db11f3
children 3d4291d4226c
comparison
equal deleted inserted replaced
199:f16fe0db11f3 200:8c8c04bdf0fa
192 QStringList params; 192 QStringList params;
193 params << "--version"; 193 params << "--version";
194 runner->requestAction(HgAction(ACT_TEST_HG, m_myDirPath, params)); 194 runner->requestAction(HgAction(ACT_TEST_HG, m_myDirPath, params));
195 } 195 }
196 196
197 void MainWindow::hgTestExtension()
198 {
199 QStringList params;
200 params << "--version";
201 runner->requestAction(HgAction(ACT_TEST_HG_EXT, m_myDirPath, params));
202 }
203
197 void MainWindow::hgStat() 204 void MainWindow::hgStat()
198 { 205 {
199 QStringList params; 206 QStringList params;
200 207
201 if (showAllFiles) { 208 if (showAllFiles) {
1485 return; 1492 return;
1486 case ACT_TEST_HG: 1493 case ACT_TEST_HG:
1487 QMessageBox::warning 1494 QMessageBox::warning
1488 (this, tr("Failed to run Mercurial"), 1495 (this, tr("Failed to run Mercurial"),
1489 format3(tr("Failed to run Mercurial"), 1496 format3(tr("Failed to run Mercurial"),
1490 tr("The Mercurial program either could not be found or failed to run.<br>This may indicate a problem with the Mercurial installation, or with the EasyHg interaction extension.<br><br>%1").arg(output == "" ? QString("") : tr("The test command said:")), 1497 tr("The Mercurial program either could not be found or failed to run.<br>Check that the Mercurial program path is correct in Settings.<br><br>%1").arg(output == "" ? QString("") : tr("The test command said:")),
1498 output));
1499 settings();
1500 return;
1501 case ACT_TEST_HG_EXT:
1502 QMessageBox::warning
1503 (this, tr("Failed to run Mercurial"),
1504 format3(tr("Failed to run Mercurial with extension enabled"),
1505 tr("The Mercurial program failed to run with the EasyMercurial interaction extension enabled.<br>This may indicate an installation problem with EasyMercurial.<br><br>You may be able to continue working if you switch off &ldquo;Use EasyHg Mercurial Extension&rdquo; in Settings. Note that remote repositories that require authentication may not work if you do this.<br><br>%1").arg(output == "" ? QString("") : tr("The test command said:")),
1491 output)); 1506 output));
1492 settings(); 1507 settings();
1493 return; 1508 return;
1494 case ACT_INCOMING: 1509 case ACT_INCOMING:
1495 // returns non-zero code if the check was successful but there 1510 // returns non-zero code if the check was successful but there
1553 switch (action) { 1568 switch (action) {
1554 1569
1555 case ACT_TEST_HG: 1570 case ACT_TEST_HG:
1556 break; 1571 break;
1557 1572
1573 case ACT_TEST_HG_EXT:
1574 break;
1575
1558 case ACT_QUERY_PATHS: 1576 case ACT_QUERY_PATHS:
1559 { 1577 {
1560 DEBUG << "stdout is " << output << endl; 1578 DEBUG << "stdout is " << output << endl;
1561 LogParser lp(output, "="); 1579 LogParser lp(output, "=");
1562 LogList ll = lp.parse(); 1580 LogList ll = lp.parse();
1739 bool noMore = false; 1757 bool noMore = false;
1740 1758
1741 switch (action) { 1759 switch (action) {
1742 1760
1743 case ACT_TEST_HG: 1761 case ACT_TEST_HG:
1762 hgTestExtension();
1763 break;
1764
1765 case ACT_TEST_HG_EXT:
1744 hgQueryPaths(); 1766 hgQueryPaths();
1745 break; 1767 break;
1746 1768
1747 case ACT_QUERY_PATHS: 1769 case ACT_QUERY_PATHS:
1748 hgQueryBranch(); 1770 hgQueryBranch();