Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
25,100
List<String> (List<String> arguments, int port) { List<String> cmdArguments = new ArrayList<>(); cmdArguments.add("--config"); cmdArguments.add("extensions.hg4ideapromptextension=" + myVcs.getPromptHooksExtensionFile().getAbsolutePath()); cmdArguments.add("--config"); cmdArguments.add("hg4ideapass.port=" + port); if (a...
prepareArguments
25,101
void (@NotNull String operation, @Nullable List<String> arguments) { //do not log arguments for remote command because of internal password port info etc super.logCommand(operation, null); }
logCommand
25,102
void () { if (myAuthenticator == null) return; myAuthenticator.forgetPassword(); }
forgetPassword
25,103
void () { if (myGetPassword == null) return; // prompt was not suggested; String url = VirtualFileManager.extractPath(myGetPassword.getURL()); PasswordSafe.getInstance().set(createCredentialAttributes(url), null); }
forgetPassword
25,104
boolean (Project project, @NotNull String proposedLogin, @NotNull String uri, @NotNull String path, @Nullable ModalityState state) { GetPasswordRunnable runnable = new GetPasswordRunnable(project, proposedLogin, uri, path, myForceAuthorization, mySilentMode); ApplicationManager.getApplication().invokeAndWait(runnable, ...
promptForAuthentication
25,105
String () { return myGetPassword.getUserName(); }
getUserName
25,106
String () { return myGetPassword.getPassword(); }
getPassword
25,107
void () { // find if we've already been here final HgVcs vcs = HgVcs.getInstance(myProject); if (vcs == null) { return; } final @NotNull HgGlobalSettings hgGlobalSettings = HgGlobalSettings.getInstance(); @Nullable String rememberedLoginsForUrl = null; String url = VirtualFileManager.extractPath(myURL); if (!StringUtil...
run
25,108
String () { return myCredentials.getUserName(); }
getUserName
25,109
String () { return myCredentials == null ? null : myCredentials.getPasswordAsString(); }
getPassword
25,110
boolean () { return ok; }
isOk
25,111
String () { return myURL; }
getURL
25,112
CredentialAttributes (@NotNull String url) { return new CredentialAttributes(CredentialAttributesKt.generateServiceName("HG", url), null); }
createCredentialAttributes
25,113
void (@Nullable HgCommandResult result) { }
process
25,114
void (@Nullable Charset charset) { if (charset != null) { myCharset = charset; } }
setCharset
25,115
void (boolean isSilent) { myIsSilent = isSilent; }
setSilent
25,116
void (boolean showOutput) { myShowOutput = showOutput; }
setShowOutput
25,117
void (boolean isBinary) { myIsBinary = isBinary; }
setBinary
25,118
void (boolean outputAlwaysSuppressed) { myOutputAlwaysSuppressed = outputAlwaysSuppressed; }
setOutputAlwaysSuppressed
25,119
HgCommandResult (@Nullable final VirtualFile repo, @NotNull final @NonNls String operation, @Nullable final List<@NonNls String> arguments) { return executeInCurrentThread(repo, operation, arguments, false); }
executeInCurrentThread
25,120
HgCommandResult (@Nullable VirtualFile repo, @NotNull @NonNls String operation, @Nullable List<@NonNls String> arguments, boolean ignoreDefaultOptions) { ShellCommand.CommandResultCollector collector = new ShellCommand.CommandResultCollector(myIsBinary); boolean success = executeInCurrentThread(repo, operation, argumen...
executeInCurrentThread
25,121
boolean (@Nullable VirtualFile repo, @NotNull @NonNls String operation, @Nullable List<@NonNls String> arguments, boolean ignoreDefaultOptions, @NotNull HgLineProcessListener listener) { boolean success = executeInCurrentThreadAndLog(repo, operation, arguments, ignoreDefaultOptions, listener); List<String> errors = Str...
executeInCurrentThread
25,122
boolean (@Nullable VirtualFile repo, @NotNull @NonNls String operation, @Nullable List<@NonNls String> arguments, boolean ignoreDefaultOptions, @NotNull HgLineProcessListener listener) { if (myProject == null || myProject.isDisposed() || myVcs == null) return false; if (!myProject.isDefault() && !TrustedProjects.isTrus...
executeInCurrentThreadAndLog
25,123
void (@NotNull ShellCommandException e) { if (myVcs.getExecutableValidator().checkExecutableAndNotifyIfNeeded()) { // if the problem was not with invalid executable - show error. showError(e); LOG.info(e.getMessage(), e); } }
processError
25,124
ShellCommand (@Nullable VirtualFile repo, @NotNull @NonNls String operation, @Nullable List<@NonNls String> arguments, boolean ignoreDefaultOptions) { logCommand(operation, arguments); final List<String> cmdLine = new LinkedList<>(); cmdLine.add(HgExecutableManager.getInstance().getHgExecutable(myProject)); if (repo !=...
createShellCommandWithArgs
25,125
void (@NotNull String operation, @Nullable List<String> arguments) { if (myProject.isDisposed()) { return; } String exeName = HgExecutableManager.getInstance().getHgExecutable(myProject); final int lastSlashIndex = exeName.lastIndexOf(File.separator); exeName = exeName.substring(lastSlashIndex + 1); @NonNls String str ...
logCommand
25,126
void (Exception e) { final HgVcs vcs = HgVcs.getInstance(myProject); if (vcs == null) return; String message = HgBundle.message("hg4idea.command.executor.error", HgExecutableManager.getInstance().getHgExecutable(myProject), e.getMessage()); VcsImplUtil.showErrorMessage(myProject, message, HgBundle.message("hg4idea.erro...
showError
25,127
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
25,128
void (@NotNull AnActionEvent e) { Project project = e.getProject(); e.getPresentation().setEnabledAndVisible(project == null || project.isDefault() || TrustedProjects.isTrusted(project)); }
update
25,129
void (@NotNull AnActionEvent e) { myProject = notNull(e.getData(CommonDataKeys.PROJECT), ProjectManager.getInstance().getDefaultProject()); // provide window to select the root directory final HgInitDialog hgInitDialog = new HgInitDialog(myProject); if (!hgInitDialog.showAndGet()) { return; } final VirtualFile selected...
actionPerformed
25,130
void (VirtualFile mapRoot) { if (myProject != null && (!myProject.isDefault()) && myProject.getBaseDir() != null && VfsUtilCore.isAncestor(myProject.getBaseDir(), mapRoot, false)) { mapRoot.refresh(false, false); final String path = mapRoot.equals(myProject.getBaseDir()) ? "" : mapRoot.getPath(); ProjectLevelVcsManager...
updateDirectoryMappings
25,131
boolean (@NotNull Project project, @NotNull final VirtualFile selectedRoot) { HgCommandResult result = new HgInitCommand(project).execute(selectedRoot.getPath()); if (!HgErrorUtil.hasErrorsInCommandExecution(result)) { VcsNotifier.getInstance(project) .notifySuccess(REPO_CREATED, HgBundle.message("hg4idea.init.created....
createRepository
25,132
void (@NotNull HgRepository repository, @NotNull Hash commit) { String revisionHash = commit.asString(); new HgCreateTagAction().execute(repository.getProject(), Collections.singleton(repository), repository, revisionHash); }
actionPerformed
25,133
void (@NotNull final Project project, @NotNull Collection<HgRepository> repositories, @Nullable final HgRepository selectedRepo, @NotNull DataContext dataContext) { new Task.Backgroundable(project, HgBundle.message("action.hg4idea.Rebase.Continue.progress")) { @Override public void run(@NotNull ProgressIndicator indica...
execute
25,134
void (@NotNull ProgressIndicator indicator) { if (selectedRepo != null) { HgRebaseCommand rebaseCommand = new HgRebaseCommand(project, selectedRepo); HgCommandResult result = rebaseCommand.continueRebase(); if (HgErrorUtil.isAbort(result)) { new HgCommandResultNotifier(project).notifyError(REBASE_CONTINUE_ERROR, result...
run
25,135
void (@NotNull final HgRepository repository, @NotNull Hash commit) { final Project project = repository.getProject(); final VirtualFile root = repository.getRoot(); FileDocumentManager.getInstance().saveAllDocuments(); HgUpdateCommand.updateRepoTo(project, root, commit.asString(), null); }
actionPerformed
25,136
void (@NotNull HgRepository repository, @NotNull Hash commit) { FileDocumentManager.getInstance().saveAllDocuments(); HgMergeCommand.mergeWith(repository, commit.asString(), UpdatedFiles.create()); }
actionPerformed
25,137
AbstractRepositoryManager<HgRepository> (@NotNull Project project) { return project.getService(HgRepositoryManager.class); }
getRepositoryManager
25,138
HgRepository (@NotNull Project project, @NotNull VirtualFile root) { return getRepositoryManager(project).getRepositoryForRootQuick(root); }
getRepositoryForRoot
25,139
void (@NotNull final HgRepository repository, @NotNull final Hash commit) { final Project project = repository.getProject(); FileDocumentManager.getInstance().saveAllDocuments(); String shortHash = commit.toShortString(); final String name = getNewBranchNameFromUser(repository, HgBundle.message("hg4idea.branch.create.f...
actionPerformed
25,140
void (@NotNull ProgressIndicator indicator) { if (HgUpdateCommand.updateRepoToInCurrentThread(project, repository.getRoot(), commit.asString(), false)) { new HgBranchPopupActions.HgNewBranchAction(project, Collections.singletonList(repository), repository) .createNewBranchInCurrentThread(name); } }
run
25,141
boolean (@NotNull HgRepository repository) { final Map<String, LinkedHashSet<Hash>> branches = repository.getBranches(); if (branches.size() > 1) return false; final Hash currentRevisionHash = getCurrentHash(repository); final Collection<HgNameWithHashInfo> other_bookmarks = getOtherBookmarks(repository, currentRevisio...
nothingToCompare
25,142
Hash (@NotNull HgRepository repository) { final String currentRevision = repository.getCurrentRevision(); assert currentRevision != null : "Compare With Branch couldn't be performed for newly created repository"; return HashImpl.build(repository.getCurrentRevision()); }
getCurrentHash
25,143
List<HgNameWithHashInfo> (@NotNull HgRepository repository, @NotNull final Hash currentRevisionHash) { return ContainerUtil.filter(repository.getBookmarks(), info -> !info.getHash().equals(currentRevisionHash)); }
getOtherBookmarks
25,144
Hash (@NotNull HgRepository repository, @NotNull final String bookmarkName) { HgNameWithHashInfo bookmarkInfo = ContainerUtil.find(repository.getBookmarks(), info -> info.getName().equals(bookmarkName)); return bookmarkInfo != null ? bookmarkInfo.getHash() : null; }
findBookmarkHashByName
25,145
Hash (@NotNull HgRepository repository, @NotNull String branchName) { // null for new branch or not heavy ref final LinkedHashSet<Hash> branchHashes = repository.getBranches().get(branchName); return branchHashes != null ? Objects.requireNonNull(Iterables.getLast(branchHashes)) : null; }
getHeavyBranchMainHash
25,146
Hash (@NotNull HgRepository repository, @NotNull String branchToCompare) { Hash refHashToCompare = getHeavyBranchMainHash(repository, branchToCompare); return refHashToCompare != null ? refHashToCompare : findBookmarkHashByName(repository, branchToCompare); }
detectActiveHashByName
25,147
List<String> (@NotNull HgRepository repository) { final List<String> namesToCompare = new ArrayList<>(repository.getBranches().keySet()); final String currentBranchName = repository.getCurrentBranchName(); assert currentBranchName != null; final Hash currentHash = getCurrentHash(repository); if (currentHash.equals(getH...
getBranchNamesExceptCurrent
25,148
HgRepositoryManager (@NotNull Project project) { return HgUtil.getRepositoryManager(project); }
getRepositoryManager
25,149
boolean (@NotNull HgRepository repository, @NotNull FilePath path, @NotNull HgRevisionNumber compareWithRevisionNumber) { HgStatusCommand statusCommand = new HgStatusCommand.Builder(true).ignored(false).unknown(false).copySource(!path.isDirectory()) .baseRevision(compareWithRevisionNumber).targetRevision(null).build(re...
existInBranch
25,150
void (@NotNull final Project project, @NotNull Collection<HgRepository> repositories, @Nullable HgRepository selectedRepo, @NotNull DataContext dataContext) { final HgRepository repository = repositories.size() > 1 ? letUserSelectRepository(project, repositories, selectedRepo) : ContainerUtil.getFirstItem(repositories)...
execute
25,151
void (@NotNull ProgressIndicator indicator) { new HgConflictResolver(project).resolve(repository.getRoot()); HgUtil.markDirectoryDirty(project, repository.getRoot()); }
run
25,152
HgRepository (@NotNull Project project, @NotNull Collection<HgRepository> repositories, @Nullable HgRepository selectedRepo) { HgRunConflictResolverDialog dialog = new HgRunConflictResolverDialog(project, repositories, selectedRepo); return dialog.showAndGet() ? dialog.getRepository() : null; }
letUserSelectRepository
25,153
void (@NotNull final Project project, @NotNull Collection<HgRepository> repositories, @Nullable HgRepository selectedRepo, @Nullable final String reference) { final HgTagDialog dialog = new HgTagDialog(project, repositories, selectedRepo); if (dialog.showAndGet()) { try { new HgTagCreateCommand(project, dialog.getRepos...
execute
25,154
void (@Nullable HgCommandResult result) { if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotifier(project) .notifyError(TAG_CREATION_ERROR, result, HgBundle.message("hg4idea.branch.creation.error"), HgBundle.message("action.hg4idea.CreateTag.error.msg", dialog.getTagName())); } }
process
25,155
void (@NotNull final Project project, @NotNull Collection<HgRepository> repositories, @Nullable HgRepository selectedRepo, @NotNull DataContext dataContext) { execute(project, repositories, selectedRepo, ""); }
execute
25,156
void (@NotNull final Project project, @NotNull final Collection<HgRepository> repos, @Nullable final HgRepository selectedRepo, @NotNull DataContext dataContext) { final HgMergeDialog mergeDialog = new HgMergeDialog(project, repos, selectedRepo); if (mergeDialog.showAndGet()) { final String targetValue = StringUtil.esc...
execute
25,157
void (@NotNull Project project, @NotNull Collection<HgRepository> repositories, @NotNull List<HgRepository> selectedRepositories, @NotNull DataContext context) { execute(project, repositories, selectedRepositories.isEmpty() ? null : selectedRepositories.get(0), context); }
execute
25,158
HgRepository (@NotNull DataContext dataContext) { List<HgRepository> repositories = getSelectedRepositoriesFromEvent(dataContext); return repositories.isEmpty() ? null : repositories.get(0); }
getSelectedRepositoryFromEvent
25,159
boolean (AnActionEvent e) { HgRepository repository = getSelectedRepositoryFromEvent(e.getDataContext()); return repository != null && repository.getState() == myState; }
isRebasing
25,160
boolean (AnActionEvent e) { return super.isEnabled(e) && isRebasing(e); }
isEnabled
25,161
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
25,162
void (@NotNull AnActionEvent event) { final DataContext dataContext = event.getDataContext(); final Project project = CommonDataKeys.PROJECT.getData(dataContext); final VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext); if (project == null || files == null || files.length == 0) { return; } pr...
actionPerformed
25,163
void (List<VcsException> exceptions) { try { execute(project, vcs, files, dataContext); } catch (VcsException ex) { exceptions.add(ex); } }
run
25,164
void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); final DataContext dataContext = e.getDataContext(); Project project = CommonDataKeys.PROJECT.getData(dataContext); if (project == null) { presentation.setEnabled(false); return; } VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.g...
update
25,165
void (@NotNull final Project project, @NotNull Collection<HgRepository> repositories, @Nullable final HgRepository selectedRepo, @NotNull DataContext dataContext) { new Task.Backgroundable(project, HgBundle.message("action.hg4idea.Graft.Continue.progress")) { @Override public void run(@NotNull ProgressIndicator indicat...
execute
25,166
void (@NotNull ProgressIndicator indicator) { if (selectedRepo != null) { HgGraftCommand graftCommand = new HgGraftCommand(project, selectedRepo); HgCommandResult result = graftCommand.continueGrafting(); if (HgErrorUtil.isAbort(result)) { new HgCommandResultNotifier(project) .notifyError(GRAFT_CONTINUE_ERROR, result, ...
run
25,167
void (@NotNull final Project project, @NotNull Collection<HgRepository> repositories, @Nullable final HgRepository selectedRepo, @NotNull DataContext dataContext) { new Task.Backgroundable(project, HgBundle.message("action.hg4idea.Rebase.Abort.progress")) { @Override public void run(@NotNull ProgressIndicator indicator...
execute
25,168
void (@NotNull ProgressIndicator indicator) { if (selectedRepo != null) { HgRebaseCommand rebaseCommand = new HgRebaseCommand(project, selectedRepo); HgCommandResult result = rebaseCommand.abortRebase(); if (HgErrorUtil.isAbort(result)) { new HgCommandResultNotifier(project).notifyError(REBASE_ABORT_ERROR, result, HgBu...
run
25,169
boolean (Project project, HgVcs vcs, VirtualFile file) { final FileStatus fileStatus = ChangeListManager.getInstance(project).getStatus(file); return FileStatus.MERGED_WITH_CONFLICTS.equals(fileStatus); }
isEnabled
25,170
void (Project project, HgVcs activeVcs, List<VirtualFile> files, DataContext context) { HgResolveCommand resolveCommand = new HgResolveCommand(project); for (VirtualFile file : files) { VirtualFile root = VcsUtil.getVcsRootFor(project, file); if (root == null) { return; } resolveCommand.markResolved(root, file); } }
batchPerform
25,171
AbstractVcs (Project project) { return HgVcs.getInstance(project); }
getVcs
25,172
String (Project project) { return HgVcs.VCS_NAME; }
getVcsName
25,173
void (@NonNls @Nullable String displayId, @Nullable HgCommandResult result, @NlsContexts.NotificationTitle @NotNull String failureTitle, @NlsContexts.NotificationContent @NotNull String failureDescription) { notifyError(displayId, result, failureTitle, failureDescription, null); }
notifyError
25,174
void (@NonNls @Nullable String displayId, @Nullable HgCommandResult result, @NlsContexts.NotificationTitle @NotNull String failureTitle, @NlsContexts.NotificationContent @NotNull String failureDescription, NotificationListener listener) { List<String> err = result != null ? result.getErrorLines() : Collections.emptyLis...
notifyError
25,175
void (@NotNull final Project project, @NotNull Collection<HgRepository> repos, @Nullable HgRepository selectedRepo, @NotNull DataContext dataContext) { final HgPullDialog dialog = new HgPullDialog(project, repos, selectedRepo); if (dialog.showAndGet()) { final String source = dialog.getSource(); final HgRepository hgRe...
execute
25,176
void (@NotNull ProgressIndicator indicator) { executePull(project, hgRepository, source); HgUtil.markDirectoryDirty(project, hgRepository.getRoot()); }
run
25,177
void (final Project project, final HgRepository hgRepository, final String source) { final HgPullCommand command = new HgPullCommand(project, hgRepository.getRoot()); command.setSource(source); command.executeInCurrentThread(); hgRepository.update(); }
executePull
25,178
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
25,179
void (@NotNull AnActionEvent event) { final DataContext dataContext = event.getDataContext(); final Project project = CommonDataKeys.PROJECT.getData(dataContext); if (project == null) { return; } HgRepositoryManager repositoryManager = HgUtil.getRepositoryManager(project); List<HgRepository> repositories = repositoryMa...
actionPerformed
25,180
void (@NotNull AnActionEvent e) { boolean enabled = isEnabled(e); e.getPresentation().setEnabled(enabled); }
update
25,181
boolean (AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); if (project == null) { return false; } HgVcs vcs = Objects.requireNonNull(HgVcs.getInstance(project)); final VirtualFile[] roots = ProjectLevelVcsManager.getInstance(project).getRootsUnderVcs(vcs); if (roots == null || roots.length == 0) {...
isEnabled
25,182
List<HgRepository> (@NotNull DataContext dataContext) { Project project = dataContext.getData(CommonDataKeys.PROJECT); if (project == null) return Collections.emptyList(); HgRepositoryManager repositoryManager = HgUtil.getRepositoryManager(project); VirtualFile[] files = ObjectUtils.notNull(dataContext.getData(CommonDa...
getSelectedRepositoriesFromEvent
25,183
void (@NotNull final Project project, @NotNull final Collection<HgRepository> repositories, @Nullable HgRepository selectedRepo, @NotNull DataContext dataContext) { final HgUpdateToDialog dialog = new HgUpdateToDialog(project, repositories, selectedRepo); if (dialog.showAndGet()) { FileDocumentManager.getInstance().sav...
execute
25,184
void (@NotNull HgRepository repository, @NotNull List<String> patchNames) { new HgQFoldCommand(repository).executeInCurrentThread(patchNames); }
executeInCurrentThread
25,185
String () { return HgBundle.message("action.hg4idea.QFold.title"); }
getTitle
25,186
boolean (@NotNull HgRepository repository) { return !repository.getMQAppliedPatches().isEmpty(); }
isEnabled
25,187
void (@NotNull Project project, @NotNull Collection<HgRepository> repositories, @Nullable HgRepository selectedRepo, @NotNull DataContext dataContext) { if (selectedRepo != null) { showUnAppliedPatches(project, selectedRepo); } }
execute
25,188
void (@NotNull AnActionEvent e) { HgRepository repository = getSelectedRepositoryFromEvent(e.getDataContext()); e.getPresentation().setEnabledAndVisible(repository != null && repository.getRepositoryConfig().isMqUsed()); }
update
25,189
void (@NotNull Project project, @NotNull HgRepository selectedRepo) { ToolWindow toolWindow = Objects.requireNonNull(ToolWindowManager.getInstance(project).getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID)); String tabName = selectedRepo.getRoot().getName(); HgMqUnAppliedPatchesPanel patchesPanel = new HgMqUnAppli...
showUnAppliedPatches
25,190
void (@NotNull HgRepository repository, @NotNull String patchName) { new HgQGotoCommand(repository).executeInCurrentThread(patchName); }
executeInCurrentThread
25,191
String () { return HgBundle.message("action.hg4idea.QGotoFromPatches.title"); }
getTitle
25,192
boolean (@NotNull Project project, @NotNull HgRepository repository, @NotNull Hash hash) { return repository.getRepositoryConfig().isMqUsed() && super.isVisible(project, repository, hash); }
isVisible
25,193
boolean (@NotNull HgRepository repository, @NotNull Hash commit) { return repository.getRepositoryConfig().isMqUsed() && super.isEnabled(repository, commit); }
isEnabled
25,194
void (@NotNull HgRepository repository, @NotNull List<String> patchNames) { assert patchNames.size() == 1; executeInCurrentThread(repository, patchNames.iterator().next()); }
executeInCurrentThread
25,195
void (@NotNull AnActionEvent e) { HgMqUnAppliedPatchesPanel patchInfo = e.getData(HgMqUnAppliedPatchesPanel.MQ_PATCHES); e.getPresentation().setEnabled(patchInfo != null && patchInfo.getSelectedRowsCount() == 1); }
update
25,196
void (@NotNull HgRepository repository, @NotNull String patchName) { new HgQPushCommand(repository).executeInCurrentThread(patchName); }
executeInCurrentThread
25,197
String () { return HgBundle.message("action.hg4idea.QPushAction.title"); }
getTitle
25,198
void (final @NotNull HgRepository repository, final @NotNull VcsFullCommitDetails commit) { final Project project = repository.getProject(); List<Hash> parents = commit.getParents(); final Hash parentHash = parents.isEmpty() ? null : parents.get(0); final HgNameWithHashInfo parentPatchName = ContainerUtil.find(reposito...
actionPerformed
25,199
void (@NotNull ProgressIndicator indicator) { if (parentPatchName != null) { new HgQGotoCommand(repository).executeInCurrentThread(parentPatchName.getName()); } else { new HgQPopCommand(repository).executeInCurrentThread(); } }
run