comparison src/mainwindow.cpp @ 377:4d13cacb3e65

Add warning dialog if version of Mercurial discovered is too old
author Chris Cannam
date Mon, 28 Mar 2011 15:50:50 +0100
parents b9c153e00e84
children ad2e56d1e4c4
comparison
equal deleted inserted replaced
376:5a93ae4667d6 377:4d13cacb3e65
217 } 217 }
218 218
219 void MainWindow::hgTest() 219 void MainWindow::hgTest()
220 { 220 {
221 QStringList params; 221 QStringList params;
222 //!!! should we test version output? Really we want at least 1.7.x
223 //!!! for options such as merge --tool
224 params << "--version"; 222 params << "--version";
225 m_runner->requestAction(HgAction(ACT_TEST_HG, m_myDirPath, params)); 223 m_runner->requestAction(HgAction(ACT_TEST_HG, m_myDirPath, params));
226 } 224 }
227 225
228 void MainWindow::hgTestExtension() 226 void MainWindow::hgTestExtension()
1978 QStringList oldHeadIds; 1976 QStringList oldHeadIds;
1979 1977
1980 switch (action) { 1978 switch (action) {
1981 1979
1982 case ACT_TEST_HG: 1980 case ACT_TEST_HG:
1983 break; 1981 {
1982 QRegExp versionRE("^Mercurial.*version ([\\d+])\\.([\\d+])");
1983 int pos = versionRE.indexIn(output);
1984 if (pos >= 0) {
1985 int major = versionRE.cap(1).toInt();
1986 int minor = versionRE.cap(2).toInt();
1987 // We need v1.7 or newer
1988 if (major < 1 || (major == 1 && minor < 7)) {
1989 MoreInformationDialog::warning
1990 (this,
1991 tr("Newer Mercurial version required"),
1992 tr("Newer Mercurial version required"),
1993 tr("To use EasyMercurial, you should have at least Mercurial v1.7 installed.<br><br>The version found on this system (v%1.%2) does not support all of the features required by EasyMercurial.").arg(major).arg(minor),
1994 output);
1995 }
1996 }
1997 break;
1998 }
1984 1999
1985 case ACT_TEST_HG_EXT: 2000 case ACT_TEST_HG_EXT:
1986 break; 2001 break;
1987 2002
1988 case ACT_QUERY_PATHS: 2003 case ACT_QUERY_PATHS: