Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
24,800
void (String revision) { this.revision = revision; }
setRevision
24,801
void (boolean update) { this.update = update; }
setUpdate
24,802
void (boolean rebase) { this.rebase = rebase; }
setRebase
24,803
void (String source) { this.source = source; }
setSource
24,804
HgCommandExitCode () { List<String> arguments = new LinkedList<>(); if (update) { arguments.add("--update"); } else if (rebase) { arguments.add("--rebase"); } if (!StringUtil.isEmptyOrSpaces(revision)) { arguments.add("--rev"); arguments.add(revision); } arguments.add(source); final HgRemoteCommandExecutor executor = n...
executeInCurrentThread
24,805
void (@NotNull Set<HgFile> files) { myFiles = files; }
setFiles
24,806
char () { return status; }
getStatus
24,807
HgResolveStatusEnum (char status) { if (status == UNRESOLVED.status) { return UNRESOLVED; } if (status == RESOLVED.status) { return RESOLVED; } return null; }
valueOf
24,808
void (@NotNull List<? extends HgRepository> repositories, @NotNull @NlsSafe String name, boolean isActive) { final Project project = Objects.requireNonNull(ContainerUtil.getFirstItem(repositories)).getProject(); if (StringUtil.isEmptyOrSpaces(name)) { VcsNotifier.getInstance(project).notifyError(BOOKMARK_NAME, HgBundle...
createBookmarkAsynchronously
24,809
void (@NotNull ProgressIndicator indicator) { for (HgRepository repository : repositories) { executeBookmarkCommandSynchronously(project, repository.getRoot(), name, isActive ? emptyList() : singletonList("--inactive")); } }
run
24,810
void (@NotNull Project project, @NotNull VirtualFile repo, @NotNull @NlsSafe String name) { executeBookmarkCommandSynchronously(project, repo, name, singletonList("-d")); }
deleteBookmarkSynchronously
24,811
void (@NotNull Project project, @NotNull VirtualFile repositoryRoot, @NotNull @NlsSafe String name, @NotNull List<@NonNls String> args) { ArrayList<String> arguments = new ArrayList<>(args); arguments.add(name); HgCommandResult result = new HgCommandExecutor(project).executeInCurrentThread(repositoryRoot, "bookmark", a...
executeBookmarkCommandSynchronously
24,812
void (HgRevisionNumber revision) { this.revision = revision; }
setRevision
24,813
void (List<String> args) { if (revision != null) { args.add("--rev"); args.add(revision.getChangeset()); } }
addArguments
24,814
boolean () { return true; }
isSilentCommand
24,815
String () { return source; }
getSource
24,816
void (String source) { this.source = source; }
setSource
24,817
void (boolean clean) { myCleanStatus = clean; }
cleanFilesOption
24,818
Builder (boolean val) { includeRemoved = val; return this; }
removed
24,819
Builder (boolean val) { includeUnknown = val; return this; }
unknown
24,820
Builder (boolean val) { includeIgnored = val; return this; }
ignored
24,821
Builder (boolean val) { includeCopySource = val; return this; }
copySource
24,822
Builder (HgRevisionNumber val) { baseRevision = val; return this; }
baseRevision
24,823
Builder (HgRevisionNumber val) { targetRevision = val; return this; }
targetRevision
24,824
HgStatusCommand (@NotNull Project project) { return new HgStatusCommand(project, this); }
build
24,825
Set<HgChange> (VirtualFile repo) { return executeInCurrentThread(repo, null); }
executeInCurrentThread
24,826
Set<HgChange> (VirtualFile repo, @Nullable Collection<FilePath> paths) { if (repo == null) { return Collections.emptySet(); } HgCommandExecutor executor = new HgCommandExecutor(myProject); executor.setSilent(true); List<String> options = new LinkedList<>(); if (myIncludeAdded) { options.add("--added"); } if (myIncludeM...
executeInCurrentThread
24,827
Collection<VirtualFile> (@NotNull VirtualFile repo) { return getFiles(repo, (Collection<FilePath>)null); }
getFiles
24,828
Collection<VirtualFile> (@NotNull VirtualFile repo, @Nullable List<VirtualFile> files) { //noinspection RedundantTypeArguments incorrect inspection, javac fails return getFiles(repo, files != null ? ContainerUtil.<VirtualFile, FilePath>map(files, VcsUtil::getFilePath) : null); }
getFiles
24,829
Collection<VirtualFile> (@NotNull VirtualFile repo, @Nullable Collection<FilePath> paths) { return ContainerUtil.mapNotNull(getFilePaths(repo, paths), FilePath::getVirtualFile); }
getFiles
24,830
Collection<FilePath> (@NotNull VirtualFile repo, @Nullable Collection<FilePath> paths) { Collection<FilePath> resultFiles = new HashSet<>(); Set<HgChange> change = executeInCurrentThread(repo, paths); for (HgChange hgChange : change) { FilePath file = hgChange.afterFile().toFilePath(); resultFiles.add(file); } return r...
getFilePaths
24,831
void (@NotNull final String startRevisionNumber) { BackgroundTaskUtil.executeOnPooledThread(myRepository, () -> executeInCurrentThread(startRevisionNumber)); }
execute
24,832
void (@NotNull final String startRevisionNumber) { final Project project = myRepository.getProject(); String lastRevisionName = myRepository.getMQAppliedPatches().isEmpty() ? "tip" : "qparent"; List<String> arguments = List.of("--rev", startRevisionNumber + ":" + lastRevisionName); HgCommandResult result = new HgComman...
executeInCurrentThread
24,833
HgCommandResult (@NotNull final String name) { Project project = myRepository.getProject(); HgCommandResult result = new HgCommandExecutor(project) .executeInCurrentThread(myRepository.getRoot(), "qgoto", Collections.singletonList(name)); if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotifie...
executeInCurrentThread
24,834
void (@NotNull final List<String> patchNames) { final Project project = myRepository.getProject(); HgCommandResult result = new HgCommandExecutor(project) .executeInCurrentThread(myRepository.getRoot(), "qfold", patchNames); if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotifier(project) .no...
executeInCurrentThread
24,835
void (@NotNull final String patchName) { final Project project = myRepository.getProject(); HgCommandResult result = new HgCommandExecutor(project).executeInCurrentThread(myRepository.getRoot(), "qpush", Arrays.asList("--move", patchName)); if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotif...
executeInCurrentThread
24,836
void (@NotNull final Hash patchHash) { final Project project = myRepository.getProject(); HgNameWithHashInfo patchInfo = ContainerUtil.find(myRepository.getMQAppliedPatches(), info -> info.getHash().equals(patchHash)); if (patchInfo == null) { LOG.error("Could not find patch " + patchHash.toString()); return; } final S...
execute
24,837
void (@NotNull HgRepository repository, @NotNull String oldName, @NotNull String newName) { if (oldName.equals(newName)) return; Project project = repository.getProject(); BackgroundTaskUtil.executeOnPooledThread(repository, () -> { HgCommandExecutor executor = new HgCommandExecutor(project); HgCommandResult result = e...
performPatchRename
24,838
HgCommandResult () { final Project project = myRepository.getProject(); HgCommandResult result = new HgCommandExecutor(project) .executeInCurrentThread(myRepository.getRoot(), "qpop", Collections.singletonList("--all")); if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotifier(project) .notify...
executeInCurrentThread
24,839
void (@NotNull final List<String> patchNames) { final Project project = myRepository.getProject(); HgCommandResult result = new HgCommandExecutor(project) .executeInCurrentThread(myRepository.getRoot(), "qdelete", patchNames); if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotifier(project) ....
executeInCurrentThread
24,840
Collection<String> () { return HgBranchUtil.getCommonBranches(myRepositories); }
getLocalBranchNames
24,841
String () { StringBuilder sb = new StringBuilder(); for (HgRepository repository : myRepositories) { sb.append(repository.getPresentableUrl()).append(":").append(repository.getCurrentBranchName()).append(":") .append(repository.getState()); } return sb.toString(); }
toString
24,842
void () { if (myBranchType == null) { getTemplatePresentation().setIcon(null); getTemplatePresentation().setHoveredIcon(null); } }
hideIconForUnnamedHeads
24,843
HgRepository (@NotNull List<? extends HgRepository> repositories) { assert !repositories.isEmpty(); return repositories.size() > 1 ? null : repositories.get(0); }
chooseRepository
24,844
void () { super.toggle(); myBranchManager.setFavorite(myBranchType, chooseRepository(myRepositories), myBranchName, isFavorite()); }
toggle
24,845
void (@NotNull AnActionEvent e) { FileDocumentManager.getInstance().saveAllDocuments(); final UpdatedFiles updatedFiles = UpdatedFiles.create(); for (final HgRepository repository : myRepositories) { HgMergeCommand.mergeWith(repository, myBranchName, updatedFiles); } }
actionPerformed
24,846
void (@NotNull AnActionEvent e) { HgUpdateCommand.updateTo(myBranchName, myRepositories, null); }
actionPerformed
24,847
void (@NotNull AnActionEvent e) { FileDocumentManager.getInstance().saveAllDocuments(); HgRepository repository = myRepositories.get(0); new HgBrancher(myProject).compare(myBranchName, myRepositories, repository); }
actionPerformed
24,848
Collection<String> (@NotNull BranchType type) { ArrayList<String> branches = new ArrayList<>(); if (type == HgBranchType.BRANCH) { branches.add(HgRefManager.DEFAULT); } return branches; }
getDefaultBranchNames
24,849
List<String> (@NotNull Collection<? extends HgRepository> repositories) { return getCommonNames(repositories, false); }
getCommonBranches
24,850
List<String> (@NotNull Collection<? extends HgRepository> repositories) { return getCommonNames(repositories, true); }
getCommonBookmarks
24,851
List<String> (@NotNull Collection<? extends HgRepository> repositories, boolean bookmarkType) { Collection<String> common = null; for (HgRepository repository : repositories) { Collection<String> names = bookmarkType ? HgUtil.getSortedNamesWithoutHashes(repository.getBookmarks()) : repository.getOpenedBranches(); commo...
getCommonNames
24,852
Project () { return myProject; }
getProject
24,853
RepositoryManager () { return HgUtil.getRepositoryManager(myProject); }
getRepositoryManager
24,854
DvcsCompareSettings () { return HgProjectSettings.getInstance(myProject); }
getDvcsCompareSettings
24,855
String (@NotNull String firstBranch, @NotNull String secondBranch) { return String.format("hg log -r \"reverse(%s%%%s)\"", secondBranch, firstBranch); }
formatLogCommand
24,856
void (@NotNull Project project, @NotNull Collection<HgRepository> repositories, @Nullable HgRepository selectedRepo, @NotNull DataContext dataContext) { if (selectedRepo != null) { HgBranchPopup.getInstance(project, selectedRepo, dataContext).asListPopup().showInFocusCenter(); } }
execute
24,857
void (@NotNull final String branchName, @NotNull final List<HgRepository> repositories, @NotNull final HgRepository selectedRepository) { try { final CommitCompareInfo myCompareInfo = loadCommitsToCompare(repositories, branchName); ApplicationManager.getApplication().invokeLater(() -> displayCompareDialog(branchName, g...
compare
24,858
void (@NotNull String branchName, @NotNull String currentBranch, @NotNull CommitCompareInfo compareInfo, @NotNull HgRepository selectedRepository) { if (compareInfo.isEmpty()) { Messages.showInfoMessage(myProject, XmlStringUtil .wrapInHtml(HgBundle.message("hg4idea.branch.compare.no.changes.msg", currentBranch, branchN...
displayCompareDialog
24,859
String (@NotNull Collection<HgRepository> repositories) { String currentBranch; if (repositories.size() > 1) { HgMultiRootBranchConfig multiRootBranchConfig = new HgMultiRootBranchConfig(repositories); currentBranch = multiRootBranchConfig.getCurrentBranch(); } else { assert !repositories.isEmpty() : "No repositories p...
getCurrentBranchOrRev
24,860
void (@NotNull AnActionEvent e) { final String name = getNewBranchNameFromUser(myPreselectedRepo, HgBundle.message("hg4idea.branch.create")); if (name == null) { return; } new Task.Backgroundable(myProject, HgBundle.message("hg4idea.branch.creating.progress", myRepositories.size())) { @Override public void run(@NotNull...
actionPerformed
24,861
void (@NotNull ProgressIndicator indicator) { createNewBranchInCurrentThread(name); }
run
24,862
void (final @NotNull String name) { for (final HgRepository repository : myRepositories) { try { HgCommandResult result = new HgBranchCreateCommand(myProject, repository.getRoot(), name).executeInCurrentThread(); repository.update(); if (HgErrorUtil.hasErrorsInCommandExecution(result)) { new HgCommandResultNotifier(myP...
createNewBranchInCurrentThread
24,863
void (@NotNull AnActionEvent e) { final Project project = myPreselectedRepo.getProject(); StoreUtil.saveDocumentsAndProjectSettings(project); ChangeListManager.getInstance(project).invokeAfterUpdateWithModal( true, VcsBundle.message("waiting.changelists.update.for.show.commit.dialog.message"), () -> commitAndCloseBranc...
actionPerformed
24,864
void (final @NotNull Project project) { final LocalChangeList activeChangeList = ChangeListManager.getInstance(project).getDefaultChangeList(); HgVcs vcs = HgVcs.getInstance(project); assert vcs != null; final HgRepositoryManager repositoryManager = HgUtil.getRepositoryManager(project); List<Change> changesForRepositor...
commitAndCloseBranch
24,865
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
24,866
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(ContainerUtil.and(myRepositories, repository -> repository.getOpenedBranches() .contains(repository.getCurrentBranch()))); }
update
24,867
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
24,868
void (@NotNull AnActionEvent e) { DvcsUtil.disableActionIfAnyRepositoryIsFresh(e, myRepositories, HgBundle.message("action.not.possible.in.fresh.repo.new.bookmark")); }
update
24,869
void (@NotNull AnActionEvent e) { final HgBookmarkDialog bookmarkDialog = new HgBookmarkDialog(myPreselectedRepo); if (bookmarkDialog.showAndGet()) { final String name = bookmarkDialog.getName(); if (!StringUtil.isEmptyOrSpaces(name)) { HgBookmarkCommand.createBookmarkAsynchronously(myRepositories, name, bookmarkDialog...
actionPerformed
24,870
Collection<Hash> () { Collection<Hash> branchWithHashes = myRepository.getBranches().get(myCurrentBranchName); String currentHead = myRepository.getCurrentRevision(); if (branchWithHashes == null || currentHead == null || myRepository.getState() != Repository.State.NORMAL) { // repository is fresh or branch is fresh or...
filterUnnamedHeads
24,871
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
24,872
void (final @NotNull AnActionEvent e) { if (myRepository.isFresh() || myHeads.isEmpty()) { e.getPresentation().setEnabledAndVisible(false); } else if (myRepository.getState() != Repository.State.NORMAL) { e.getPresentation().setEnabled(false); } }
update
24,873
void (@NotNull AnActionEvent e) { BackgroundTaskUtil.executeOnPooledThread(HgDisposable.getInstance(myProject), () -> { for (HgRepository repository : myRepositories) { HgBookmarkCommand.deleteBookmarkSynchronously(myProject, repository.getRoot(), myBranchName); } }); }
actionPerformed
24,874
HgBranchPopup (@NotNull Project project, @NotNull HgRepository currentRepository, @NotNull DataContext dataContext) { HgRepositoryManager manager = HgUtil.getRepositoryManager(project); HgProjectSettings hgProjectSettings = HgProjectSettings.getInstance(project); HgMultiRootBranchConfig hgMultiRootBranchConfig = new Hg...
getInstance
24,875
void (@NotNull LightActionGroup popupGroup, @NotNull AbstractRepositoryManager<HgRepository> repositoryManager) { List<HgRepository> allRepositories = repositoryManager.getRepositories(); popupGroup.add(new HgBranchPopupActions.HgNewBranchAction(myProject, allRepositories, myCurrentRepository)); popupGroup.addAction(ne...
fillWithCommonRepositoryActions
24,876
HgCommonBranchActions (List<HgRepository> allRepositories, String name, boolean isBookmark) { List<HgRepository> repositories = filterRepositoriesNotOnThisBranch(name, allRepositories); if (repositories.isEmpty()) return null; return isBookmark ? new HgBranchPopupActions.BookmarkActions(myProject, repositories, name) :...
createLocalBranchActions
24,877
LightActionGroup () { LightActionGroup popupGroup = new LightActionGroup(false); popupGroup.addSeparator(HgBundle.message("repositories")); List<ActionGroup> rootActions = DvcsUtil.sortRepositories(myRepositoryManager.getRepositories()).stream() .map(repo -> new RootAction<>(repo, new HgBranchPopupActions(repo.getProje...
createRepositoriesActions
24,878
void (@NotNull LightActionGroup popupGroup, @Nullable LightActionGroup actions) { popupGroup.addAll(new HgBranchPopupActions(myProject, myCurrentRepository).createActions(actions, myInSpecificRepository ? myCurrentRepository : null, true)); }
fillPopupWithCurrentRepositoryActions
24,879
void (@NotNull final String branchName, @NotNull final List<HgRepository> repositories, @NotNull final HgRepository selectedRepository) { new Task.Backgroundable(myProject, HgBundle.message("hg4idea.branch.comparing", branchName)) { @Override public void run(@NotNull ProgressIndicator indicator) { newWorker(indicator)....
compare
24,880
void (@NotNull ProgressIndicator indicator) { newWorker(indicator).compare(branchName, repositories, selectedRepository); }
run
24,881
VcsDependentHistoryComponents (VcsHistorySession session, JComponent forShortcutRegistration) { return VcsDependentHistoryComponents.createOnlyColumns(ColumnInfo.EMPTY_ARRAY); }
getUICustomization
24,882
AnAction[] (Runnable runnable) { return new AnAction[]{ShowAllAffectedGenericAction.getInstance(), ActionManager.getInstance().getAction(VcsActions.ACTION_COPY_REVISION_NUMBER)}; }
getAdditionalActions
24,883
boolean () { return false; }
isDateOmittable
24,884
String () { return null; }
getHelpId
24,885
VcsHistorySession (FilePath filePath) { final VirtualFile vcsRoot = VcsUtil.getVcsRootFor(myProject, filePath); if (vcsRoot == null) { return null; } final List<VcsFileRevision> revisions = new ArrayList<>(getHistory(filePath, vcsRoot, myProject)); return createAppendableSession(vcsRoot, filePath, revisions, revisions....
createSessionFor
24,886
VcsAbstractHistorySession (@NotNull VirtualFile vcsRoot, @NotNull FilePath filePath, @NotNull List<VcsFileRevision> revisions, @Nullable VcsRevisionNumber number) { return new VcsAbstractHistorySession(revisions, number) { @Override protected @Nullable VcsRevisionNumber calcCurrentRevisionNumber() { if (filePath.isDire...
createAppendableSession
24,887
VcsHistorySession () { return createAppendableSession(vcsRoot, filePath, getRevisionList(), getCurrentRevisionNumber()); }
copy
24,888
List<HgFileRevision> (@NotNull FilePath filePath, @NotNull VirtualFile vcsRoot, @NotNull Project project) { VcsConfiguration vcsConfiguration = VcsConfiguration.getInstance(project); return getHistory(filePath, vcsRoot, project, null, vcsConfiguration.LIMIT_HISTORY ? vcsConfiguration.MAXIMUM_HISTORY_ROWS : -1); }
getHistory
24,889
List<HgFileRevision> (@NotNull FilePath filePath, @NotNull VirtualFile vcsRoot, @NotNull Project project, @Nullable HgRevisionNumber revisionNumber, int limit) { /* The standard way to get history following renames is to call hg log --follow. However: 1. It is broken in case of uncommitted rename (i.e. if the file is c...
getHistory
24,890
List<HgFileRevision> (@NotNull FilePath originalHgFilePath, @NotNull VirtualFile vcsRoot, @NotNull Project project, int limit) { HgFile originalHgFile = new HgFile(vcsRoot, originalHgFilePath); final HgLogCommand logCommand = new HgLogCommand(project); logCommand.setIncludeRemoved(true); final HgVersion version = logCo...
getHistoryForUncommittedRenamed
24,891
boolean () { return true; }
supportsHistoryForDirectories
24,892
DiffFromHistoryHandler () { return new HgDiffFromHistoryHandler(myProject); }
getHistoryDiffHandler
24,893
boolean (@NotNull VirtualFile file) { return true; }
canShowHistoryFor
24,894
VcsRevisionNumber () { return myRevisionNumber; }
getRevisionNumber
24,895
VirtualFile () { return myRepositoryRoot; }
getRepositoryRoot
24,896
boolean () { return !AdvancedSettings.getBoolean("vcs.process.ignored"); }
scanTurnedOff
24,897
void (List<? extends Change> changes, List<VcsException> vcsExceptions, @NotNull RollbackProgressListener listener) { if (changes == null || changes.isEmpty()) { return; } List<FilePath> toDelete = new ArrayList<>(); List<FilePath> filePaths = new LinkedList<>(); for (Change change : changes) { ContentRevision contentR...
rollbackChanges
24,898
void (List<? extends FilePath> files, List<? super VcsException> exceptions, RollbackProgressListener listener) { try (AccessToken ignore = DvcsUtil.workingTreeChangeStarted(project, getRollbackOperationName())) { revert(files); } }
rollbackMissingFileDeletion
24,899
void (List<? extends VirtualFile> files, List<? super VcsException> exceptions, RollbackProgressListener listener) { }
rollbackModifiedWithoutCheckout