Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
24,700
boolean (final Object obj) { if (!(obj instanceof HgVersion)) { return false; } return compareTo((HgVersion)obj) == 0; }
equals
24,701
int () { return Objects.hash(myMajor, myMiddle, myMinor); }
hashCode
24,702
int (@NotNull HgVersion o) { int d = myMajor - o.myMajor; if (d != 0) { return d; } d = myMiddle - o.myMiddle; if (d != 0) { return d; } return myMinor - o.myMinor; }
compareTo
24,703
String () { return myMajor + "." + myMiddle + "." + myMinor; }
toString
24,704
Charset (@NotNull Project project) { if (HGENCODING != null && HGENCODING.length() > 0 && Charset.isSupported(HGENCODING)) { return Charset.forName(HGENCODING); } Charset defaultCharset = null; if (!project.isDisposed()) { defaultCharset = EncodingProjectManager.getInstance(project).getDefaultCharset(); } return defaul...
getDefaultCharset
24,705
String (@NotNull Charset charset) { //workaround for x_MacRoman encoding etc; todo: create map with encoding aliases because some encodings name are not supported by hg String name = charset.name(); if (name.startsWith("x-M")) { //NON-NLS return name.substring(2); // without "x-" prefix; } return name; }
getNameFor
24,706
boolean (@NotNull HgCommandResult result) { return result.getExitValue() == 255 || result.getRawError().contains("** unknown exception encountered"); //NON-NLS }
fatalErrorOccurred
24,707
boolean (@Nullable HgCommandResult result) { return result == null || getAbortLine(result) != null; }
isAbort
24,708
boolean (@Nullable HgCommandResult result) { if (result == null) return false; String errorLine = getAbortLine(result); return errorLine != null && StringUtil.contains(errorLine, MERGE_WITH_ANCESTOR_ERROR); }
isAncestorMergeError
24,709
boolean (@Nullable HgCommandResult result) { if (result == null) return false; return ContainerUtil.exists(result.getOutputLines(), s -> StringUtil.contains(s, NOTHING_TO_REBASE_WARNING)); }
isNothingToRebase
24,710
boolean (@Nullable HgCommandResult result) { if (result == null) { return false; } String line = getLastErrorLine(result); return isAuthorizationError(line); }
isAuthorizationError
24,711
boolean (@Nullable HgCommandResult result) { return isAbort(result) || result.getExitValue() != 0; }
hasErrorsInCommandExecution
24,712
boolean (@Nullable HgCommandResult result) { return isAbort(result) || result.getExitValue() > 1; }
isCommandExecutionFailed
24,713
boolean (@Nullable String destinationPath) { if (StringUtil.isEmptyOrSpaces(destinationPath)) { return false; } return HgUtil.URL_WITH_PASSWORD.matcher(destinationPath).matches(); }
hasAuthorizationInDestinationPath
24,714
boolean (@NotNull List<String> errorLines) { if (errorLines.isEmpty()) { return false; } String line = errorLines.get(0); return !StringUtil.isEmptyOrSpaces(line) && (line.contains("abort") && line.contains("unknown encoding")); //NON-NLS }
isUnknownEncodingError
24,715
boolean (@Nullable HgCommandResult result) { if (result == null) { return false; } // error messages from mercurial after update command failed: "abort: outstanding uncommitted merges", "abort: uncommitted changes"; //after revert command failed: abort: "uncommitted merge" final Pattern UNCOMMITTED_PATTERN = Pattern.co...
hasUncommittedChangesConflict
24,716
boolean (String line) { return !StringUtil.isEmptyOrSpaces(line) && (line.contains("authorization required") || line.contains("authorization failed")); //NON-NLS }
isAuthorizationError
24,717
boolean (String line) { return !StringUtil.isEmptyOrSpaces(line) && line.trim().startsWith("abort:"); //NON-NLS }
isAbortLine
24,718
void (@Nullable Project project, @NonNls @Nullable String notificationDisplayId, @NotNull Exception e) { handleException(project, notificationDisplayId, CommonBundle.message("title.error"), e); }
handleException
24,719
void (@Nullable Project project, @NonNls @Nullable String notificationDisplayId, @NotificationTitle @NotNull String title, @NotNull Exception e) { LOG.info(e); new HgCommandResultNotifier(project).notifyError(notificationDisplayId, null, title, e.getMessage()); }
handleException
24,720
boolean (@Nullable HgCommandResult result) { //abort: working directory of repo_name: timed out waiting for lock held by 'process:id' // or //waiting for lock on working directory of repo_name if (result == null) return false; return isAbort(result) && result.getRawError().contains("waiting for lock"); //NON-NLS }
isWLockError
24,721
HgReferenceValidator () { return INSTANCE; }
getInstance
24,722
boolean (String inputString) { if (StringUtil.isEmptyOrSpaces(inputString)) { return false; } if (containsIllegalSymbols(inputString)) return false; return !isReservedWord(inputString) && !onlyDigits(inputString) && !hasConflictsWithAnotherNames(inputString); }
checkInput
24,723
boolean (@Nullable String inputString) { if (inputString != null && ILLEGAL.matcher(inputString).find()) { myErrorText = HgBundle.message("hg4idea.validation.name.no.colons"); return true; } return false; }
containsIllegalSymbols
24,724
boolean (@Nullable String inputString) { if (inputString != null && DIGITS_ILLEGAL.matcher(inputString).matches()) { myErrorText = HgBundle.message("hg4idea.validation.name.invalid"); return true; } return false; }
onlyDigits
24,725
boolean (@Nullable String name) { return checkInput(name); }
canClose
24,726
boolean (@Nullable String name) { myErrorText = TIP_REFERENCE.equals(name) ? HgBundle.message("hg4idea.validation.name.reserved", name) : null; return myErrorText != null; }
isReservedWord
24,727
boolean (@Nullable String name) { return false; }
hasConflictsWithAnotherNames
24,728
String (@NotNull String branchName) { if (onlyDigits(branchName)) return branchName + "_"; return branchName.replaceAll(ILLEGAL.pattern(), "_").replaceAll("\"", ""); }
cleanUpBranchName
24,729
boolean (@Nullable String name) { Collection<String> branches = myRepository.getBranches().keySet(); String currentBranch = myRepository.getCurrentBranch(); // branches set doesn't contain uncommitted branch -> need an addition check myErrorText = currentBranch.equals(name) || branches.contains(name) ? HgBundle.message...
hasConflictsWithAnotherNames
24,730
boolean (@NotNull VirtualFile file) { return file.findChild(HgUtil.DOT_HG) != null; }
isRoot
24,731
boolean (@NotNull VirtualFile file) { return Files.exists(file.toNioPath().resolve(HgUtil.DOT_HG)); }
validateRoot
24,732
VcsKey () { return HgVcs.getKey(); }
getSupportedVcs
24,733
boolean (@NotNull String dirName) { return dirName.equalsIgnoreCase(HgUtil.DOT_HG); }
isVcsDir
24,734
boolean (final @NotNull VirtualFile directory) { if (HgInit.createRepository(myProject, directory)) { refreshVcsDir(directory, HgUtil.DOT_HG); return true; } return false; }
initOrNotifyError
24,735
List<String> (HgRevisionNumber vcsRevisionNumber, String fileName) { final List<String> arguments = new LinkedList<>(); if (vcsRevisionNumber != null) { arguments.add("--rev"); if (!StringUtil.isEmptyOrSpaces(vcsRevisionNumber.getChangeset())) { arguments.add(vcsRevisionNumber.getChangeset()); } else { arguments.add(vc...
createArguments
24,736
void (HgFile @NotNull ... hgFiles) { executeInCurrentThread(Arrays.asList(hgFiles)); }
executeInCurrentThread
24,737
void (@NotNull Collection<HgFile> hgFiles) { for( Map.Entry<VirtualFile, List<String>> entry : HgUtil.getRelativePathsByRepository(hgFiles).entrySet()) { List<String> filePaths = entry.getValue(); for (List<String> chunkFiles : VcsFileUtil.chunkArguments(filePaths)) { List<String> parameters = new LinkedList<>(); param...
executeInCurrentThread
24,738
void (@NotNull Collection<? extends VirtualFile> files) { executeInCurrentThread(files, null); }
executeInCurrentThread
24,739
void (final Collection<? extends VirtualFile> files) { if (files.size() >= HgUtil.MANY_FILES) { new Task.Backgroundable(myProject, HgBundle.message("hg4idea.add.progress"), true) { @Override public void run(@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(false); executeInCurrentThread(files, indicato...
addWithProgress
24,740
void (@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(false); executeInCurrentThread(files, indicator); }
run
24,741
void (@NotNull Collection<? extends VirtualFile> files, @Nullable ProgressIndicator indicator) { final Map<VirtualFile, Collection<VirtualFile>> sorted = HgUtil.sortByHgRoots(myProject, files); for (Map.Entry<VirtualFile, Collection<VirtualFile>> entry : sorted.entrySet()) { if (indicator != null) { if (indicator.isCan...
executeInCurrentThread
24,742
void (VirtualFile repo, Collection<? extends VirtualFile> files, @Nullable ProgressIndicator indicator) { final List<List<String>> chunks = VcsFileUtil.chunkFiles(repo, files); int currentChunk = 0; for (List<String> paths : chunks) { if (indicator != null) { if (indicator.isCanceled()) return; indicator.setFraction((d...
addFilesSynchronously
24,743
void (@NonNls String revision) { this.revision = revision; }
setRevision
24,744
void (boolean clean) { this.clean = clean; }
setClean
24,745
int (final @NotNull Project project, @NotNull @NlsContexts.DialogTitle String confirmationMessage) { final AtomicInteger exitCode = new AtomicInteger(); UIUtil.invokeAndWaitIfNeeded(() -> { exitCode.set(Messages.showOkCancelDialog(project, confirmationMessage, HgBundle.message("hg4idea.update.uncommitted.problem"), HgB...
showDiscardChangesConfirmation
24,746
void (final @NotNull @NonNls String targetRevision, @NotNull List<? extends HgRepository> repos, final @Nullable Runnable callInAwtLater) { FileDocumentManager.getInstance().saveAllDocuments(); for (HgRepository repo : repos) { final VirtualFile repository = repo.getRoot(); Project project = repo.getProject(); updateRe...
updateTo
24,747
void (final @NotNull Project project, final @NotNull VirtualFile repository, final @NotNull @NonNls String targetRevision, final @Nullable Runnable callInAwtLater) { updateRepoTo(project, repository, targetRevision, false, callInAwtLater); }
updateRepoTo
24,748
void (final @NotNull Project project, final @NotNull VirtualFile repository, final @NotNull @NonNls String targetRevision, final boolean clean, final @Nullable Runnable callInAwtLater) { new Task.Backgroundable(project, HgBundle.message("action.hg4idea.updateTo.description")) { @Override public void onSuccess() { if (c...
updateRepoTo
24,749
void () { if (callInAwtLater != null) { callInAwtLater.run(); } }
onSuccess
24,750
void (@NotNull ProgressIndicator indicator) { updateRepoToInCurrentThread(project, repository, targetRevision, clean); }
run
24,751
boolean (final @NotNull Project project, final @NotNull VirtualFile repository, final @NotNull @NonNls String targetRevision, final boolean clean) { final HgUpdateCommand hgUpdateCommand = new HgUpdateCommand(project, repository); hgUpdateCommand.setRevision(targetRevision); hgUpdateCommand.setClean(clean); HgCommandRe...
updateRepoToInCurrentThread
24,752
List<HgAnnotationLine> (@NotNull HgFile hgFile, @Nullable HgRevisionNumber revision) { final List<String> arguments = new ArrayList<>(); arguments.add("-cvnudl"); HgVcs vcs = HgVcs.getInstance(myProject); if (vcs != null && vcs.getProjectSettings().isWhitespacesIgnoredInAnnotations() && vcs.getVersion().isIgnoreWhitesp...
execute
24,753
List<HgAnnotationLine> (List<String> outputLines) { List<HgAnnotationLine> annotations = new ArrayList<>(outputLines.size()); for (String line : outputLines) { Matcher matcher = LINE_PATTERN.matcher(line); if (matcher.matches()) { String user = matcher.group(USER_GROUP).trim(); HgRevisionNumber rev = HgRevisionNumber.g...
parse
24,754
List<HgRevisionNumber> () { return executeInCurrentThread("."); }
executeInCurrentThread
24,755
List<HgRevisionNumber> (String branch) { return new HeadsCommand(project, branch).executeInCurrentThread(repo); }
executeInCurrentThread
24,756
void (List<String> args) { if (!StringUtil.isEmpty(branch)) { args.add(branch); } }
addArguments
24,757
void (List<String> args) { args.add("--newest-first"); }
addArguments
24,758
boolean () { return true; }
isSilentCommand
24,759
HgCommandResult (VirtualFile repo, List<String> args) { String repositoryURL = getRepositoryUrl(repo); if (repositoryURL == null) { LOG.info("executeCommand no default path configured"); return null; } HgRemoteCommandExecutor executor = new HgRemoteCommandExecutor(project, repositoryURL); HgCommandResult result = execu...
executeCommandInCurrentThread
24,760
void (@NotNull Notification notification, @NotNull HyperlinkEvent event) { ShowSettingsUtil.getInstance() .showSettingsDialog(project, HgProjectConfigurable.class); }
hyperlinkUpdate
24,761
void (boolean includeRemoved) { myIncludeRemoved = includeRemoved; }
setIncludeRemoved
24,762
void (boolean followCopies) { myFollowCopies = followCopies; }
setFollowCopies
24,763
void (boolean logFile) { myLogFile = logFile; }
setLogFile
24,764
List<HgFileRevision> (final HgFile hgFile, int limit, boolean includeFiles) { return execute(hgFile, limit, includeFiles, null); }
execute
24,765
HgVersion () { return myVersion; }
getVersion
24,766
List<HgFileRevision> (final HgFile hgFile, int limit, boolean includeFiles, @Nullable List<String> argsForCmd) { if ((limit <= 0 && limit != -1) || hgFile == null) { return Collections.emptyList(); } String[] templates = HgBaseLogParser.constructFullTemplateArgument(includeFiles, myVersion); String template = HgChanges...
execute
24,767
List<String> (@NotNull String template, int limit, @Nullable HgFile hgFile, @Nullable List<String> argsForCmd) { List<String> arguments = new LinkedList<>(); if (myIncludeRemoved) { // There is a bug in mercurial that causes --follow --removed <file> to cause // an error (http://mercurial.selenic.com/bts/issue2139). Av...
createArguments
24,768
boolean (@NotNull VirtualFile repo, @NotNull String template, int limit, @Nullable HgFile hgFile, @Nullable List<String> argsForCmd, @NotNull HgLineProcessListener listener) { List<String> arguments = createArguments(template, limit, hgFile, argsForCmd); HgCommandExecutor commandExecutor = new HgCommandExecutor(myProje...
execute
24,769
HgCommandResult (@NotNull VirtualFile repoRoot, @NotNull FilePath sourcePath, @NotNull FilePath targetPath) { // hg wlock error may occur while execute this command // since hg version 2017 config timeout.warn=time_in_seconds can be added as argument to wait before warn File repoFile = VfsUtilCore.virtualToIoFile(repoR...
execute
24,770
HgCommandResult (@NotNull String rootPath) { final HgCommandExecutor executor = new HgCommandExecutor(myProject, rootPath); executor.setShowOutput(true); return executor.executeInCurrentThread(null, "init", Collections.singletonList(rootPath)); }
execute
24,771
Set<String> (@NotNull HgCommandResult result) { Set<String> branches = new TreeSet<>(); for (final String line : result.getOutputLines()) { Matcher matcher = BRANCH_LINE.matcher(line); if (matcher.matches()) { branches.add(matcher.group(NAME_INDEX).trim()); } } return branches; }
collectNames
24,772
void (String directory) { this.directory = directory; }
setDirectory
24,773
void (String repositoryURL) { this.repositoryURL = repositoryURL; }
setRepositoryURL
24,774
void (@NotNull @NonNls String revision) { this.revision = revision; }
setRevision
24,775
void (final @NotNull HgRepository repository, final @NotNull @NonNls String branchName, final @NotNull UpdatedFiles updatedFiles) { mergeWith(repository, branchName, updatedFiles, null); }
mergeWith
24,776
void (final @NotNull HgRepository repository, final @NotNull @NonNls String branchName, final @NotNull UpdatedFiles updatedFiles, final @Nullable Runnable onSuccessHandler) { final Project project = repository.getProject(); final VirtualFile repositoryRoot = repository.getRoot(); final HgMergeCommand hgMergeCommand = n...
mergeWith
24,777
void (@NotNull ProgressIndicator indicator) { try { HgCommandResult result = hgMergeCommand.mergeSynchronously(); if (HgErrorUtil.isAncestorMergeError(result)) { //skip and notify VcsNotifier.getInstance(project) .notifyMinorWarning(MERGE_WITH_ANCESTOR_SKIPPED, HgBundle.message("action.hg4idea.merge.skipped.title", rep...
run
24,778
List<HgRevisionNumber> (@NotNull VirtualFile repo) { return getRevisions(repo, "parents", null, null, true); }
parents
24,779
Couple<HgRevisionNumber> (@NotNull VirtualFile repo, @Nullable VirtualFile file) { return parents(repo, file, null); }
parents
24,780
Couple<HgRevisionNumber> (@NotNull VirtualFile repo, @Nullable VirtualFile file, @Nullable HgRevisionNumber revision) { return parents(repo, VcsUtil.getFilePath(file), revision); }
parents
24,781
Couple<HgRevisionNumber> (@NotNull VirtualFile repo, @Nullable FilePath file) { return parents(repo, file, null); }
parents
24,782
Couple<HgRevisionNumber> (@NotNull VirtualFile repo, @Nullable FilePath file, @Nullable HgRevisionNumber revision) { final List<HgRevisionNumber> revisions = getRevisions(repo, "parents", file, revision, true); return switch (revisions.size()) { case 1 -> Couple.of(revisions.get(0), null); case 2 -> Couple.of(revisions...
parents
24,783
Couple<HgRevisionNumber> (@NotNull VirtualFile repo) { HgCommandExecutor commandExecutor = new HgCommandExecutor(myProject); commandExecutor.setSilent(true); HgCommandResult result = commandExecutor.executeInCurrentThread(repo, "identify", Arrays.asList("--num", "--id")); if (result == null) { return Couple.of(HgRevisi...
identify
24,784
List<HgRevisionNumber> (@NotNull VirtualFile repo, @NotNull @NonNls String command, @Nullable FilePath file, @Nullable HgRevisionNumber revision, boolean silent) { final List<String> args = new LinkedList<>(); args.add("--template"); args.add(HgChangesetUtil.makeTemplate("{rev}", "{node}")); if (revision != null) { arg...
getRevisions
24,785
void (final VirtualFile repo, final Consumer<Map<HgFile, HgResolveStatusEnum>> resultHandler) { if (repo == null) { resultHandler.consume(Collections.emptyMap()); } HgCommandExecutor executor = new HgCommandExecutor(myProject); executor.setSilent(true); BackgroundTaskUtil.executeOnPooledThread(HgDisposable.getInstance(...
getListAsynchronously
24,786
void (@NotNull VirtualFile repo, @NotNull VirtualFile path) { markResolved(repo, Collections.singleton(VcsUtil.getFilePath(path))); }
markResolved
24,787
void (@NotNull VirtualFile repo, @NotNull Collection<FilePath> paths) { for (List<String> chunk : VcsFileUtil.chunkPaths(repo, paths)) { List<String> args = new ArrayList<>(); args.add("--mark"); args.addAll(chunk); BackgroundTaskUtil.executeOnPooledThread(HgDisposable.getInstance(myProject), () -> new HgCommandExecuto...
markResolved
24,788
void (String revision) { myRevision = revision; }
setRevision
24,789
void (boolean force) { myForce = force; }
setForce
24,790
void (String branchName) { myBranchName = branchName; }
setBranchName
24,791
void (boolean isNewBranch) { myIsNewBranch = isNewBranch; }
setIsNewBranch
24,792
void (String bookmark) { myBookmarkName = bookmark; }
setBookmarkName
24,793
HgCommandResult () { final List<String> arguments = new LinkedList<>(); if (!StringUtil.isEmptyOrSpaces(myRevision)) { arguments.add("-r"); arguments.add(myRevision); } if (myBranchName != null) { arguments.add("-b"); arguments.add(myBranchName); } if (myIsNewBranch) { arguments.add("--new-branch"); } if (!StringUtil.i...
executeInCurrentThread
24,794
VirtualFile () { return myRepo; }
getRepo
24,795
List<HgRevisionNumber> (VirtualFile repo) { return getRevisions(repo); }
executeInCurrentThread
24,796
List<HgRevisionNumber> (VirtualFile repo) { List<String> args = new ArrayList<>(Arrays.asList( "--template", HgChangesetUtil.makeTemplate("{rev}", "{node}", "{author}", "{desc|firstline}"), "--quiet" )); addArguments(args); HgCommandResult result = executeCommandInCurrentThread(repo, args); if (result == null) { return...
getRevisions
24,797
boolean () { return false; }
isSilentCommand
24,798
void (VirtualFile source, VirtualFile target) { VirtualFile sourceRepo = VcsUtil.getVcsRootFor(myProject, source); VirtualFile targetRepo = VcsUtil.getVcsRootFor(myProject, target); HgCommandExecutor executor = new HgCommandExecutor(myProject, VcsFileUtil.relativeOrFullPath(sourceRepo, source)); if (sourceRepo != null ...
executeInCurrentThread
24,799
void (List<String> args) { args.add("-r"); args.add("0:" + mySource.getChangeset()); args.add("--prune"); args.add(myDest.getChangeset()); args.add("--limit"); args.add(String.valueOf(myLimit)); }
addArguments