Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
24,500
List<JsonPathWildcardSegment> () { return PsiTreeUtil.getChildrenOfTypeAsList(this, JsonPathWildcardSegment.class); }
getWildcardSegmentList
24,501
void (@NotNull JsonPathVisitor visitor) { visitor.visitConditionalExpression(this); }
accept
24,502
void (@NotNull PsiElementVisitor visitor) { if (visitor instanceof JsonPathVisitor) accept((JsonPathVisitor)visitor); else super.accept(visitor); }
accept
24,503
JsonPathBinaryConditionalOperator () { return findNotNullChildByClass(JsonPathBinaryConditionalOperator.class); }
getBinaryConditionalOperator
24,504
List<JsonPathExpression> () { return PsiTreeUtil.getChildrenOfTypeAsList(this, JsonPathExpression.class); }
getExpressionList
24,505
void (@NotNull JsonPathVisitor visitor) { visitor.visitPlusExpression(this); }
accept
24,506
void (@NotNull PsiElementVisitor visitor) { if (visitor instanceof JsonPathVisitor) accept((JsonPathVisitor)visitor); else super.accept(visitor); }
accept
24,507
List<JsonPathExpression> () { return PsiTreeUtil.getChildrenOfTypeAsList(this, JsonPathExpression.class); }
getExpressionList
24,508
void (@NotNull JsonPathVisitor visitor) { visitor.visitRegexLiteral(this); }
accept
24,509
void (@NotNull PsiElementVisitor visitor) { if (visitor instanceof JsonPathVisitor) accept((JsonPathVisitor)visitor); else super.accept(visitor); }
accept
24,510
void (@NotNull JsonPathVisitor visitor) { visitor.visitUnaryMinusExpression(this); }
accept
24,511
void (@NotNull PsiElementVisitor visitor) { if (visitor instanceof JsonPathVisitor) accept((JsonPathVisitor)visitor); else super.accept(visitor); }
accept
24,512
JsonPathExpression () { return findChildByClass(JsonPathExpression.class); }
getExpression
24,513
int (int ch) { return ZZ_CMAP_A[(ZZ_CMAP_Y[(ZZ_CMAP_Z[ch>>10]<<6)|((ch>>4)&0x3f)]<<4)|(ch&0xf)]; }
ZZ_CMAP
24,514
int (String packed, int offset, int [] result) { int i = 0; /* index in packed string */ int j = offset; /* index in unpacked array */ int l = packed.length(); while (i < l) { int count = packed.charAt(i++); int value = packed.charAt(i++); do result[j++] = value; while (--count > 0); } return j; }
zzUnpackAction
24,515
int (String packed, int offset, int [] result) { int i = 0; /* index in packed string */ int j = offset; /* index in unpacked array */ int l = packed.length(); while (i < l) { int high = packed.charAt(i++) << 16; result[j++] = high | packed.charAt(i++); } return j; }
zzUnpackRowMap
24,516
int (String packed, int offset, int [] result) { int i = 0; /* index in packed string */ int j = offset; /* index in unpacked array */ int l = packed.length(); while (i < l) { int count = packed.charAt(i++); int value = packed.charAt(i++); value--; do result[j++] = value; while (--count > 0); } return j; }
zzUnpackTrans
24,517
int (String packed, int offset, int [] result) { int i = 0; /* index in packed string */ int j = offset; /* index in unpacked array */ int l = packed.length(); while (i < l) { int count = packed.charAt(i++); int value = packed.charAt(i++); do result[j++] = value; while (--count > 0); } return j; }
zzUnpackAttribute
24,518
void () { myStateStack.clear(); }
resetInternal
24,519
void (int newState) { myStateStack.add(yystate()); yybegin(newState); }
pushState
24,520
void () { if (myStateStack.isEmpty()) return; int state = myStateStack.removeInt(myStateStack.size() - 1); yybegin(state); }
popState
24,521
int () { return zzStartRead; }
getTokenStart
24,522
int () { return getTokenStart() + yylength(); }
getTokenEnd
24,523
void (CharSequence buffer, int start, int end, int initialState) { zzBuffer = buffer; zzCurrentPos = zzMarkedPos = zzStartRead = start; zzAtEOF = false; zzAtBOL = true; zzEndRead = end; yybegin(initialState); }
reset
24,524
int () { return zzLexicalState; }
yystate
24,525
void (int newState) { zzLexicalState = newState; }
yybegin
24,526
CharSequence () { return zzBuffer.subSequence(zzStartRead, zzMarkedPos); }
yytext
24,527
char (int pos) { return zzBuffer.charAt(zzStartRead+pos); }
yycharat
24,528
int () { return zzMarkedPos-zzStartRead; }
yylength
24,529
void (int errorCode) { String message; try { message = ZZ_ERROR_MSG[errorCode]; } catch (ArrayIndexOutOfBoundsException e) { message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; } throw new Error(message); }
zzScanError
24,530
void (int number) { if ( number > yylength() ) zzScanError(ZZ_PUSHBACK_2BIG); zzMarkedPos -= number; }
yypushback
24,531
void () { if (!zzEOFDone) { zzEOFDone = true; resetInternal(); } }
zzDoEOF
24,532
void () { }
dispose
24,533
HgDisposable (Project project) { return project.getService(HgDisposable.class); }
getInstance
24,534
HgGlobalSettings () { return ApplicationManager.getApplication().getService(HgGlobalSettings.class); }
getInstance
24,535
State () { return myState; }
getState
24,536
void (@NotNull State state) { myState = state; }
loadState
24,537
void (@Nullable String stringUrl, @Nullable String username) { if (StringUtil.isEmptyOrSpaces(stringUrl)) { return; } if (username == null) { username = ""; } myState.myRememberedUserNames.put(stringUrl, username); }
addRememberedUrl
24,538
void (@Nullable String hgExecutable) { myState.myHgExecutable = hgExecutable; }
setHgExecutable
24,539
int () { return FIVE_MINUTES; }
getIncomingCheckIntervalSeconds
24,540
HgVFSListener (@NotNull HgVcs vcs) { HgVFSListener listener = new HgVFSListener(vcs); listener.installListeners(); return listener; }
createInstance
24,541
String () { return HgBundle.message("hg4idea.add.title"); }
getAddTitle
24,542
String () { return HgBundle.message("hg4idea.add.single.title"); }
getSingleFileAddTitle
24,543
String () { return HgBundle.message("hg4idea.add.body"); }
getSingleFileAddPromptTemplate
24,544
void (final @NotNull List<VirtualFile> addedFiles, final @NotNull Map<VirtualFile, VirtualFile> copyFromMap) { saveUnsavedVcsIgnoreFiles(); // if a file is copied from another repository, then 'hg add' should be used instead of 'hg copy'. // Thus here we remove such files from the copyFromMap. for (Iterator<Map.Entry<VirtualFile, VirtualFile>> it = copyFromMap.entrySet().iterator(); it.hasNext(); ) { final Map.Entry<VirtualFile, VirtualFile> entry = it.next(); final VirtualFile rootFrom = HgUtil.getHgRootOrNull(myProject, entry.getKey()); final VirtualFile rootTo = HgUtil.getHgRootOrNull(myProject, entry.getValue()); if (rootTo == null || !rootTo.equals(rootFrom)) { it.remove(); } } // exclude files which are added to a directory which is not version controlled for (Iterator<VirtualFile> it = addedFiles.iterator(); it.hasNext(); ) { if (HgUtil.getHgRootOrNull(myProject, it.next()) == null) { it.remove(); } } // exclude files which are ignored in .hgignore in background and execute adding after that final Map<VirtualFile, Collection<VirtualFile>> sortedFiles = HgUtil.sortByHgRoots(myProject, addedFiles); final HashSet<VirtualFile> untrackedFiles = new HashSet<>(); new Task.Backgroundable(myProject, HgBundle.message("hg4idea.progress.checking.ignored"), false) { @Override public void run(@NotNull ProgressIndicator pi) { for (Map.Entry<VirtualFile, Collection<VirtualFile>> e : sortedFiles.entrySet()) { VirtualFile repo = e.getKey(); final Collection<VirtualFile> files = e.getValue(); pi.setText(repo.getPresentableUrl()); Collection<VirtualFile> untrackedForRepo = new HgStatusCommand.Builder(false).unknown(true).removed(true).build(myProject) .getFiles(repo, new ArrayList<>(files)); untrackedFiles.addAll(untrackedForRepo); } addedFiles.retainAll(untrackedFiles); // select files to add if there is something to select if (!addedFiles.isEmpty() || !copyFromMap.isEmpty()) { performAddingWithConfirmation(addedFiles, copyFromMap); } } }.queue(); }
executeAdd
24,545
void (@NotNull ProgressIndicator pi) { for (Map.Entry<VirtualFile, Collection<VirtualFile>> e : sortedFiles.entrySet()) { VirtualFile repo = e.getKey(); final Collection<VirtualFile> files = e.getValue(); pi.setText(repo.getPresentableUrl()); Collection<VirtualFile> untrackedForRepo = new HgStatusCommand.Builder(false).unknown(true).removed(true).build(myProject) .getFiles(repo, new ArrayList<>(files)); untrackedFiles.addAll(untrackedForRepo); } addedFiles.retainAll(untrackedFiles); // select files to add if there is something to select if (!addedFiles.isEmpty() || !copyFromMap.isEmpty()) { performAddingWithConfirmation(addedFiles, copyFromMap); } }
run
24,546
void (final @NotNull Collection<VirtualFile> addedFiles, final @NotNull Map<VirtualFile, VirtualFile> copiedFilesFrom) { Map<VirtualFile, VirtualFile> copyFromMap = new HashMap<>(copiedFilesFrom); (new Task.Backgroundable(myProject, HgBundle.message("hg4idea.add.progress"), false) { @Override public void run(@NotNull ProgressIndicator aProgressIndicator) { final ArrayList<VirtualFile> adds = new ArrayList<>(); final HashMap<VirtualFile, VirtualFile> copies = new HashMap<>(); // from -> to //delete unversioned and ignored files from copy source LOG.assertTrue(myProject != null, "Project is null"); Collection<VirtualFile> unversionedAndIgnoredFiles = new ArrayList<>(); final Map<VirtualFile, Collection<VirtualFile>> sortedSourceFilesByRepos = HgUtil.sortByHgRoots(myProject, copyFromMap.values()); HgStatusCommand statusCommand = new HgStatusCommand.Builder(false).unknown(true).ignored(true).build(myProject); for (Map.Entry<VirtualFile, Collection<VirtualFile>> entry : sortedSourceFilesByRepos.entrySet()) { Set<HgChange> changes = statusCommand.executeInCurrentThread(entry.getKey(), ContainerUtil.map(entry.getValue(), virtualFile -> VcsUtil.getFilePath(virtualFile))); for (HgChange change : changes) { unversionedAndIgnoredFiles.add(change.afterFile().toFilePath().getVirtualFile()); } } copyFromMap.values().removeAll(unversionedAndIgnoredFiles); // separate adds from copies for (VirtualFile file : addedFiles) { final VirtualFile copyFrom = copyFromMap.get(file); if (copyFrom != null) { copies.put(copyFrom, file); } else { adds.add(file); } } // add for all files at once if (!adds.isEmpty()) { new HgAddCommand(myProject).executeInCurrentThread(adds); } // copy needs to be run for each file separately if (!copies.isEmpty()) { for (Map.Entry<VirtualFile, VirtualFile> copy : copies.entrySet()) { new HgCopyCommand(myProject).executeInCurrentThread(copy.getKey(), copy.getValue()); } } for (VirtualFile file : addedFiles) { if (file.isDirectory()) { dirtyScopeManager.dirDirtyRecursively(file); } else { dirtyScopeManager.fileDirty(file); } } } }).queue(); }
performAdding
24,547
void (@NotNull ProgressIndicator aProgressIndicator) { final ArrayList<VirtualFile> adds = new ArrayList<>(); final HashMap<VirtualFile, VirtualFile> copies = new HashMap<>(); // from -> to //delete unversioned and ignored files from copy source LOG.assertTrue(myProject != null, "Project is null"); Collection<VirtualFile> unversionedAndIgnoredFiles = new ArrayList<>(); final Map<VirtualFile, Collection<VirtualFile>> sortedSourceFilesByRepos = HgUtil.sortByHgRoots(myProject, copyFromMap.values()); HgStatusCommand statusCommand = new HgStatusCommand.Builder(false).unknown(true).ignored(true).build(myProject); for (Map.Entry<VirtualFile, Collection<VirtualFile>> entry : sortedSourceFilesByRepos.entrySet()) { Set<HgChange> changes = statusCommand.executeInCurrentThread(entry.getKey(), ContainerUtil.map(entry.getValue(), virtualFile -> VcsUtil.getFilePath(virtualFile))); for (HgChange change : changes) { unversionedAndIgnoredFiles.add(change.afterFile().toFilePath().getVirtualFile()); } } copyFromMap.values().removeAll(unversionedAndIgnoredFiles); // separate adds from copies for (VirtualFile file : addedFiles) { final VirtualFile copyFrom = copyFromMap.get(file); if (copyFrom != null) { copies.put(copyFrom, file); } else { adds.add(file); } } // add for all files at once if (!adds.isEmpty()) { new HgAddCommand(myProject).executeInCurrentThread(adds); } // copy needs to be run for each file separately if (!copies.isEmpty()) { for (Map.Entry<VirtualFile, VirtualFile> copy : copies.entrySet()) { new HgCopyCommand(myProject).executeInCurrentThread(copy.getKey(), copy.getValue()); } } for (VirtualFile file : addedFiles) { if (file.isDirectory()) { dirtyScopeManager.dirDirtyRecursively(file); } else { dirtyScopeManager.fileDirty(file); } } }
run
24,548
String () { return HgBundle.message("hg4idea.remove.multiple.title"); }
getDeleteTitle
24,549
String () { return HgBundle.message("hg4idea.remove.single.title"); }
getSingleFileDeleteTitle
24,550
String () { return HgBundle.message("hg4idea.remove.single.body"); }
getSingleFileDeletePromptTemplate
24,551
boolean (@NotNull FileStatus status) { return status == FileStatus.UNKNOWN; }
shouldIgnoreDeletion
24,552
void () { List<FilePath> filesToConfirmDeletion = myProcessor.acquireDeletedFiles(); // skip files which are not under Mercurial skipNotUnderHg(filesToConfirmDeletion); skipVcsIgnored(filesToConfirmDeletion); List<FilePath> filesToDelete = new ArrayList<>(); // newly added files (which were added to the repo but never committed) should be removed from the VCS, // but without user confirmation. for (Iterator<FilePath> it = filesToConfirmDeletion.iterator(); it.hasNext(); ) { FilePath filePath = it.next(); Change fileChange = ChangeListManager.getInstance(myProject).getChange(filePath); if (fileChange != null && fileChange.getFileStatus().equals(FileStatus.ADDED)) { filesToDelete.add(filePath); it.remove(); } } new Task.Backgroundable(myProject, HgBundle.message("hg4idea.remove.progress"), false) { @Override public void run(@NotNull ProgressIndicator indicator) { // confirm removal from the VCS if needed if (myRemoveOption.getValue() != VcsShowConfirmationOption.Value.DO_NOTHING_SILENTLY) { if (myRemoveOption.getValue() == VcsShowConfirmationOption.Value.DO_ACTION_SILENTLY || filesToConfirmDeletion.isEmpty()) { filesToDelete.addAll(filesToConfirmDeletion); } else { final AtomicReference<Collection<FilePath>> filePaths = new AtomicReference<>(); ApplicationManager.getApplication().invokeAndWait(() -> filePaths.set(selectFilePathsToDelete(filesToConfirmDeletion))); if (filePaths.get() != null) { filesToDelete.addAll(filePaths.get()); } } } if (!filesToDelete.isEmpty()) { performDeletion(filesToDelete); } } }.queue(); }
executeDelete
24,553
void (@NotNull ProgressIndicator indicator) { // confirm removal from the VCS if needed if (myRemoveOption.getValue() != VcsShowConfirmationOption.Value.DO_NOTHING_SILENTLY) { if (myRemoveOption.getValue() == VcsShowConfirmationOption.Value.DO_ACTION_SILENTLY || filesToConfirmDeletion.isEmpty()) { filesToDelete.addAll(filesToConfirmDeletion); } else { final AtomicReference<Collection<FilePath>> filePaths = new AtomicReference<>(); ApplicationManager.getApplication().invokeAndWait(() -> filePaths.set(selectFilePathsToDelete(filesToConfirmDeletion))); if (filePaths.get() != null) { filesToDelete.addAll(filePaths.get()); } } } if (!filesToDelete.isEmpty()) { performDeletion(filesToDelete); } }
run
24,554
void (@NotNull List<FilePath> filePaths) { Map<VirtualFile, Collection<FilePath>> groupFilePathsByHgRoots = HgUtil.groupFilePathsByHgRoots(myProject, filePaths); List<FilePath> ignored = groupFilePathsByHgRoots.entrySet().stream() .map(entry -> getIgnoreRepoHolder(entry.getKey()).removeIgnoredFiles(entry.getValue())) .flatMap(Collection::stream).toList(); filePaths.removeAll(ignored); }
skipVcsIgnored
24,555
void (Collection<FilePath> filesToFilter) { for (Iterator<FilePath> iter = filesToFilter.iterator(); iter.hasNext(); ) { final FilePath filePath = iter.next(); if (HgUtil.getHgRootOrNull(myProject, filePath) == null) { iter.remove(); } } }
skipNotUnderHg
24,556
void (final @NotNull List<FilePath> filesToDelete) { List<HgFile> deletes = new ArrayList<>(); for (FilePath file : filesToDelete) { VirtualFile root = VcsUtil.getVcsRootFor(myProject, file); if (root != null) { deletes.add(new HgFile(root, file)); } } if (!deletes.isEmpty()) { new HgRemoveCommand(myProject).executeInCurrentThread(deletes); } for (HgFile file : deletes) { dirtyScopeManager.fileDirty(file.toFilePath()); } }
performDeletion
24,557
void (@NotNull List<MovedFileInfo> movedFiles) { final List<MovedFileInfo> failedToMove = new ArrayList<>(); (new VcsBackgroundTask<>(myProject, HgBundle.message("hg4idea.move.progress"), movedFiles) { @Override public void onFinished() { if (!failedToMove.isEmpty()) { handleRenameError(); } } private void handleRenameError() { NotificationAction viewFilesAction = NotificationAction.createSimple(VcsBundle.messagePointer("action.NotificationAction.VFSListener.text.view.files"), () -> { List<FilePath> filePaths = ContainerUtil.map(failedToMove, movedInfo -> movedInfo.getOldPath()); DialogWrapper dialog = new ProcessedFilePathsDialog(myProject, filePaths); dialog.setTitle(HgBundle.message("hg4idea.rename.error.title")); dialog.show(); }); NotificationAction retryAction = NotificationAction.createSimpleExpiring(HgBundle.message("retry"), () -> performMoveRename(failedToMove)); VcsNotifier.getInstance(myProject) .notifyError(RENAME_FAILED, HgBundle.message("hg4idea.rename.error"), HgBundle.message("hg4idea.rename.error.msg"), viewFilesAction, retryAction); } @Override protected void process(final MovedFileInfo file) { final FilePath source = file.getOldPath(); final FilePath target = file.getNewPath(); VirtualFile sourceRoot = VcsUtil.getVcsRootFor(myProject, source); VirtualFile targetRoot = VcsUtil.getVcsRootFor(myProject, target); if (sourceRoot != null && sourceRoot.equals(targetRoot)) { HgCommandResult result; int attempt = 0; do { result = new HgMoveCommand(myProject).execute(sourceRoot, source, target); } while (HgErrorUtil.isWLockError(result) && attempt++ < 2); if (!HgErrorUtil.hasErrorsInCommandExecution(result)) { dirtyScopeManager.fileDirty(source); dirtyScopeManager.fileDirty(target); } else { failedToMove.add(file); LOG.warn("Hg rename failed:" + result.getRawError()); } } } }).queue(); }
performMoveRename
24,558
void () { if (!failedToMove.isEmpty()) { handleRenameError(); } }
onFinished
24,559
void () { NotificationAction viewFilesAction = NotificationAction.createSimple(VcsBundle.messagePointer("action.NotificationAction.VFSListener.text.view.files"), () -> { List<FilePath> filePaths = ContainerUtil.map(failedToMove, movedInfo -> movedInfo.getOldPath()); DialogWrapper dialog = new ProcessedFilePathsDialog(myProject, filePaths); dialog.setTitle(HgBundle.message("hg4idea.rename.error.title")); dialog.show(); }); NotificationAction retryAction = NotificationAction.createSimpleExpiring(HgBundle.message("retry"), () -> performMoveRename(failedToMove)); VcsNotifier.getInstance(myProject) .notifyError(RENAME_FAILED, HgBundle.message("hg4idea.rename.error"), HgBundle.message("hg4idea.rename.error.msg"), viewFilesAction, retryAction); }
handleRenameError
24,560
void (final MovedFileInfo file) { final FilePath source = file.getOldPath(); final FilePath target = file.getNewPath(); VirtualFile sourceRoot = VcsUtil.getVcsRootFor(myProject, source); VirtualFile targetRoot = VcsUtil.getVcsRootFor(myProject, target); if (sourceRoot != null && sourceRoot.equals(targetRoot)) { HgCommandResult result; int attempt = 0; do { result = new HgMoveCommand(myProject).execute(sourceRoot, source, target); } while (HgErrorUtil.isWLockError(result) && attempt++ < 2); if (!HgErrorUtil.hasErrorsInCommandExecution(result)) { dirtyScopeManager.fileDirty(source); dirtyScopeManager.fileDirty(target); } else { failedToMove.add(file); LOG.warn("Hg rename failed:" + result.getRawError()); } } }
process
24,561
boolean () { return true; }
isRecursiveDeleteSupported
24,562
VirtualFile () { return vcsRoot; }
getRepo
24,563
File () { return file; }
getFile
24,564
FilePath () { return VcsUtil.getFilePath(file); }
toFilePath
24,565
boolean (Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } HgFile that = (HgFile)o; if (!vcsRoot.equals(that.vcsRoot)) { return false; } if (file != null ? !FileUtil.filesEqual(file, that.file) : that.file != null) { return false; } return true; }
equals
24,566
int () { return Objects.hash(vcsRoot, file); }
hashCode
24,567
HgRevisionNumber () { return myRevisionNumber; }
getRevisionNumber
24,568
String () { return myBranchName; }
getBranchName
24,569
Date () { return myRevisionDate; }
getRevisionDate
24,570
Set<String> () { return myFilesModified; }
getModifiedFiles
24,571
Set<String> () { return myFilesAdded; }
getAddedFiles
24,572
Set<String> () { return myFilesDeleted; }
getDeletedFiles
24,573
boolean (Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } HgFileRevision revision = (HgFileRevision)o; if (!myFile.equals(revision.myFile)) { return false; } if (!myRevisionNumber.equals(revision.myRevisionNumber)) { return false; } return true; }
equals
24,574
int () { return Objects.hash(myFile, myRevisionNumber); }
hashCode
24,575
HgFile () { return beforeFile; }
beforeFile
24,576
HgFile () { return afterFile; }
afterFile
24,577
HgFileStatusEnum () { return status; }
getStatus
24,578
void (@NotNull HgFile beforeFile) { this.beforeFile = beforeFile; }
setBeforeFile
24,579
void (@NotNull HgFile afterFile) { this.afterFile = afterFile; }
setAfterFile
24,580
void (@NotNull HgFileStatusEnum status) { this.status = status; }
setStatus
24,581
boolean (Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } HgChange change = (HgChange)o; if (!afterFile.equals(change.afterFile)) { return false; } if (!beforeFile.equals(change.beforeFile)) { return false; } if (status != change.status) { return false; } return true; }
equals
24,582
int () { return Objects.hash(beforeFile, afterFile, status); }
hashCode
24,583
HgExecutableManager () { return ApplicationManager.getApplication().getService(HgExecutableManager.class); }
getInstance
24,584
String () { String path = HgGlobalSettings.getInstance().getHgExecutable(); return path == null ? getDefaultExecutable() : path; }
getHgExecutable
24,585
String (@NotNull Project project) { HgProjectSettings projectSettings = HgProjectSettings.getInstance(project); if (!projectSettings.isHgExecutableOverridden()) return getHgExecutable(); String path = projectSettings.getHgExecutable(); return path == null ? getDefaultExecutable() : path; }
getHgExecutable
24,586
String () { return myDetectedExecutable.getValue(); }
getDefaultExecutable
24,587
String () { File hgExecutableFromPath = PathEnvironmentVariableUtil.findInPath(SystemInfo.isWindows ? DEFAULT_WINDOWS_HG : DEFAULT_UNIX_HG, PathEnvironmentVariableUtil.getPathVariableValue(), null); if (hgExecutableFromPath != null) { return hgExecutableFromPath.getPath(); } String[] paths; String programName; if (SystemInfo.isWindows) { programName = DEFAULT_WINDOWS_HG; paths = DEFAULT_WINDOWS_PATHS; } else { programName = DEFAULT_UNIX_HG; paths = DEFAULT_UNIX_PATHS; } for (String p : paths) { Path programPath = Paths.get(p, programName); if (Files.isExecutable(programPath)) { return programPath.toAbsolutePath().toString(); } } // otherwise, take the first variant and hope it's in $PATH return programName; }
identifyDefaultHgExecutable
24,588
void (@NotNull String taskName, @NotNull List<? extends HgRepository> repos, @Nullable Runnable callInAwtLater) { HgUpdateCommand.updateTo( !HgBranchUtil.getCommonBookmarks(repos).contains(taskName) ? "head() and not bookmark() and branch(\"" + taskName + "\")" : taskName, repos, callInAwtLater); }
checkout
24,589
void (@NotNull String name, @NotNull List<? extends HgRepository> repositories) { HgBookmarkCommand.createBookmarkAsynchronously(repositories, name, true); }
checkoutAsNewBranch
24,590
String (HgRepository repository) { String bookmark = repository.getCurrentBookmark(); return bookmark == null ? repository.getCurrentBranch() : bookmark; }
getActiveBranch
24,591
Iterable<TaskInfo> (@NotNull HgRepository repository) { //be careful with equality names of branches/bookmarks =( Iterable<String> names = ContainerUtil.concat(HgUtil.getSortedNamesWithoutHashes(repository.getBookmarks()), repository.getOpenedBranches()); return ContainerUtil.map(names, s -> new TaskInfo(s, Collections.singleton(repository.getPresentableUrl()))); }
getAllBranches
24,592
void (final @NotNull String branch, final @NotNull List<? extends HgRepository> repositories) { String bookmarkRevisionArg = "bookmark(\"" + branch + "\")"; FileDocumentManager.getInstance().saveAllDocuments(); final UpdatedFiles updatedFiles = UpdatedFiles.create(); for (final HgRepository repository : repositories) { HgMergeCommand.mergeWith(repository, bookmarkRevisionArg, updatedFiles, () -> { Project project = repository.getProject(); VirtualFile repositoryRoot = repository.getRoot(); try { new HgCommitCommand(project, repository, "Automated merge with " + branch).executeInCurrentThread(); //NON-NLS HgBookmarkCommand.deleteBookmarkSynchronously(project, repositoryRoot, branch); } catch (HgCommandException e) { HgErrorUtil.handleException(project, MERGE_ERROR, e); } catch (VcsException e) { VcsNotifier.getInstance(project) .notifyError(EXCEPTION_DURING_MERGE_COMMIT, HgBundle.message("hg4idea.commit.merge.error", branch), e.getMessage()); } }); } }
mergeAndClose
24,593
boolean (@NotNull HgRepository repository, @NotNull TaskInfo name) { return HgUtil.getNamesWithoutHashes(repository.getBookmarks()).contains(name.getName()) || repository.getOpenedBranches().contains(name.getName()); }
hasBranch
24,594
boolean (@NotNull String branchName) { return myNameValidator.checkInput(branchName); }
isBranchNameValid
24,595
String (@NotNull String suggestedName) { return myNameValidator.cleanUpBranchName(suggestedName); }
cleanUpBranchName
24,596
String () { return HgExecutableManager.getInstance().getHgExecutable(myProject); }
getCurrentExecutable
24,597
String () { return HgBundle.message("hg4idea.mercurial"); }
getConfigurableDisplayName
24,598
boolean (@NotNull String executable) { return HgUtil.isExecutableValid(myProject, executable); }
isExecutableValid
24,599
HgContentRevision (Project project, @NotNull HgFile hgFile, @NotNull HgRevisionNumber revisionNumber) { return !hgFile.toFilePath().getFileType().isBinary() ? new HgContentRevision(project, hgFile, revisionNumber) : new HgBinaryContentRevision(project, hgFile, revisionNumber); }
create