Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
42,200
void () { execute(null); }
execute
42,201
void (final @Nullable Computable<Boolean> autoLoadDecision) { Runnable operation = () -> { boolean savedSuccessfully = ProgressManager.getInstance().computeInNonCancelableSection(() -> save()); LOG.debug("save result: " + savedSuccessfully); if (savedSuccessfully) { try { LOG.debug("running operation"); myOperation.run...
execute
42,202
GitChangesSaver (@NotNull GitSaveChangesPolicy saveMethod) { GitChangesSaver saver = GitChangesSaver.getSaver(myProject, myGit, myProgressIndicator, myStashMessage, saveMethod); MergeDialogCustomizer mergeDialogCustomizer = new MergeDialogCustomizer() { @Override public @NotNull String getMultipleFileMergeDescription(@...
configureSaver
42,203
String (@NotNull Collection<VirtualFile> files) { return wrapInHtml( GitBundle.message( "restore.conflict.dialog.description.label.text", myOperationTitle, wrapInHtmlTag(myDestinationName, "code") ) ); }
getMultipleFileMergeDescription
42,204
String (@NotNull VirtualFile file) { return saveMethod.selectBundleMessage( GitBundle.message("restore.conflict.diff.dialog.left.stash.title"), GitBundle.message("restore.conflict.diff.dialog.left.shelf.title") ); }
getLeftPanelTitle
42,205
String (@NotNull VirtualFile file, VcsRevisionNumber revisionNumber) { return wrapInHtml(GitBundle.message("restore.conflict.diff.dialog.right.title", wrapInHtmlTag(myDestinationName, "b"))); }
getRightPanelTitle
42,206
boolean () { try { mySaver.saveLocalChanges(myRootsToSave); return true; } catch (VcsException e) { LOG.info("Couldn't save local changes", e); VcsNotifier.getInstance(myProject).notifyError( COULD_NOT_SAVE_UNCOMMITTED_CHANGES, GitBundle.message("save.notification.failed.title"), mySaver.getSaveMethod().selectBundleMes...
save
42,207
void () { if (myLoaded.compareAndSet(false, true)) { mySaver.load(); } else { LOG.info("The changes were already loaded"); } }
load
42,208
void (@NotNull GitRepository repository, @NotNull Pair<List<GitCommit>, List<GitCommit>> commits) { super.put(repository, commits.first, commits.second); }
put
42,209
void (@NotNull GitRepository repository, @NotNull Collection<Change> totalDiff) { super.putTotalDiff(repository, totalDiff); }
put
42,210
List<GitCommit> (@NotNull GitRepository repo) { //noinspection unchecked return (List)super.getHeadToBranchCommits(repo); }
getHeadToBranchCommits
42,211
List<GitCommit> (@NotNull GitRepository repo) { //noinspection unchecked return (List)super.getBranchToHeadCommits(repo); }
getBranchToHeadCommits
42,212
void (@NotNull Project project, @NotNull VirtualFile root, @NotNull Collection<? extends FilePath> addedFiles) { GitRepository repository = GitUtil.getRepositoryManager(project).getRepositoryForRoot(root); if (repository == null) { LOG.warn("Repository not found for root " + root.getPresentableUrl()); return; } reposit...
updateUntrackedFilesHolderOnFileAdd
42,213
void (@NotNull Project project, @NotNull VirtualFile root, @NotNull Collection<? extends FilePath> addedFiles) { GitRepository repository = GitUtil.getRepositoryManager(project).getRepositoryForRoot(root); if (repository == null) { LOG.warn("Repository not found for root " + root.getPresentableUrl()); return; } reposit...
updateIgnoredFilesHolderOnFileAdd
42,214
void (@NotNull Project project, @NotNull VirtualFile root, @NotNull Collection<? extends FilePath> removedFiles) { GitRepository repository = GitUtil.getRepositoryManager(project).getRepositoryForRoot(root); if (repository == null) { LOG.warn("Repository not found for root " + root.getPresentableUrl()); return; } repos...
updateUntrackedFilesHolderOnFileRemove
42,215
void (@NotNull Project project, @NotNull VirtualFile root, @NotNull Collection<? extends FilePath> resetFiles) { GitRepository repository = GitUtil.getRepositoryManager(project).getRepositoryForRoot(root); if (repository == null) { LOG.warn("Repository not found for root " + root.getPresentableUrl()); return; } reposit...
updateUntrackedFilesHolderOnFileReset
42,216
void (@NotNull Project project, @NotNull VirtualFile root, @NotNull Collection<? extends FilePath> files, boolean updateIgnoredHolders) { updateUntrackedFilesHolderOnFileAdd(project, root, files); if (updateIgnoredHolders) { updateIgnoredFilesHolderOnFileAdd(project, root, files); } GitIndexFileSystemRefresher.refreshF...
updateAndRefresh
42,217
void (@Nullable Project project, @NotNull GitBinaryHandler h, boolean addp) { addTextConvParameters(GitExecutableManager.getInstance().tryGetVersion(project, h.getExecutable()), h, addp); }
addTextConvParameters
42,218
void (@Nullable GitVersion version, @NotNull GitBinaryHandler h, boolean addp) { version = ObjectUtils.chooseNotNull(version, GitVersion.NULL); GitTextConvMode mode = AdvancedSettings.getEnum(READ_CONTENT_WITH, GitTextConvMode.class); if (mode == GitTextConvMode.FILTERS && CAT_FILE_SUPPORTS_FILTERS.existsIn(version)) {...
addTextConvParameters
42,219
boolean () { return myPosition < myText.length(); }
hasMoreData
42,220
boolean () { if (!hasMoreData()) { return true; } final char ch = myText.charAt(myPosition); return ch == '\n'; }
isEol
42,221
void () { while (!isEol()) { myPosition++; } if (hasMoreData()) { final char ch = myText.charAt(myPosition++); if (hasMoreData()) { final char ch2 = myText.charAt(myPosition); if (ch == '\r' && ch2 == '\n') { myPosition++; } } } }
nextLine
42,222
String () { return boundedToken(' '); }
spaceToken
42,223
String () { return boundedToken('\t'); }
tabToken
42,224
String (final char boundaryChar) { return boundedToken(boundaryChar, false); }
boundedToken
42,225
String (char boundaryChar, boolean ignoreEol) { int start = myPosition; for (; myPosition < myText.length(); myPosition++) { final char ch = myText.charAt(myPosition); if (ch == boundaryChar) { final String rc = myText.substring(start, myPosition); myPosition++; return rc; } if (!ignoreEol && isEol()) { return myText.s...
boundedToken
42,226
boolean (final char c) { return hasMoreData() && myText.charAt(myPosition) == c; }
startsWith
42,227
boolean (String text) { return myText.startsWith(text, myPosition); }
startsWith
42,228
String () { return line(false); }
line
42,229
String (boolean includeNewLine) { int start = myPosition; while (!isEol()) { myPosition++; } int end; if (includeNewLine) { nextLine(); end = myPosition; } else { end = myPosition; nextLine(); } return myText.substring(start, end); }
line
42,230
void (final int n) { if (n < 0) { throw new IllegalArgumentException("Amount of chars to skip must be non neagitve: " + n); } if (myPosition + n >= myText.length()) { throw new IllegalArgumentException("Skipping beyond end of the text (" + myPosition + " + " + n + " >= " + myText.length() + ")"); } myPosition += n; }
skipChars
42,231
boolean (final char c) { if (startsWith(c)) { skipChars(1); return true; } return false; }
tryConsume
42,232
boolean (String chars) { if (startsWith(chars)) { skipChars(chars.length()); return true; } return false; }
tryConsume
42,233
char () { if (!hasMoreData()) { throw new IllegalStateException("There is no next character"); } return myText.charAt(myPosition); }
peek
42,234
String () { return myText; }
getAllText
42,235
void (@NotNull Project project, @NotNull VirtualFile root, @NotNull Collection<String> relativePaths, @NotNull @Nls String operation, @Nullable @NlsContexts.DetailedDescription String description) { notifyUntrackedFilesOverwrittenBy(project, root, relativePaths, operation, description, null); }
notifyUntrackedFilesOverwrittenBy
42,236
void (@NotNull Project project, @NotNull VirtualFile root, @NotNull Collection<String> relativePaths, @NotNull @Nls String operation, @Nullable @NlsContexts.DetailedDescription String description, @Nullable NotificationListener listener, NotificationAction @NotNull ... actions) { Notification notification = getUntracke...
notifyUntrackedFilesOverwrittenBy
42,237
boolean (final @NotNull Project project, @NotNull @Nls String operationName, @NotNull @NlsContexts.Label String rollbackProposal, @NotNull VirtualFile root, final @NotNull Collection<String> relativePaths) { Collection<String> absolutePaths = GitUtil.toAbsolute(root, relativePaths); List<VirtualFile> untrackedFiles = C...
showUntrackedFilesDialogWithRollback
42,238
Notification (@NotNull Project project, @NotNull VirtualFile root, @NotNull Collection<String> relativePaths, @NotNull @Nls String operation, @Nullable @NlsContexts.DetailedDescription String description, @Nullable NotificationListener listener) { if (description == null) description = ""; String notificationTitle = Gi...
getUntrackedFilesOverwrittenByNotification
42,239
void (@NotNull AnActionEvent e, @NotNull Notification notification) { String dialogDesc = GitBundle.message("dialog.message.untracked.files.will.be.overwritten.by.operation", operation); String title = GitBundle.message("dialog.title.untracked.files.preventing.operation", StringUtil.capitalize(operation)); if (untracke...
actionPerformed
42,240
JComponent () { JComponent buttons = super.createSouthPanel(); JPanel panel = new JPanel(new VerticalFlowLayout()); panel.add(new JBLabel(XmlStringUtil.wrapInHtml(myRollbackProposal))); if (buttons != null) { panel.add(buttons); } return panel; }
createSouthPanel
42,241
String () { return GitBundle.message("git.content.transform.none"); }
toString
42,242
String () { return GitBundle.message("git.content.transform.filters"); }
toString
42,243
String () { return GitBundle.message("git.content.transform.textconv"); }
toString
42,244
ChangesTree (@NotNull Project project, @NotNull Collection<String> absolutePaths) { List<FilePath> filePaths = toFilePaths(absolutePaths); return new AsyncChangesTreeImpl.FilePaths(project, false, false, filePaths); }
createBrowser
42,245
List<FilePath> (@NotNull Collection<String> absolutePaths) { return ContainerUtil.map(absolutePaths, path -> VcsUtil.getFilePath(path, false)); }
toFilePaths
42,246
void (final @NotNull Project project, @NonNls @Nullable String displayId, final @NotNull VirtualFile root, final @NotNull String operationName, final @NotNull Collection<String> relativeFilePaths) { final Collection<String> absolutePaths = GitUtil.toAbsolute(root, relativeFilePaths); final List<Change> changes = GitUti...
showErrorNotification
42,247
void (@NotNull Notification notification, @NotNull HyperlinkEvent e) { showErrorDialog(project, operationName, changes, absolutePaths); }
hyperlinkActivated
42,248
void (@NotNull Project project, @NotNull String operationName, @NotNull List<? extends Change> changes, @NotNull Collection<String> absolutePaths) { String title = GitBundle.message("dialog.title.local.changes.prevent.from.operation", StringUtil.capitalize(operationName)); String description = getErrorDialogDescription...
showErrorDialog
42,249
GitVcsConsoleWriter (@NotNull Project project) { return project.getService(GitVcsConsoleWriter.class); }
getInstance
42,250
void (@NotNull @NlsSafe String message) { showMessage(message, ConsoleViewContentType.NORMAL_OUTPUT); }
showMessage
42,251
void (@NotNull @NlsSafe String line) { showMessage(line, ConsoleViewContentType.ERROR_OUTPUT); }
showErrorMessage
42,252
void (@NotNull @NlsSafe String cmdLine) { SimpleDateFormat f = new SimpleDateFormat("HH:mm:ss.SSS"); showMessage(f.format(new Date()) + ": " + cmdLine, ConsoleViewContentType.SYSTEM_OUTPUT); }
showCommandLine
42,253
void (@NotNull @NlsSafe String message, @NotNull ConsoleViewContentType contentType) { String shortMessage = StringUtil.shortenPathWithEllipsis(message, MAX_CONSOLE_OUTPUT_SIZE); showMessage(VcsConsoleLine.create(shortMessage, contentType)); }
showMessage
42,254
void (@NotNull List<Pair<String, Key>> lineChunks) { int totalLength = 0; for (Pair<String, Key> chunk : lineChunks) { totalLength += chunk.first.length(); } int prefixEnd = (int)(MAX_CONSOLE_OUTPUT_SIZE * 0.3); int suffixStart = totalLength - (int)(MAX_CONSOLE_OUTPUT_SIZE * 0.7); boolean useEllipsis = totalLength > MA...
showMessage
42,255
void (@Nullable VcsConsoleLine line) { if (myProject.isDisposed()) return; ProjectLevelVcsManager.getInstance(myProject).addMessageToConsoleWindow(line); }
showMessage
42,256
boolean (@NotNull Project project, @NotNull Collection<? extends VirtualFile> rootsToSave, @NotNull String operationTitle, @NotNull ProgressIndicator indicator, @NotNull Runnable operation) { GitRepositoryManager gitRepositoryManager = GitRepositoryManager.getInstance(project); if (!areRootsUnderGitWithInitialCommit(ro...
execute
42,257
boolean (@NotNull Collection<? extends VirtualFile> roots, @NotNull GitRepositoryManager gitRepositoryManager) { return ContainerUtil.all(roots, root -> { GitRepository gitRepository = gitRepositoryManager.getRepositoryForRoot(root); if (gitRepository == null) { return false; } if (gitRepository.getCurrentRevision() ==...
areRootsUnderGitWithInitialCommit
42,258
String () { return "git"; }
getId
42,259
boolean (final @NotNull Map<String, String> parameters, final @NotNull VirtualFile parentDirectory, @NotNull String directoryName) { ProgressManager.getInstance().getProgressIndicator().setText(DvcsBundle.message("cloning.repository", parameters)); IdeFrame frame = IdeFocusManager.getGlobalInstance().getLastFocusedFram...
checkout
42,260
TestResult (@NotNull String url) { GitCommandResult result = myGit.lsRemote(myProject, new File("."), url); return result.success() ? TestResult.SUCCESS : new TestResult(result.getErrorOutputAsJoinedString()); }
test
42,261
DvcsRememberedInputs () { return GitRememberedInputs.getInstance(); }
getRememberedInputs
42,262
String () { return "GitCloneDialog"; }
getDimensionServiceKey
42,263
String () { return GitBundle.message("git4idea.vcs.name.with.mnemonic"); }
getVcsName
42,264
void (@NotNull Project project, @Nullable Listener listener, @Nullable String predefinedRepositoryUrl) { FileDocumentManager.getInstance().saveAllDocuments(); GitCloneDialog dialog = new GitCloneDialog(project, predefinedRepositoryUrl); if (!dialog.showAndGet()) { return; } dialog.rememberSettings(); final LocalFileSys...
doCheckout
42,265
void (final @NotNull Project project, final @NotNull Git git, final Listener listener, final VirtualFile destinationParent, final String sourceRepositoryURL, final String directoryName, final String parentDirectory) { String projectAbsolutePath = Paths.get(parentDirectory, directoryName).toAbsolutePath().toString(); St...
clone
42,266
CloneTaskInfo () { return new CloneTaskInfo(DvcsBundle.message("cloning.repository", sourceRepositoryURL), DvcsBundle.message("cloning.repository.cancel", sourceRepositoryURL), DvcsBundle.message("clone.repository"), DvcsBundle.message("clone.repository.tooltip"), DvcsBundle.message("clone.repository.failed"), DvcsBund...
taskInfo
42,267
CloneStatus (@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(false); GitLineHandlerListener progressListener = GitStandardProgressAnalyzer.createListener(indicator); GitCommandResult result; try { result = git.clone(project, new File(parentDirectory), sourceRepositoryURL, directoryName, progressListe...
run
42,268
boolean (@NotNull Project project, @NotNull Git git, @NotNull String directoryName, @NotNull String parentDirectory, @NotNull String sourceRepositoryURL) { ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); indicator.setIndeterminate(false); GitLineHandlerListener progressListener = Git...
doClone
42,269
void (@NotNull Project project, @NotNull GitCommandResult commandResult, @NotNull String sourceRepositoryURL) { List<@NlsSafe String> errorLines = ContainerUtil.filter(commandResult.getErrorOutput(), line -> !ContainerUtil.exists(NON_ERROR_LINE_PREFIXES, prefix -> StringUtil.startsWithIgnoreCase(line, prefix))); String...
notifyError
42,270
String () { return GitVcs.ID; }
getVcsId
42,271
void (@NotNull Project project, @Nullable Listener listener) { doCheckout(project, listener, null); }
doCheckout
42,272
VcsCloneComponent (@NotNull Project project, @NotNull ModalityState modalityState, @NotNull VcsCloneDialogComponentStateListener dialogStateListener) { return new GitCloneDialogComponent(project, modalityState, dialogStateListener); }
buildVcsCloneComponent
42,273
GitCheckAttrParser (@NotNull List<String> output) { return new GitCheckAttrParser(output); }
parse
42,274
boolean (@NotNull VirtualFile path) { return path.findChild(GitUtil.DOT_GIT) != null && // fast check without refreshing the VFS GitUtil.isGitRoot(path.toNioPath()); }
isRoot
42,275
boolean (@NotNull VirtualFile file) { return GitUtil.isGitRoot(file.toNioPath()); }
validateRoot
42,276
VcsKey () { return GitVcs.getKey(); }
getSupportedVcs
42,277
boolean (@NotNull String dirName) { return dirName.equalsIgnoreCase(GitUtil.DOT_GIT); }
isVcsDir
42,278
boolean (@NotNull VirtualFile root, @NotNull VirtualFile checkForIgnore) { // check-ignore was introduced in 1.8.2, // executing the command for older Gits will fail with exit code 1, which we'll treat as "not ignored" for simplicity GitLineHandler handler = new GitLineHandler(null, root, GitCommand.CHECK_IGNORE); hand...
isIgnored
42,279
List<VirtualFile> (@NotNull VirtualFile vcsRoot) { try { GitLineHandler handler = new GitLineHandler(null, vcsRoot, GitCommand.SUBMODULE_HELPER); handler.addParameters("list"); GitCommandResult result = Git.getInstance().runCommand(handler); if (!result.success()) return Collections.emptyList(); List<VirtualFile> submo...
suggestDependentRoots
42,280
boolean (final @NotNull VirtualFile directory) { VcsNotifier vcsNotifier = VcsNotifier.getInstance(myProject); GitCommandResult result = Git.getInstance().init(myProject, directory); if (result.success()) { refreshVcsDir(directory, GitUtil.DOT_GIT); vcsNotifier.notifySuccess(REPOSITORY_CREATED, "", GitBundle.message("g...
initOrNotifyError
42,281
void () { for (GitRepository repository: getRepositories()) { try { GitRevisionNumber revisionNumber = GitRevisionNumber.resolve(myProject, repository.getRoot(), GitTag.REFS_TAGS_PREFIX + myTagName); myDeletedTagTips.put(repository, revisionNumber.asString()); } catch (VcsException e) { String title; if (!GitUtil.justO...
execute
42,282
void () { String message = GitBundle.message("delete.tag.operation.deleted.tag", myTagName); Notification notification = STANDARD_NOTIFICATION.createNotification("", message, NotificationType.INFORMATION); notification.setDisplayId(GitNotificationIdsHolder.TAG_DELETED); notification.addAction(NotificationAction.createS...
notifySuccess
42,283
void (@NotNull Notification notification) { new Task.Backgroundable(myProject, GitBundle.message("delete.tag.operation.restoring.tag.process", myTagName)) { @Override public void run(@NotNull ProgressIndicator indicator) { rollbackTagDeletion(notification); } }.queue(); }
restoreInBackground
42,284
void (@NotNull ProgressIndicator indicator) { rollbackTagDeletion(notification); }
run
42,285
void () { GitCompoundResult result = doRollback(); if (result.totalSuccess()) { Notification notification = STANDARD_NOTIFICATION.createNotification(GitBundle.message("delete.tag.operation.rollback.successful"), GitBundle .message("delete.tag.operation.restored.tag", myTagName), NotificationType.INFORMATION); notificat...
rollback
42,286
void (@NotNull Notification notification) { GitCompoundResult result = doRollback(); if (result.totalSuccess()) { notification.expire(); } else { myNotifier.notifyError(TAG_DELETION_ROLLBACK_ERROR, GitBundle.message("delete.tag.operation.could.not.restore.tag", bold(code(myTagName))), result.getErrorOutputWithReposIndi...
rollbackTagDeletion
42,287
GitCompoundResult () { GitCompoundResult result = new GitCompoundResult(myProject); for (GitRepository repository: getSuccessfulRepositories()) { GitCommandResult res = myGit.createNewTag(repository, myTagName, null, myDeletedTagTips.get(repository)); result.append(repository, res); repository.getRepositoryFiles().refr...
doRollback
42,288
String () { return new HtmlBuilder().append(GitBundle.message("delete.tag.operation.however.tag.deletion.has.succeeded.for.the.following", getSkippedRepositories().size())) .br() .appendRaw(successfulRepositoriesJoined()) .br() .append(GitBundle.message("delete.tag.operation.you.may.rollback.not.to.let.tags.diverge", m...
getRollbackProposal
42,289
String () { throw new UnsupportedOperationException(); }
getOperationName
42,290
String () { throw new UnsupportedOperationException(); }
getSuccessMessage
42,291
void () { GitBrancher.getInstance(myProject).deleteRemoteTag(myTagName, ContainerUtil.map2Map(getRepositories(), it -> Pair.create(it, myDeletedTagTips.get(it)))); }
pushRemotesInBackground
42,292
List<GitLocalBranch> () { return Collections.unmodifiableList(myRecentCheckoutBranches); }
getRecentCheckoutBranches
42,293
Collection<GitLocalBranch> () { return Collections.unmodifiableCollection(myLocalBranches.keySet()); }
getLocalBranches
42,294
Collection<GitRemoteBranch> () { return Collections.unmodifiableCollection(myRemoteBranches.keySet()); }
getRemoteBranches
42,295
Collection<GitLocalBranch> (@NotNull Hash hash) { return ContainerUtil.filter(myLocalBranches.keySet(), key -> myLocalBranches.get(key).equals(hash)); }
findLocalBranchesByHash
42,296
Collection<GitRemoteBranch> (@NotNull Hash hash) { return ContainerUtil.filter(myRemoteBranches.keySet(), key -> myRemoteBranches.get(key).equals(hash)); }
findRemoteBranchesByHash
42,297
void (final @NotNull String name, @NotNull List<? extends GitRepository> repositories) { updateInfo(repositories); repositories = ContainerUtil.filter(repositories, repository -> { GitLocalBranch currentBranch = repository.getCurrentBranch(); return currentBranch == null || !currentBranch.getName().equals(name); }); if...
checkoutNewBranch
42,298
void (@NotNull String name, @NotNull Map<GitRepository, String> startPoints) { createBranch(name, startPoints, false); }
createBranch
42,299
void (@NotNull String name, @NotNull Map<GitRepository, String> startPoints, boolean force) { updateInfo(startPoints.keySet()); new GitCreateBranchOperation(myProject, myGit, myUiHandler, name, startPoints, force).execute(); }
createBranch