comparison grapher.cpp @ 74:10eb97683aa9

* Show branch names even for changes with children, if those children are on a different branch * Pick up remote repo path from local repo via hg paths * Some work towards breaking down files into various groups based on status * Add /usr/local/bin to path for hg (temporary hack I hope)
author Chris Cannam
date Fri, 19 Nov 2010 14:54:19 +0000
parents f583e44d9d31
children 729438d70af8
comparison
equal deleted inserted replaced
73:a773c6e7b301 74:10eb97683aa9
351 item->setY(0); 351 item->setY(0);
352 m_items[id] = item; 352 m_items[id] = item;
353 m_scene->addItem(item); 353 m_scene->addItem(item);
354 } 354 }
355 355
356 // Add the connecting lines
357
356 foreach (Changeset *cs, csets) { 358 foreach (Changeset *cs, csets) {
357 QString id = cs->id(); 359 QString id = cs->id();
358 ChangesetItem *item = m_items[id]; 360 ChangesetItem *item = m_items[id];
359 bool merge = (cs->parents().size() > 1); 361 bool merge = (cs->parents().size() > 1);
360 foreach (QString parentId, cs->parents()) { 362 foreach (QString parentId, cs->parents()) {
367 conn->setParent(m_items[parentId]); 369 conn->setParent(m_items[parentId]);
368 m_scene->addItem(conn); 370 m_scene->addItem(conn);
369 } 371 }
370 } 372 }
371 373
374 // Add the branch labels
375 foreach (Changeset *cs, csets) {
376 QString id = cs->id();
377 ChangesetItem *item = m_items[id];
378 bool haveChildOnSameBranch = false;
379 foreach (QString childId, cs->children()) {
380 Changeset *child = m_changesets[childId];
381 if (child->branch() == cs->branch()) {
382 haveChildOnSameBranch = true;
383 break;
384 }
385 }
386 item->setShowBranch(!haveChildOnSameBranch);
387 }
388
372 // We need to lay out the changesets in forward chronological 389 // We need to lay out the changesets in forward chronological
373 // order. We have no guarantees about the order in which 390 // order. We have no guarantees about the order in which
374 // changesets appear in the list -- in a simple repository they 391 // changesets appear in the list -- in a simple repository they
375 // will generally be reverse chronological, but that's far from 392 // will generally be reverse chronological, but that's far from
376 // guaranteed. So, sort explicitly using the date comparator 393 // guaranteed. So, sort explicitly using the date comparator