comparison mainwindow.cpp @ 306:b280a2dc0512 status_outside_tabs

Merge from the default branch
author Chris Cannam
date Sat, 26 Feb 2011 23:04:18 +0000
parents 031dddcd967f 7708149d252a
children 5b4aa1c24407
comparison
equal deleted inserted replaced
304:031dddcd967f 306:b280a2dc0512
325 m_runner->requestAction(HgAction(ACT_LOG, m_workFolderPath, params)); 325 m_runner->requestAction(HgAction(ACT_LOG, m_workFolderPath, params));
326 } 326 }
327 327
328 void MainWindow::hgLogIncremental(QStringList prune) 328 void MainWindow::hgLogIncremental(QStringList prune)
329 { 329 {
330 // Sometimes we can be called with prune empty -- it represents
331 // the current heads, but if we have none already and for some
332 // reason are being prompted for an incremental update, we may run
333 // into trouble. In that case, make this a full log instead
334
335 if (prune.empty()) {
336 hgLog();
337 return;
338 }
339
330 QStringList params; 340 QStringList params;
331 params << "log"; 341 params << "log";
332 342
333 foreach (QString p, prune) { 343 foreach (QString p, prune) {
334 params << "--prune" << Changeset::hashOf(p); 344 params << "--prune" << Changeset::hashOf(p);
906 return ret; 916 return ret;
907 } 917 }
908 918
909 void MainWindow::clearState() 919 void MainWindow::clearState()
910 { 920 {
921 DEBUG << "MainWindow::clearState" << endl;
911 foreach (Changeset *cs, m_currentParents) delete cs; 922 foreach (Changeset *cs, m_currentParents) delete cs;
912 m_currentParents.clear(); 923 m_currentParents.clear();
913 foreach (Changeset *cs, m_currentHeads) delete cs; 924 foreach (Changeset *cs, m_currentHeads) delete cs;
914 m_currentHeads.clear(); 925 m_currentHeads.clear();
915 m_currentBranch = ""; 926 m_currentBranch = "";
1905 oldHeadIds = Changeset::getIds(m_currentHeads); 1916 oldHeadIds = Changeset::getIds(m_currentHeads);
1906 Changesets newHeads = Changeset::parseChangesets(output); 1917 Changesets newHeads = Changeset::parseChangesets(output);
1907 QStringList newHeadIds = Changeset::getIds(newHeads); 1918 QStringList newHeadIds = Changeset::getIds(newHeads);
1908 if (oldHeadIds != newHeadIds) { 1919 if (oldHeadIds != newHeadIds) {
1909 DEBUG << "Heads changed, will prompt an incremental log if appropriate" << endl; 1920 DEBUG << "Heads changed, will prompt an incremental log if appropriate" << endl;
1921 DEBUG << "Old heads: " << oldHeadIds.join(",") << endl;
1922 DEBUG << "New heads: " << newHeadIds.join(",") << endl;
1910 headsChanged = true; 1923 headsChanged = true;
1911 foreach (Changeset *cs, m_currentHeads) delete cs; 1924 foreach (Changeset *cs, m_currentHeads) delete cs;
1912 m_currentHeads = newHeads; 1925 m_currentHeads = newHeads;
1913 } 1926 }
1914 } 1927 }