本文整理汇总了C++中GitClient::synchronousMerge方法的典型用法代码示例。如果您正苦于以下问题:C++ GitClient::synchronousMerge方法的具体用法?C++ GitClient::synchronousMerge怎么用?C++ GitClient::synchronousMerge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitClient
的用法示例。
在下文中一共展示了GitClient::synchronousMerge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: merge
bool BranchUtils::merge(bool allowFastForward)
{
if (!Core::DocumentManager::saveAllModifiedDocuments())
return false;
const QModelIndex selected = selectedIndex();
QTC_CHECK(selected != m_model->currentBranch());
const QString branch = m_model->fullName(selected, true);
GitClient *client = GitPlugin::client();
if (client->beginStashScope(m_repository, "merge", AllowUnstashed))
return client->synchronousMerge(m_repository, branch, allowFastForward);
return false;
}
示例2: merge
void BranchDialog::merge()
{
if (!Core::DocumentManager::saveAllModifiedDocuments())
return;
QModelIndex idx = selectedIndex();
QTC_CHECK(idx != m_model->currentBranch()); // otherwise the button would not be enabled!
const QString branch = m_model->fullName(idx, true);
GitClient *client = GitPlugin::instance()->gitClient();
bool allowFastForward = true;
if (client->isFastForwardMerge(m_repository, branch)) {
QMenu popup;
QAction *fastForward = popup.addAction(tr("Fast-Forward"));
popup.addAction(tr("No Fast-Forward"));
QAction *chosen = Utils::execMenuAtWidget(&popup, m_ui->mergeButton);
if (!chosen)
return;
allowFastForward = (chosen == fastForward);
}
if (client->beginStashScope(m_repository, QLatin1String("merge"), AllowUnstashed))
client->synchronousMerge(m_repository, branch, allowFastForward);
}