changeset 122:c3e8342d2de9

* Further fix to incremental log (put new changesets on the correct end of the list!)
author Chris Cannam
date Mon, 29 Nov 2010 11:14:29 +0000
parents 6ce2ceb2c3a5
children 3afa1ce339ec
files grapher.cpp hgrunner.cpp historywidget.cpp historywidget.h mainwindow.cpp
diffstat 5 files changed, 18 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/grapher.cpp	Mon Nov 29 11:04:52 2010 +0000
+++ b/grapher.cpp	Mon Nov 29 11:14:29 2010 +0000
@@ -123,7 +123,7 @@
     }
 
     Changeset *cs = m_changesets[id];
-//    DEBUG << "layoutCol: Looking at " << id.toStdString() << endl;
+    DEBUG << "layoutCol: Looking at " << id.toStdString() << endl;
 
     ChangesetItem *item = m_items[id];
 
@@ -180,7 +180,7 @@
         break;
     }
 
-//    DEBUG << "putting " << cs->id().toStdString() << " at col " << col << endl;
+    DEBUG << "putting " << cs->id().toStdString() << " at col " << col << endl;
 
     m_alloc[row].insert(col);
     item->setColumn(col);
--- a/hgrunner.cpp	Mon Nov 29 11:04:52 2010 +0000
+++ b/hgrunner.cpp	Mon Nov 29 11:14:29 2010 +0000
@@ -52,7 +52,7 @@
     closeTerminal();
     if (m_proc) {
         m_proc->kill();
-        delete m_proc;
+        m_proc->deleteLater();
     }
 }
 
--- a/historywidget.cpp	Mon Nov 29 11:04:52 2010 +0000
+++ b/historywidget.cpp	Mon Nov 29 11:14:29 2010 +0000
@@ -55,7 +55,7 @@
 void HistoryWidget::parseNewLog(QString log)
 {
     DEBUG << "HistoryWidget::parseNewLog: log has " << log.length() << " chars" << endl;
-    Changesets csets = parseChangeSets(log);
+    Changesets csets = Changeset::parseChangesets(log);
     DEBUG << "HistoryWidget::parseNewLog: log has " << csets.size() << " changesets" << endl;
     clearChangesets();
     m_changesets = csets;
@@ -65,16 +65,19 @@
 void HistoryWidget::parseIncrementalLog(QString log)
 {
     DEBUG << "HistoryWidget::parseIncrementalLog: log has " << log.length() << " chars" << endl;
-    Changesets csets = parseChangeSets(log);
+    Changesets csets = Changeset::parseChangesets(log);
     DEBUG << "HistoryWidget::parseIncrementalLog: log has " << csets.size() << " changesets" << endl;
     if (!csets.empty()) {
-        m_changesets << csets;
+        csets << m_changesets;
+        m_changesets = csets;
         layoutAll();
     }
 }
 
 void HistoryWidget::layoutAll()
 {
+    setChangesetParents();
+
     ChangesetScene *scene = new ChangesetScene();
     ChangesetItem *tipItem = 0;
 
@@ -98,16 +101,14 @@
     if (tipItem) tipItem->ensureVisible();
 }
 
-Changesets HistoryWidget::parseChangeSets(QString changeSetsStr)
+void HistoryWidget::setChangesetParents()
 {
-    Changesets csets = Changeset::parseChangesets(changeSetsStr);
-    for (int i = 0; i+1 < csets.size(); ++i) {
-        Changeset *cs = csets[i];
+    for (int i = 0; i+1 < m_changesets.size(); ++i) {
+        Changeset *cs = m_changesets[i];
         if (cs->parents().empty()) {
             QStringList list;
-            list.push_back(csets[i+1]->id());
+            list.push_back(m_changesets[i+1]->id());
             cs->setParents(list);
         }
     }
-    return csets;
 }
--- a/historywidget.h	Mon Nov 29 11:04:52 2010 +0000
+++ b/historywidget.h	Mon Nov 29 11:14:29 2010 +0000
@@ -44,7 +44,7 @@
 
     void clearChangesets();
     void layoutAll();
-    Changesets parseChangeSets(QString);
+    void setChangesetParents();
 };
 
 #endif
--- a/mainwindow.cpp	Mon Nov 29 11:04:52 2010 +0000
+++ b/mainwindow.cpp	Mon Nov 29 11:14:29 2010 +0000
@@ -1023,13 +1023,15 @@
             this, SLOT(fsFileChanged(QString)));
 }
 
-void MainWindow::fsDirectoryChanged(QString)
+void MainWindow::fsDirectoryChanged(QString d)
 {
+    DEBUG << "MainWindow::fsDirectoryChanged " << d << endl;
     hgStat();
 }
 
-void MainWindow::fsFileChanged(QString)
+void MainWindow::fsFileChanged(QString f)
 {
+    DEBUG << "MainWindow::fsFileChanged " << f << endl;
     hgStat();
 }