# HG changeset patch # User Chris Cannam # Date 1291290675 0 # Node ID 2b997861174be0d94c0bf9d7e6b7568ea9af42da # Parent c91445ee3d578919bec59af7b6a2ed9e312a8535 * Set parents (setCurrent) on history widget when we know the new parents, not at each enable-disable actions call diff -r c91445ee3d57 -r 2b997861174b hgtabwidget.cpp --- a/hgtabwidget.cpp Thu Dec 02 11:33:09 2010 +0000 +++ b/hgtabwidget.cpp Thu Dec 02 11:51:15 2010 +0000 @@ -73,9 +73,9 @@ m_fileStatusWidget->clearSelections(); } -void HgTabWidget::setCurrent(QStringList ids, bool showUncommittedChanges) +void HgTabWidget::setCurrent(QStringList ids) { - m_historyWidget->setCurrent(ids, showUncommittedChanges); + m_historyWidget->setCurrent(ids, canCommit()); } bool HgTabWidget::canCommit() const diff -r c91445ee3d57 -r 2b997861174b hgtabwidget.h --- a/hgtabwidget.h Thu Dec 02 11:33:09 2010 +0000 +++ b/hgtabwidget.h Thu Dec 02 11:51:15 2010 +0000 @@ -48,7 +48,7 @@ void setWorkFolderAndRepoNames(QString workFolderPath, QString remoteRepoPath); void setState(QString state); - void setCurrent(QStringList ids, bool showUncommittedChanges); + void setCurrent(QStringList ids); FileStates getFileStates() { return m_fileStates; } diff -r c91445ee3d57 -r 2b997861174b mainwindow.cpp --- a/mainwindow.cpp Thu Dec 02 11:33:09 2010 +0000 +++ b/mainwindow.cpp Thu Dec 02 11:51:15 2010 +0000 @@ -1286,8 +1286,12 @@ break; case ACT_QUERY_PARENTS: + { foreach (Changeset *cs, currentParents) delete cs; currentParents = Changeset::parseChangesets(output); + QStringList parentIds = Changeset::getIds(currentParents); + hgTabs->setCurrent(parentIds); + } break; case ACT_QUERY_HEADS: @@ -1596,10 +1600,6 @@ hgMergeAct->setEnabled(localRepoActionsEnabled && canMerge); hgUpdateAct->setEnabled(localRepoActionsEnabled && canUpdate); - QStringList ids; - foreach (Changeset *cs, currentParents) ids.push_back(cs->id()); - hgTabs->setCurrent(ids, hgTabs->canCommit()); - // Set the state field on the file status widget QString branchText;