Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
43,300
boolean () { Collection<Change> localChanges = LocalChangesUnderRoots.getChangesUnderRoots(Collections.singletonList(myRoot), myProject).get(myRoot); try { return !ContainerUtil.isEmpty(localChanges) || GitUtil.hasLocalChanges(true, myProject, myRoot); } catch (VcsException e) { LOG.info("isSaveNeeded failed to check l...
isSaveNeeded
43,301
GitUpdateResult () { LOG.info("doUpdate "); String remoteBranch = getRemoteBranchToMerge(); List<String> params = Collections.singletonList(remoteBranch); GitUpdateResult result = myRebaser.rebase(myRoot, params); if (result == GitUpdateResult.CANCEL) { myRebaser.abortRebase(myRoot); } return result; }
doUpdate
43,302
String () { return myBranchPair.getTarget().getName(); }
getRemoteBranchToMerge
43,303
String () { return "Rebase updater"; }
toString
43,304
boolean () { LOG.info("Trying fast-forward merge for " + myRoot); GitRepository repository = GitUtil.getRepositoryManager(myProject).getRepositoryForRoot(myRoot); if (repository == null) { LOG.error("Repository is null for " + myRoot); return false; } try { markStart(repository); } catch (VcsException e) { LOG.info("Co...
fastForwardMerge
43,305
void (UpdatedFiles updatedFiles) { //unused, there are no custom categories yet }
fillGroups
43,306
boolean (Collection<FilePath> filePaths) { return true; }
validateOptions
43,307
boolean () { // If the log won't be refreshed after update, we won't be able to build a visible pack for the updated range. // Unless we force refresh it by hands, but if we do it, calculating update project info would take enormous amount of time & memory. boolean keepLogUpToDate = PostponableLogRefresher.keepUpToDate...
hasCustomNotification
43,308
UpdateSession (Project project, FilePath[] filePaths, UpdatedFiles updatedFiles, ProgressIndicator progressIndicator, UpdateMethod updateMethod, Map<GitRepository, GitBranchPair> updateConfig) { GitRepositoryManager manager = GitRepositoryManager.getInstance(project); Set<GitRepository> repositories = ContainerUtil.map...
performUpdate
43,309
String () { return "reference.VersionControl.Git.UpdateProject"; }
getHelpTopic
43,310
JComponent () { myPanel = new GitUpdateOptionsPanel(mySettings); return myPanel.getPanel(); }
createComponent
43,311
boolean () { return myPanel.isModified(); }
isModified
43,312
void () { myPanel.applyTo(); }
apply
43,313
void () { myPanel.updateFrom(); }
reset
43,314
void () { myPanel = null; }
disposeUIResources
43,315
Decision (final int index) { return Objects.requireNonNull(ContainerUtil.find(values(), decision -> decision.ordinal() == index)); }
getOption
43,316
int () { return MERGE_INSTEAD.ordinal(); }
getDefaultButtonIndex
43,317
int () { return REBASE_ANYWAY.ordinal(); }
getFocusedButtonIndex
43,318
boolean (@NotNull Project project, @NotNull VirtualFile root, @NotNull String baseRef, @NotNull String currentRef) { String range = baseRef + ".." + currentRef; try { List<GitCommit> commits = GitHistoryUtils.history(project, root, range, "--merges"); return StreamEx.of(commits).anyMatch(commit -> !commit.getChanges()....
hasProblem
43,319
Decision () { final Ref<Decision> decision = Ref.create(); ApplicationManager.getApplication().invokeAndWait(() -> decision.set(doShowDialog())); return decision.get(); }
showDialog
43,320
Decision () { int decision = DialogManager.showMessage(GitBundle.message("dialog.message.rebasing.merge.commits"), GitBundle.message("dialog.title.rebasing.merge.commits"), Decision.getButtonTitles(), Decision.getDefaultButtonIndex(), Decision.getFocusedButtonIndex(), Messages.getWarningIcon(), null); return Decision.g...
doShowDialog
43,321
GitUpdater (@NotNull Project project, @NotNull Git git, @NotNull GitBranchPair trackedBranches, @NotNull GitRepository repository, @NotNull ProgressIndicator progressIndicator, @NotNull UpdatedFiles updatedFiles, @NotNull UpdateMethod updateMethod) { if (updateMethod == UpdateMethod.BRANCH_DEFAULT) { updateMethod = res...
getUpdater
43,322
UpdateMethod (@NotNull GitRepository repository) { Project project = repository.getProject(); GitLocalBranch branch = repository.getCurrentBranch(); if (branch != null) { String branchName = branch.getName(); try { String rebaseValue = GitConfigUtil.getValue(project, repository.getRoot(), "branch." + branchName + ".reb...
resolveUpdateMethod
43,323
boolean (@NotNull String configValue) { return GitConfigUtil.getBooleanValue(configValue) == Boolean.TRUE || configValue.equalsIgnoreCase("interactive") || configValue.equalsIgnoreCase("preserve"); // 'yes' is not specified in the man, but actually works }
isRebaseValue
43,324
GitFetchResult () { return new GitFetchResult(Type.SUCCESS); }
success
43,325
GitFetchResult (Collection<Exception> errors) { GitFetchResult result = new GitFetchResult(Type.ERROR); result.myErrors = errors; return result; }
error
43,326
GitFetchResult (Exception error) { return error(Collections.singletonList(error)); }
error
43,327
GitFetchResult (@NotNull String errorMessage) { return error(new Exception(errorMessage)); }
error
43,328
boolean () { return myType == Type.SUCCESS; }
isSuccess
43,329
boolean () { return myType == Type.NOT_AUTHORIZED; }
isNotAuthorized
43,330
boolean () { return myType == Type.ERROR; }
isError
43,331
void (@NotNull Collection<String> prunedRefs) { myPrunedRefs.addAll(prunedRefs); }
addPruneInfo
43,332
Collection<String> () { return myPrunedRefs; }
getPrunedRefs
43,333
GitUpdateResult () { LOG.info("doUpdate "); final GitMerger merger = new GitMerger(myProject); MergeLineListener mergeLineListener = new MergeLineListener(); GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector = new GitUntrackedFilesOverwrittenByOperationDetector(myRoot); String originalText = myProg...
doUpdate
43,334
GitUpdateResult (MergeLineListener mergeLineListener, GitMessageWithFilesDetector untrackedFilesWouldBeOverwrittenByMergeDetector, final GitMerger merger, GitCommandResult commandResult) { final MergeError error = mergeLineListener.getMergeError(); LOG.info("merge error: " + error); if (error == MergeError.CONFLICT) { ...
handleMergeFailure
43,335
boolean () { try { if (GitUtil.hasLocalChanges(true, myProject, myRoot)) { return true; } } catch (VcsException e) { LOG.info("isSaveNeeded failed to check staging area", e); return true; } // git log --name-status master..origin/master String currentBranch = myBranchPair.getSource().getName(); String remoteBranch = my...
isSaveNeeded
43,336
void () { GitLineHandler h = new GitLineHandler(myProject, myRoot, GitCommand.RESET); h.addParameters("--merge"); GitCommandResult result = Git.getInstance().runCommand(h); if (!result.success()) { LOG.info("cancel git reset --merge: " + result.getErrorOutputAsJoinedString()); VcsNotifier.getInstance(myProject) .notify...
cancel
43,337
List<FilePath> (@NotNull List<String> mergeOutput) { final List<FilePath> paths = new ArrayList<>(); for (String line : mergeOutput) { if (StringUtil.isEmptyOrSpaces(line)) { continue; } if (line.contains("Please, commit your changes or stash them before you can merge")) { break; } line = line.trim(); final String path...
getFilesOverwrittenByMerge
43,338
Collection<Change> (List<FilePath> paths) { final Collection<Change> changes = new HashSet<>(); for (Change change : myChangeListManager.getAllChanges()) { final ContentRevision afterRevision = change.getAfterRevision(); final ContentRevision beforeRevision = change.getBeforeRevision(); if ((afterRevision != null && pa...
getLocalChangesFilteredByFiles
43,339
String () { return "Merge updater"; }
toString
43,340
void (String line, Key outputType) { if (myLocalChangesError) { myOutput.add(line); } else if (line.contains("Automatic merge failed; fix conflicts and then commit the result")) { myMergeError = MergeError.CONFLICT; } else if (line.contains("Your local changes to the following files would be overwritten by merge")) { m...
onLineAvailable
43,341
MergeError () { return myMergeError; }
getMergeError
43,342
List<String> () { return myOutput; }
getOutput
43,343
Params (Project project) { Params params = new Params(project); params.setErrorNotificationTitle(GitBundle.message("merge.update.project.generic.error.title")); params.setMergeDescription(GitBundle.message("merge.update.project.conflict.merge.description.label")); return params; }
makeParams
43,344
GitUpdateResult (final UpdateMethod updateMethod) { LOG.info("update started|" + updateMethod); String oldText = myProgressIndicator.getText(); myProgressIndicator.setText(GitBundle.message("update.process.progress.title")); // check if update is possible if (checkRebaseInProgress() || isMergeInProgress() || areUnmerge...
update
43,345
GitUpdateResult (@NotNull UpdateMethod updateMethod) { // re-read after fetch, remote branch might have been deleted Map<GitRepository, GitBranchPair> trackedBranches = myUpdateConfig != null ? myUpdateConfig : checkTrackedBranchesConfiguration(); if (trackedBranches == null) { return GitUpdateResult.NOT_READY; } Map<G...
updateImpl
43,346
Collection<GitRepository> (@NotNull Map<GitRepository, GitUpdater> updaters) { return ContainerUtil.mapNotNull(updaters.keySet(), repo -> { GitUpdater updater = updaters.get(repo); if (updater instanceof GitRebaseUpdater) { GitBranchPair sourceAndTarget = ((GitRebaseUpdater)updater).getSourceAndTarget(); String current...
findRootsRebasingOverMerge
43,347
GitUpdateResult (@Nullable GitUpdateResult compoundResult, GitUpdateResult result) { if (compoundResult == null) { return result; } return compoundResult.join(result); }
joinResults
43,348
boolean (@NotNull Map<GitRepository, GitBranchPair> updateConfig) { Collection<Pair<GitRepository, GitRemote>> remotes = ContainerUtil.mapNotNull(updateConfig.entrySet(), entry -> { GitRepository repository = entry.getKey(); GitBranch target = entry.getValue().getTarget(); if (target instanceof GitRemoteBranch) { retur...
fetchAndNotify
43,349
void (@NotNull GitRepository repository, @NotNull GitLocalBranch currentBranch) { VcsNotifier.getInstance(repository.getProject()) .notifyError( UPDATE_NO_TRACKED_BRANCH, GitBundle.message("update.notification.update.error"), getNoTrackedBranchError(repository, currentBranch.getName()), NotificationAction.createSimple(...
notifyNoTrackedBranchError
43,350
void (@NotNull GitRepository repository) { FixTrackedBranchDialog updateDialog = new FixTrackedBranchDialog(repository.getProject()); if (updateDialog.showAndGet()) { new GitUpdateExecutionProcess(repository.getProject(), myRepositories, updateDialog.getUpdateConfig(), updateDialog.getUpdateMethod(), updateDialog.shoul...
showUpdateDialog
43,351
void (@NotNull GitRepository repository) { VcsNotifier.getInstance(repository.getProject()) .notifyError(UPDATE_DETACHED_HEAD_ERROR, GitBundle.message("notification.title.can.t.update.no.current.branch"), getDetachedHeadErrorNotificationContent(repository)); }
notifyDetachedHeadError
43,352
boolean () { return GitVcsSettings.getInstance(myProject).getSyncSetting() == DvcsSyncSettings.Value.SYNC; }
isSyncControl
43,353
boolean () { LOG.info("isMergeInProgress: checking if there is an unfinished merge process..."); final Collection<VirtualFile> mergingRoots = myMerger.getMergingRoots(); if (mergingRoots.isEmpty()) { return false; } LOG.info("isMergeInProgress: roots with unfinished merge: " + mergingRoots); GitConflictResolver.Params ...
isMergeInProgress
43,354
boolean () { LOG.info("areUnmergedFiles: checking if there are unmerged files..."); GitConflictResolver.Params params = new GitConflictResolver.Params(myProject); params.setErrorNotificationTitle(GitBundle.message("update.process.generic.error.title")); params.setMergeDescription(GitBundle.message("update.process.error...
areUnmergedFiles
43,355
boolean () { LOG.info("checkRebaseInProgress: checking if there is an unfinished rebase process..."); final GitRebaser rebaser = new GitRebaser(myProject, myGit, myProgressIndicator); final Collection<VirtualFile> rebasingRoots = rebaser.getRebasingRoots(); if (rebasingRoots.isEmpty()) { return false; } LOG.info("check...
checkRebaseInProgress
43,356
void (@NotNull VcsLogUiPropertiesImpl.State state) { commonState = state; }
loadState
43,357
GitLineHandler () { GitLineHandler handler = new GitLineHandler(myProject, getGitRoot(), GitCommand.RESET); ResetMode type = myResetTypeComboBox.getItem(); if (type == ResetMode.SOFT) { handler.addParameters("--soft"); } else if (type == ResetMode.HARD) { handler.addParameters("--hard"); } else if (type == ResetMode.MI...
handler
43,358
VirtualFile () { return (VirtualFile)myGitRootComboBox.getSelectedItem(); }
getGitRoot
43,359
JComponent () { return myPanel; }
createCenterPanel
43,360
String () { return getClass().getName(); }
getDimensionServiceKey
43,361
String () { return "gitResetHead"; }
getHelpId
43,362
String () { return GitBundle.message(myId); }
toString
43,363
void (final ActionEvent e) { fetchTags(); validateFields(); }
actionPerformed
43,364
void (final @NotNull DocumentEvent e) { validateFields(); }
textChanged
43,365
void (final ActionEvent e) { if (myForceCheckBox.isEnabled()) { validateFields(); } }
actionPerformed
43,366
JComponent () { return myTagNameTextField; }
getPreferredFocusedComponent
43,367
void () { final String message = myMessageTextArea.getText(); final boolean hasMessage = message.trim().length() != 0; final File messageFile; if (hasMessage) { try { messageFile = FileUtil.createTempFile(MESSAGE_FILE_PREFIX, MESSAGE_FILE_SUFFIX); messageFile.deleteOnExit(); try (Writer out = new OutputStreamWriter(new...
runAction
43,368
void () { String text = myTagNameTextField.getText(); if (myExistingTags.contains(text)) { myForceCheckBox.setEnabled(true); if (!myForceCheckBox.isSelected()) { setErrorText(GitBundle.message("tag.error.tag.exists")); setOKActionEnabled(false); return; } } else { myForceCheckBox.setEnabled(false); myForceCheckBox.setS...
validateFields
43,369
void () { myExistingTags.clear(); try { myExistingTags.addAll(ProgressManager.getInstance().runProcessWithProgressSynchronously( () -> GitBranchUtil.getAllTags(myProject, getGitRoot()), GitBundle.message("tag.getting.existing.tags"), false, myProject)); } catch (VcsException e) { GitUIUtil.showOperationError(myProject,...
fetchTags
43,370
VirtualFile () { return (VirtualFile)myGitRootComboBox.getSelectedItem(); }
getGitRoot
43,371
JComponent () { return myPanel; }
createCenterPanel
43,372
String () { return getClass().getName(); }
getDimensionServiceKey
43,373
String () { return "reference.VersionControl.Git.TagFiles"; }
getHelpId
43,374
void () { shutdown(); }
dispose
43,375
List<AnAction> () { return ContainerUtil.append( super.createToolbarActions(), new RollbackDialogAction() ); }
createToolbarActions
43,376
List<AnAction> () { return ContainerUtil.append( super.createPopupMenuActions(), new RollbackDialogAction() ); }
createPopupMenuActions
43,377
AsyncChangesTreeModel () { return SimpleAsyncChangesTreeModel.create(grouping -> { Collection<Change> allChanges = ChangeListManager.getInstance(myProject).getAllChanges(); List<Change> newChanges = ContainerUtil.filter(allChanges, myOriginalChanges::contains); RemoteStatusChangeNodeDecorator decorator = RemoteRevision...
getChangesTreeModel
43,378
void () { myUpdateQueue.queue(DisposableUpdate.createDisposable(myUpdateQueue, "update", () -> { myViewer.rebuildTree(); })); }
doUpdate
43,379
void () { doUpdate(); }
changeListsChanged
43,380
void (final ActionEvent e) { myLastResult = false; myLastResultText = null; }
actionPerformed
43,381
void (final @NotNull DocumentEvent e) { // note that checkOkButton is called in other listener myButton.setEnabled(myTextField.getText().trim().length() != 0); }
textChanged
43,382
void (final ActionEvent e) { String revisionExpression = myTextField.getText(); myLastResultText = revisionExpression; myLastResult = false; try { GitRevisionNumber revision = ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> { return GitRevisionNumber.resolve(myProject, gitRoot(), revisionExpress...
actionPerformed
43,383
boolean () { final String revisionExpression = myTextField.getText(); return revisionExpression.equals(myLastResultText) && !myLastResult; }
isInvalid
43,384
VirtualFile () { return (VirtualFile)myGitRoot.getSelectedItem(); }
gitRoot
43,385
void (List<Change> changes) { myChangesBrowser.setChangesToDisplay(changes); }
consume
43,386
JComponent () { return myCommitListPanel.getPreferredFocusComponent(); }
getPreferredFocusComponent
43,387
void (@NotNull List<GitCommit> commits) { myCommitListPanel.setCommits(commits); }
setCommits
43,388
void (final ActionEvent e) { refreshStashList(); updateDialogState(); }
actionPerformed
43,389
void (final ListSelectionEvent e) { updateDialogState(); }
valueChanged
43,390
void (final @NotNull DocumentEvent e) { updateDialogState(); }
textChanged
43,391
void (ActionEvent e) { updateDialogState(); }
actionPerformed
43,392
void (final ActionEvent e) { boolean cleared = GitStashOperations.clearStashesWithConfirmation(project, getGitRoot(), GitUnstashDialog.this.getContentPane()); if (cleared) { refreshStashList(); updateDialogState(); } }
actionPerformed
43,393
void (final ActionEvent e) { boolean dropped = GitStashOperations.dropStashWithConfirmation(myProject, GitUnstashDialog.this.getContentPane(), getSelectedStash()); if (dropped) { refreshStashList(); updateDialogState(); } }
actionPerformed
43,394
void (final ActionEvent e) { GitStashOperations.viewStash(project, getSelectedStash(), true); }
actionPerformed
43,395
void () { String branch = myBranchTextField.getText(); if (branch.length() != 0) { setOKButtonText(GitBundle.message("unstash.button.branch")); myPopStashCheckBox.setEnabled(false); myPopStashCheckBox.setSelected(true); myReinstateIndexCheckBox.setEnabled(false); myReinstateIndexCheckBox.setSelected(true); GitRepositor...
updateDialogState
43,396
void () { myStashListModel.clear(); VirtualFile root = getGitRoot(); try { List<StashInfo> listOfStashes = ProgressManager.getInstance().runProcessWithProgressSynchronously( () -> GitStashUtils.loadStashStack(myProject, root), GitBundle.message("unstash.dialog.stash.list.load.progress.indicator.title"), true, myProject...
refreshStashList
43,397
VirtualFile () { return (VirtualFile)myGitRootComboBox.getSelectedItem(); }
getGitRoot
43,398
StashInfo () { return myStashList.getSelectedValue(); }
getSelectedStash
43,399
JComponent () { return myPanel; }
createCenterPanel