# HG changeset patch
# User Chris Cannam
# Date 1298761458 0
# Node ID b280a2dc051278d1a7c018d4e27ae0c1e6796d27
# Parent  031dddcd967fe823a0f3a3d12e20903c85678ccd# Parent  7708149d252a5f6432118fe89bd8111e09c21454
Merge from the default branch

diff -r 031dddcd967f -r b280a2dc0512 historywidget.cpp
--- a/historywidget.cpp	Tue Feb 22 15:57:09 2011 +0000
+++ b/historywidget.cpp	Sat Feb 26 23:04:18 2011 +0000
@@ -141,7 +141,8 @@
         m_newIds.insert(cs->id());
     }
 
-    DEBUG << "addChangesets: " << csets.size() << " new changesets" << endl;
+    DEBUG << "addChangesets: " << csets.size() << " new changesets have ("
+          << m_changesets.size() << " already)" << endl;
 
     csets << m_changesets;
     m_changesets = csets;
diff -r 031dddcd967f -r b280a2dc0512 mainwindow.cpp
--- a/mainwindow.cpp	Tue Feb 22 15:57:09 2011 +0000
+++ b/mainwindow.cpp	Sat Feb 26 23:04:18 2011 +0000
@@ -327,6 +327,16 @@
 
 void MainWindow::hgLogIncremental(QStringList prune)
 {
+    // Sometimes we can be called with prune empty -- it represents
+    // the current heads, but if we have none already and for some
+    // reason are being prompted for an incremental update, we may run
+    // into trouble.  In that case, make this a full log instead
+
+    if (prune.empty()) {
+        hgLog();
+        return;
+    }
+
     QStringList params;
     params << "log";
 
@@ -908,6 +918,7 @@
 
 void MainWindow::clearState()
 {
+    DEBUG << "MainWindow::clearState" << endl;
     foreach (Changeset *cs, m_currentParents) delete cs;
     m_currentParents.clear();
     foreach (Changeset *cs, m_currentHeads) delete cs;
@@ -1907,6 +1918,8 @@
         QStringList newHeadIds = Changeset::getIds(newHeads);
         if (oldHeadIds != newHeadIds) {
             DEBUG << "Heads changed, will prompt an incremental log if appropriate" << endl;
+            DEBUG << "Old heads: " << oldHeadIds.join(",") << endl;
+            DEBUG << "New heads: " << newHeadIds.join(",") << endl;
             headsChanged = true;
             foreach (Changeset *cs, m_currentHeads) delete cs;
             m_currentHeads = newHeads;