comparison grapher.cpp @ 311:4811eb34e819 new-branches-with-status-outside-tabs

Add Start New Branch and Cancel New Branch to uncommitted item menu; add branch name to Commit dialog
author Chris Cannam
date Tue, 01 Mar 2011 14:22:29 +0000
parents cc95394e2392
children
comparison
equal deleted inserted replaced
308:7f50c040e13d 311:4811eb34e819
230 << " differs from my branch " << cs->branch() 230 << " differs from my branch " << cs->branch()
231 << ", asking it to show branch" << endl; 231 << ", asking it to show branch" << endl;
232 m_uncommitted->setShowBranch(true); 232 m_uncommitted->setShowBranch(true);
233 } 233 }
234 } 234 }
235
235 236
236 // Normally the children will lay out themselves, but we can do 237 // Normally the children will lay out themselves, but we can do
237 // a better job in some special cases: 238 // a better job in some special cases:
238 239
239 int nchildren = cs->children().size(); 240 int nchildren = cs->children().size();
429 } 430 }
430 431
431 // Add uncommitted item and connecting line as necessary 432 // Add uncommitted item and connecting line as necessary
432 433
433 if (!m_uncommittedParents.empty()) { 434 if (!m_uncommittedParents.empty()) {
435
434 m_uncommitted = new UncommittedItem(); 436 m_uncommitted = new UncommittedItem();
435 m_uncommitted->setBranch(uncommittedBranch); 437 m_uncommitted->setBranch(uncommittedBranch);
436 m_uncommitted->setZValue(10); 438 m_uncommitted->setZValue(10);
437 m_scene->addUncommittedItem(m_uncommitted); 439 m_scene->addUncommittedItem(m_uncommitted);
440
441 bool haveParentOnBranch = false;
438 foreach (QString p, m_uncommittedParents) { 442 foreach (QString p, m_uncommittedParents) {
439 ConnectionItem *conn = new ConnectionItem(); 443 ConnectionItem *conn = new ConnectionItem();
440 conn->setConnectionType(ConnectionItem::Merge); 444 conn->setConnectionType(ConnectionItem::Merge);
441 conn->setParent(m_items[p]); 445 ChangesetItem *pitem = m_items[p];
446 conn->setParent(pitem);
442 conn->setChild(m_uncommitted); 447 conn->setChild(m_uncommitted);
443 conn->setZValue(0); 448 conn->setZValue(0);
444 m_scene->addItem(conn); 449 m_scene->addItem(conn);
445 } 450 if (pitem) {
451 if (pitem->getChangeset()->branch() == uncommittedBranch) {
452 haveParentOnBranch = true;
453 }
454 }
455 }
456
457 // If the uncommitted item has no parents on the same branch,
458 // tell it it has a new branch (the "show branch" flag is set
459 // elsewhere for this item)
460 m_uncommitted->setIsNewBranch(!haveParentOnBranch);
446 } 461 }
447 462
448 // Add the branch labels 463 // Add the branch labels
449 464
450 foreach (Changeset *cs, csets) { 465 foreach (Changeset *cs, csets) {