MCPcopy Create free account
hub / github.com/KDE/kdevelop / commit

Method commit

kdevplatform/vcs/vcspluginhelper.cpp:490–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488}
489
490void VcsPluginHelper::commit()
491{
492 Q_D(VcsPluginHelper);
493
494 Q_ASSERT(!d->ctxUrls.isEmpty());
495
496 if (!ICore::self()->documentController()->saveAllDocuments()) {
497 return; // canceled by the user
498 }
499
500 QUrl url = d->ctxUrls.first();
501
502 // We start the commit UI no matter whether there is real differences, as it can also be used to commit untracked files
503 auto* patchSource = new VCSCommitDiffPatchSource(new VCSStandardDiffUpdater(d->vcs, url));
504
505 bool ret = showVcsDiff(patchSource);
506
507 if(!ret) {
508 ScopedDialog<VcsCommitDialog> commitDialog(patchSource);
509 commitDialog->setCommitCandidates(patchSource->infos());
510 commitDialog->exec();
511 }
512}
513
514void VcsPluginHelper::push()
515{

Callers

nothing calls this directly

Calls 7

showVcsDiffFunction · 0.85
saveAllDocumentsMethod · 0.80
documentControllerMethod · 0.80
setCommitCandidatesMethod · 0.80
execMethod · 0.80
isEmptyMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected