Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
24,900
List<VcsException> (List<? extends FilePath> files) { if (files == null || files.isEmpty()) { return null; } revert(files); return null; }
rollbackMissingFileDeletion
24,901
void (@NotNull List<? extends FilePath> filePaths) { for (Map.Entry<VirtualFile, Collection<FilePath>> entry : HgUtil.groupFilePathsByHgRoots(project, filePaths).entrySet()) { final VirtualFile repo = entry.getKey(); final Collection<FilePath> files = entry.getValue(); HgRevisionNumber revisionNumber = new HgWorkingCop...
revert
24,902
List<Change> (@NotNull FilePath path, @NotNull HgFileRevision rev1, @Nullable HgFileRevision rev2) { return executeDiff(path, rev1, rev2); }
getChangesBetweenRevisions
24,903
List<Change> (@NotNull FilePath path, @NotNull HgFileRevision rev) { return executeDiff(path, null, rev); }
getAffectedChanges
24,904
String (@NotNull HgFileRevision revision) { return revision.getRevisionNumber().getChangeset(); }
getPresentableName
24,905
List<Change> (@NotNull FilePath path, @Nullable HgFileRevision rev1, @Nullable HgFileRevision rev2) { VirtualFile root = VcsUtil.getVcsRootFor(myProject, path); LOG.assertTrue(root != null, "Repository is null for " + path); return HgUtil .getDiff(myProject, root, path, rev1 != null ? rev1.getRevisionNumber() : null, r...
executeDiff
24,906
HgRevisionNumber () { return (HgRevisionNumber)super.getRevisionNumber(); }
getRevisionNumber
24,907
String () { return myBranch; }
getBranch
24,908
AbstractVcs () { return myVcs; }
getVcs
24,909
String () { return getComment(); }
toString
24,910
void (@NotNull VirtualFile file) { try { new HgResolveCommand(myProject).markResolved(HgUtil.getHgRootOrThrow(myProject, file), file); } catch (VcsException e) { LOG.error("Couldn't mark file resolved, because it is not under Mercurial root."); } }
conflictResolvedForFile
24,911
boolean (@NotNull VirtualFile file) { return file.getFileType().isBinary(); }
isBinary
24,912
boolean (VirtualFile repo, VirtualFile file) { // in the case of merge if the file was checked in, it will have 2 parents after hg pull. If it wasn't, it would have only one parent final Couple<HgRevisionNumber> parents = new HgWorkingCopyRevisionsCommand(myProject).parents(repo, file); return parents.second != null; }
wasFileCheckedIn
24,913
void (final @NotNull Project project, final @Nullable Listener listener) { FileDocumentManager.getInstance().saveAllDocuments(); HgCloneDialog dialog = new HgCloneDialog(project); if (!dialog.showAndGet()) { return; } dialog.rememberSettings(); String directoryName = dialog.getDirectoryName(); String sourceRepositoryUR...
doCheckout
24,914
void (@NotNull Project project, @Nullable Listener listener, @NotNull String directoryName, @NotNull String sourceRepositoryURL, @NotNull String parentDirectory) { VirtualFile destinationParent = LocalFileSystem.getInstance().findFileByIoFile(new File(parentDirectory)); if (destinationParent == null) { return; } final ...
doClone
24,915
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
24,916
CloneStatus (@NotNull ProgressIndicator indicator) { HgCloneCommand clone = new HgCloneCommand(project); clone.setRepositoryURL(sourceRepositoryURL); clone.setDirectory(targetDir); HgCommandResult commandResult = clone.executeInCurrentThread(); if (commandResult == null || HgErrorUtil.hasErrorsInCommandExecution(comman...
run
24,917
String () { return HgBundle.message("hg4idea.vcs.name.with.mnemonic"); }
getVcsName
24,918
VcsCloneComponent (@NotNull Project project, @NotNull ModalityState modalityState, @NotNull VcsCloneDialogComponentStateListener dialogStateListener) { return new HgCloneDialogComponent(project, dialogStateListener); }
buildVcsCloneComponent
24,919
boolean () { return true; }
isModifiedDocumentTrackingRequired
24,920
void (@NotNull VcsDirtyScope dirtyScope, @NotNull ChangelistBuilder builder, @NotNull ProgressIndicator progress, @NotNull ChangeListManagerGate addGate) { if (myProject.isDisposed()) return; final Collection<HgChange> changes = new HashSet<>(); changes.addAll(process(builder, dirtyScope.getRecursivelyDirtyDirectories(...
getChanges
24,921
Collection<HgChange> (ChangelistBuilder builder, Collection<FilePath> files) { final Set<HgChange> hgChanges = new HashSet<>(); for (Map.Entry<VirtualFile, Collection<FilePath>> entry : HgUtil.groupFilePathsByHgRoots(myProject, files).entrySet()) { VirtualFile repo = entry.getKey(); final HgRevisionNumber workingRevisi...
process
24,922
void (ChangelistBuilder builder, Set<HgChange> changes, Map<HgFile, HgResolveStatusEnum> resolveStatus, HgRevisionNumber workingRevision, HgRevisionNumber parentRevision) { for (HgChange change : changes) { HgFile afterFile = change.afterFile(); HgFile beforeFile = change.beforeFile(); HgFileStatusEnum status = change....
sendChanges
24,923
boolean (@NotNull HgChange change, Set<HgChange> changes) { if (change.getStatus().equals(HgFileStatusEnum.DELETED)) { for (HgChange otherChange : changes) { if (otherChange.getStatus().equals(HgFileStatusEnum.COPY) && otherChange.beforeFile().equals(change.afterFile())) { return true; } } } return false; }
isDeleteOfCopiedFile
24,924
void (ChangelistBuilder builder, Set<FilePath> dirtyFiles, Collection<HgChange> alreadyProcessed) { // exclude already processed for (HgChange c : alreadyProcessed) { dirtyFiles.remove(c.beforeFile().toFilePath()); dirtyFiles.remove(c.afterFile().toFilePath()); } final ProjectLevelVcsManager vcsManager = ProjectLevelVc...
processUnsavedChanges
24,925
void (ContentRevision contentRevisionBefore, ContentRevision contentRevisionAfter, FileStatus fileStatus, ChangelistBuilder builder, VcsKey vcsKey) { if (contentRevisionBefore == null && contentRevisionAfter == null) { return; } builder.processChange( new Change(contentRevisionBefore, contentRevisionAfter, fileStatus),...
processChange
24,926
VcsRevisionNumber () { return revisionNumber; }
getRevisionNumber
24,927
ContentRevision (@NotNull HgFile hgFile, @NotNull HgRevisionNumber revision) { VirtualFile virtualFile = VcsUtil.getVirtualFile(hgFile.getFile()); if (virtualFile == null) { return null; } if (!virtualFile.getFileType().isBinary()) { return new HgCurrentContentRevision(hgFile, revision, virtualFile); } return new HgCur...
create
24,928
String () { return HgVcs.VCS_NAME; }
getVcsName
24,929
List<AnAction> (@NotNull ActionManager manager) { List<AnAction> actions = new ArrayList<>(); add("hg4idea.branches", manager, actions); add("hg4idea.pull", manager, actions); add("Vcs.Push", manager, actions); add("hg4idea.updateTo", manager, actions); add("ChangesView.AddUnversioned", manager, actions); return action...
collectVcsSpecificActions
24,930
VcsRepositoryIgnoredFilesHolder (@NotNull HgRepository repository) { return repository.getIgnoredFilesHolder(); }
getHolder
24,931
AbstractVcs () { return myVcs; }
getVcs
24,932
VcsManagedFilesHolder () { return new HgIgnoredFileHolder(myManager); }
createHolder
24,933
void (@NotNull Project project) { myManager.getRepositories().forEach(r -> r.getIgnoredFilesHolder().startRescan()); }
refresh
24,934
ChangesBrowserSettingsEditor<ChangeBrowserSettings> (boolean showDateFilter) { return new HgVersionFilterComponent(showDateFilter); }
createFilterUI
24,935
void (ChangeBrowserSettings changeBrowserSettings, @NotNull RepositoryLocation repositoryLocation, int maxCount, @NotNull AsynchConsumer<? super CommittedChangeList> consumer) { try { List<CommittedChangeList> results = getCommittedChanges(changeBrowserSettings, repositoryLocation, maxCount); for (CommittedChangeList r...
loadCommittedChanges
24,936
List<CommittedChangeList> (ChangeBrowserSettings changeBrowserSettings, @NotNull RepositoryLocation repositoryLocation, int maxCount) { VirtualFile root = ((HgRepositoryLocation)repositoryLocation).getRoot(); HgFile hgFile = new HgFile(root, VcsUtil.getFilePath(root.getPath())); List<CommittedChangeList> result = new L...
getCommittedChanges
24,937
Change (VirtualFile root, @Nullable String fileBefore, @Nullable HgRevisionNumber revisionBefore, @Nullable String fileAfter, HgRevisionNumber revisionAfter, FileStatus aStatus) { HgContentRevision beforeRevision = fileBefore == null ? null : HgContentRevision.create(project, new HgFile(root, new File(root.getPath(), f...
createChange
24,938
VcsCommittedViewAuxiliary (@NotNull DecoratorManager manager, @Nullable RepositoryLocation location) { AnAction copyHashAction = new DumbAwareAction( HgBundle.messagePointer("action.DumbAware.HgCommittedChangesProvider.text.copy.hash"), HgBundle.messagePointer("action.DumbAware.HgCommittedChangesProvider.description.co...
createActions
24,939
void (@NotNull AnActionEvent e) { ChangeList[] changeLists = e.getData(VcsDataKeys.CHANGE_LISTS); if (changeLists != null && changeLists[0] instanceof HgCommittedChangeList) { HgRevisionNumber revisionNumber = ((HgCommittedChangeList)changeLists[0]).getRevisionNumber(); CopyPasteManager.getInstance().setContents(new St...
actionPerformed
24,940
int () { return -1; }
getUnlimitedCountValue
24,941
boolean () { return false; }
supportsIncomingChanges
24,942
String () { return HgBundle.message("hg4idea.changelist.column.branch"); }
getTitle
24,943
Object (final HgCommittedChangeList changeList) { final String branch = changeList.getBranch(); return branch.isEmpty() ? "default" : branch; }
getValue
24,944
Comparator<HgCommittedChangeList> () { return BRANCH_COLUMN_COMPARATOR; }
getComparator
24,945
VirtualFile () { return myRoot; }
getRoot
24,946
String () { return myUrl; }
toPresentableString
24,947
String () { return toPresentableString(); }
toString
24,948
String () { return myUrl; }
getKey
24,949
VcsRevisionNumber (VirtualFile file) { VirtualFile vcsRoot = VcsUtil.getVcsRootFor(project, file); if (vcsRoot == null) { return null; } FilePath filePath = VcsUtil.getFilePath(file); return new HgWorkingCopyRevisionsCommand(project).parents(vcsRoot, filePath).first; }
getCurrentRevision
24,950
ItemLatestState (VirtualFile file) { VirtualFile vcsRoot = VcsUtil.getVcsRootFor(project, file); if (vcsRoot == null) { return null; } HgRevisionNumber revision = (HgRevisionNumber) getCurrentRevision(file); if (revision == null) { return null; } return new ItemLatestState(revision, file.exists(), true); }
getLastRevision
24,951
ItemLatestState (FilePath filePath) { VirtualFile vcsRoot = VcsUtil.getVcsRootFor(project, filePath); if (vcsRoot == null) { return null; } HgWorkingCopyRevisionsCommand command = new HgWorkingCopyRevisionsCommand(project); HgRevisionNumber currentRevision = command.identify(vcsRoot).getFirst(); if (currentRevision == ...
getLastRevision
24,952
VcsRevisionNumber (VirtualFile vcsRoot) { return new HgWorkingCopyRevisionsCommand(project).tip(vcsRoot); }
getLatestCommittedRevision
24,953
ContentRevision (VcsRevisionNumber revisionNumber, VirtualFile file) { if (file == null) { return null; } VirtualFile vcsRoot = VcsUtil.getVcsRootFor(project, file); if (vcsRoot == null) { return null; } HgRevisionNumber hgRevisionNumber = (HgRevisionNumber) revisionNumber; if (hgRevisionNumber.isWorkingVersion()) { th...
createFileContent
24,954
boolean () { return true; }
canCompareWithWorkingDir
24,955
String () { return null; }
getHelpId
24,956
String () { return HgBundle.message("hg4idea.commit"); }
getCheckinOperationName
24,957
boolean () { return getAmendService().isAmendCommitSupported(); }
isAmendCommitSupported
24,958
CancellablePromise<EditedCommitDetails> (@NotNull VirtualFile root) { return getAmendService().getAmendCommitDetails(root); }
getAmendCommitDetails
24,959
HgAmendCommitService () { return myProject.getService(HgAmendCommitService.class); }
getAmendService
24,960
List<VcsException> (@NotNull List<? extends Change> changes, @NotNull String commitMessage, @NotNull CommitContext commitContext, @NotNull Set<? super String> feedback) { List<VcsException> exceptions = new LinkedList<>(); Map<HgRepository, Set<HgFile>> repositoriesMap = getFilesByRepository(changes); addRepositoriesWi...
commit
24,961
boolean (VirtualFile repo) { return new HgWorkingCopyRevisionsCommand(myProject).parents(repo).size() > 1; }
isMergeCommit
24,962
Set<HgFile> (VirtualFile repo, Set<HgFile> selectedFiles) { List<HgRevisionNumber> parents = new HgWorkingCopyRevisionsCommand(myProject).parents(repo); HgStatusCommand statusCommand = new HgStatusCommand.Builder(true).unknown(false).ignored(false).baseRevision(parents.get(0)).build(myProject); Set<HgChange> allChanged...
getChangedFilesNotInCommit
24,963
boolean (final String filesNotIncludedString) { final int[] choice = new int[1]; Runnable runnable = () -> choice[0] = Messages.showOkCancelDialog( myProject, XmlStringUtil.wrapInHtml(HgBundle.message("hg4idea.commit.partial.merge.message", filesNotIncludedString)), HgBundle.message("hg4idea.commit.partial.merge.title"...
mayCommitEverything
24,964
List<VcsException> (@NotNull List<? extends FilePath> files) { final List<HgFile> filesWithRoots = new ArrayList<>(); for (FilePath filePath : files) { VirtualFile vcsRoot = VcsUtil.getVcsRootFor(myProject, filePath); if (vcsRoot == null) { continue; } filesWithRoots.add(new HgFile(vcsRoot, filePath)); } new Task.Backg...
scheduleMissingFileForDeletion
24,965
void (@NotNull ProgressIndicator indicator) { new HgRemoveCommand(myProject).executeInCurrentThread(filesWithRoots); }
run
24,966
List<VcsException> (final @NotNull List<? extends VirtualFile> files) { new HgAddCommand(myProject).addWithProgress(files); return null; }
scheduleUnversionedFilesForAddition
24,967
boolean () { return false; }
isRefreshAfterCommitNeeded
24,968
void (Map<HgRepository, Set<HgFile>> result, ContentRevision contentRevision) { FilePath filePath = contentRevision.getFile(); // try to find repository from hgFile from change: to be able commit sub repositories as expected HgRepository repo = HgUtil.getRepositoryForFile(myProject, contentRevision instanceof HgCurrent...
addFile
24,969
void (@NotNull Map<HgRepository, Set<HgFile>> repositoryMap, @NotNull CommitContext commitContext) { HgRepositoryManager repositoryManager = getRepositoryManager(myProject); for (VcsRoot root : getCommitWithoutChangesRoots(commitContext)) { HgRepository repository = root.getVcs() == myVcs ? repositoryManager.getReposit...
addRepositoriesWithoutChanges
24,970
List<HgRevisionNumber> (List<HgRevisionNumber> branchHeadsBeforePull, List<HgRevisionNumber> branchHeadsAfterPull) { List<HgRevisionNumber> originalBranchHeadsRemaining = new ArrayList<>(); for (HgRevisionNumber headAfterPull : branchHeadsAfterPull) { if (branchHeadsBeforePull.contains(headAfterPull)) { originalBranchH...
determingRemainingOriginalBranchHeads
24,971
List<HgRevisionNumber> (List<HgRevisionNumber> branchHeadsBeforePull, List<HgRevisionNumber> branchHeadsAfterPull) { List<HgRevisionNumber> pulledBranchHeads = new ArrayList<>(branchHeadsAfterPull); pulledBranchHeads.removeAll(branchHeadsBeforePull); return pulledBranchHeads; }
determinePulledBranchHeads
24,972
void (VirtualFile repo, UpdatedFiles updatedFiles, HgRevisionNumber newHead, ProgressIndicator indicator) { indicator.setText2(HgBundle.message("hg4idea.update.progress.updating.to.pulled.head")); HgRevisionNumber parentBeforeUpdate = new HgWorkingCopyRevisionsCommand(project).firstParent(repo); HgUpdateCommand updateC...
updateToPulledHead
24,973
void (final UpdatedFiles updatedFiles) { new HgConflictResolver(project, updatedFiles).resolve(repoRoot); }
resolvePossibleConflicts
24,974
Set<HgChange> () { HgStatusCommand statusCommand = new HgStatusCommand.Builder(true).unknown(false).ignored(false).build(project); return statusCommand.executeInCurrentThread(repoRoot); }
getLocalChanges
24,975
HgCommandExitCode (@NotNull VirtualFile repo, @NotNull ProgressIndicator indicator) { indicator.setText2(HgBundle.message("hg4idea.progress.pull.with.update")); HgPullCommand hgPullCommand = new HgPullCommand(project, repo); final String defaultPath = HgUtil.getRepositoryDefaultPath(project, repo); hgPullCommand.setSou...
pull
24,976
void (List<VcsException> exceptions, @Nls String possibleWarning) { if (!StringUtil.isEmptyOrSpaces(possibleWarning)) { reportWarning(exceptions, possibleWarning); } }
handlePossibleWarning
24,977
void (List<VcsException> exceptions, @Nls String warningMessage) { VcsException warningException = new VcsException(warningMessage); warningException.setIsWarning(true); exceptions.add(warningException); }
reportWarning
24,978
void (VirtualFile repo, UpdatedFiles updatedFiles, HgRevisionNumber parentBeforeUpdate, HgRevisionNumber parentAfterUpdate) { if (parentAfterUpdate == null || parentBeforeUpdate == null) { return; } if (parentAfterUpdate.equals(parentBeforeUpdate)) { // nothing to update => returning not to capture local uncommitted ch...
addUpdatedFiles
24,979
void (UpdatedFiles updatedFiles, HgChange change, String id) { updatedFiles.getGroupById(id).add(change.afterFile().getFile().getAbsolutePath(), HgVcs.VCS_NAME, null); }
addToGroup
24,980
void (UpdatedFiles updatedFiles) { }
fillGroups
24,981
UpdateSession (FilePath @NotNull [] contentRoots, UpdatedFiles updatedFiles, ProgressIndicator indicator, @NotNull Ref<SequentialUpdatesContext> context) { List<VcsException> exceptions = new LinkedList<>(); boolean result = true; for (FilePath contentRoot : contentRoots) { if (indicator != null) { indicator.checkCance...
updateDirectories
24,982
Configurable (Collection<FilePath> contentRoots) { HgUpdateConfigurationSettings updateConfiguration = project.getService(HgUpdateConfigurationSettings.class); return new UpdateConfigurable(updateConfiguration); }
createConfigurable
24,983
boolean (Collection<FilePath> roots) { return true; }
validateOptions
24,984
String () { return "reference.VersionControl.Mercurial.UpdateProject"; }
getHelpTopic
24,985
JComponent () { updateDialog = new HgUpdateDialog(); return updateDialog.getContentPanel(); }
createComponent
24,986
boolean () { return true; }
isModified
24,987
void () { updateDialog.applyTo(updateConfiguration); }
apply
24,988
void () { updateDialog.updateFrom(updateConfiguration); }
reset
24,989
void () { updateDialog = null; }
disposeUIResources
24,990
void (final VirtualFile repo) { final Map<HgFile, HgResolveStatusEnum> resolves = new HgResolveCommand(myProject).getListSynchronously(repo); final List<File> conflictFiles = new ArrayList<>(); for (HgFile hgFile : resolves.keySet()) { File file = hgFile.getFile(); if (resolves.get(hgFile) == HgResolveStatusEnum.UNRESO...
resolve
24,991
void (@NotNull File file, boolean unresolved) { if (updatedFiles != null) { updatedFiles.getGroupById(FileGroup.UPDATED_ID).remove(file.getAbsolutePath()); //TODO get the correct revision to pass to the UpdatedFiles updatedFiles.getGroupById(unresolved ? FileGroup.MERGED_WITH_CONFLICT_ID : FileGroup.MERGED_ID) .add(fil...
updateUpdatedFiles
24,992
boolean (final Project project, VirtualFile repo) { Map<HgFile, HgResolveStatusEnum> resolves = new HgResolveCommand(project).getListSynchronously(repo); return ContainerUtil.exists(resolves.values(), resolveStatus -> resolveStatus == HgResolveStatusEnum.UNRESOLVED); }
hasConflicts
24,993
void (boolean shouldPull) { myState.shouldPull = shouldPull; }
setShouldPull
24,994
void (@NotNull HgUpdateType updateType) { myState.updateType = updateType; }
setUpdateType
24,995
void (boolean shouldCommitAfterMerge) { myState.shouldCommitAfterMerge = shouldCommitAfterMerge; }
setShouldCommitAfterMerge
24,996
boolean () { return myState.shouldPull; }
shouldPull
24,997
HgUpdateType () { return myState.updateType; }
getUpdateType
24,998
boolean () { return myState.updateType == HgUpdateType.MERGE && myState.shouldCommitAfterMerge; }
shouldCommitAfterMerge
24,999
void (@NotNull HgUpdateConfigurationSettings.State state) { myState = state; }
loadState