changeset 123:3afa1ce339ec

* Another fix to incremental log -- ensure children are not duplicated in changeset
author Chris Cannam
date Mon, 29 Nov 2010 11:18:27 +0000
parents c3e8342d2de9
children 1f27f71a7034
files changeset.h historywidget.cpp
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/changeset.h	Mon Nov 29 11:14:29 2010 +0000
+++ b/changeset.h	Mon Nov 29 11:18:27 2010 +0000
@@ -57,8 +57,13 @@
     qulonglong timestamp() const { return m_timestamp; }
     QString age() const { return m_age; }
     QStringList parents() const { return m_parents; }
+    QString comment() const { return m_comment; }
+
+    /**
+     * The children property is not obtained from Hg, but set in
+     * Grapher::layout() based on reported parents
+     */
     QStringList children() const { return m_children; }
-    QString comment() const { return m_comment; }
 
     int number() const {
         return id().split(':')[0].toInt();
--- a/historywidget.cpp	Mon Nov 29 11:14:29 2010 +0000
+++ b/historywidget.cpp	Mon Nov 29 11:18:27 2010 +0000
@@ -105,6 +105,10 @@
 {
     for (int i = 0; i+1 < m_changesets.size(); ++i) {
         Changeset *cs = m_changesets[i];
+        // Need to reset this, as Grapher::layout will recalculate it
+        // and we don't want to end up with twice the children for
+        // each parent...
+        cs->setChildren(QStringList());
         if (cs->parents().empty()) {
             QStringList list;
             list.push_back(m_changesets[i+1]->id());