Mercurial > hg > easyhg
diff src/grapher.cpp @ 506:470829a21f98
Identify closed branches and display them in a lighter shade
author | Chris Cannam |
---|---|
date | Mon, 17 Oct 2011 22:08:05 +0100 |
parents | 69fb864a3972 |
children | c43880dfdb78 |
line wrap: on
line diff
--- a/src/grapher.cpp Mon Oct 17 16:25:02 2011 +0100 +++ b/src/grapher.cpp Mon Oct 17 22:08:05 2011 +0100 @@ -435,6 +435,35 @@ } } + // Ensure the closed branches are all marked as closed + + foreach (QString closedId, m_closedIds) { + + if (!m_items.contains(closedId)) continue; + + Changeset *cs = m_changesets[closedId]; + ChangesetItem *item = m_items[closedId]; + + while (cs && item) { + + if (cs->children().size() > 1) { + break; + } + + item->setClosed(true); + + int pcount = cs->parents().size(); + if (pcount >= 1) { + QString pid = cs->parents()[0]; + if (!m_items.contains(pid)) break; + cs = m_changesets[pid]; + item = m_items[pid]; + } else { + item = 0; + } + } + } + // Add uncommitted item and connecting line as necessary if (!m_uncommittedParents.empty()) {