Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
25,400 | void (@NotNull Runnable action) { // no extra changing components => ignore } | setFireOnChangeAction |
25,401 | void (final @NotNull PushTargetEditorListener listener) { myDestTargetPanel.addDocumentListener(new DocumentListener() { @Override public void documentChanged(@NotNull DocumentEvent e) { listener.onTargetInEditModeChanged(myDestTargetPanel.getText()); } }); } | addTargetEditorListener |
25,402 | void (@NotNull DocumentEvent e) { listener.onTargetInEditModeChanged(myDestTargetPanel.getText()); } | documentChanged |
25,403 | OutgoingResult (@NotNull final HgRepository repository, @NotNull final PushSpec<HgPushSource, HgTarget> pushSpec, boolean initial) { final Project project = repository.getProject(); HgVcs hgvcs = HgVcs.getInstance(project); assert hgvcs != null; final HgVersion version = hgvcs.getVersion(); String[] templates = HgBaseLogParser.constructFullTemplateArgument(true, version); HgOutgoingCommand hgOutgoingCommand = new HgOutgoingCommand(project); HgTarget hgTarget = pushSpec.getTarget(); List<VcsError> errors = new ArrayList<>(); if (StringUtil.isEmptyOrSpaces(hgTarget.myTarget)) { errors.add(new VcsError(HgBundle.message("hg4idea.commit.path.empty.error"))); return new OutgoingResult(Collections.emptyList(), errors); } HgCommandResult result = hgOutgoingCommand .execute(repository.getRoot(), HgChangesetUtil.makeTemplate(templates), pushSpec.getSource().getPresentation(), hgTarget.myTarget, initial); if (result == null) { errors.add(new VcsError(HgBundle.message("hg4idea.commit.cmd.execute.error", repository))); return new OutgoingResult(Collections.emptyList(), errors); } List<String> resultErrors = result.getErrorLines(); if (!resultErrors.isEmpty() && result.getExitValue() != 0) { for (@NlsSafe String error : resultErrors) { if (HgErrorUtil.isAbortLine(error)) { if (HgErrorUtil.isAuthorizationError(error)) { VcsError authorizationError = new VcsError(HgBundle.message("hg4idea.commit.auth.error", error), new VcsErrorHandler() { @Override public void handleError(@NotNull CommitLoader commitLoader) { commitLoader.reloadCommits(); } }); errors.add(authorizationError); } else { errors.add(new VcsError(error)); } } } LOG.warn(resultErrors.toString()); } return new OutgoingResult(HgHistoryUtil.createFullCommitsFromResult(project, repository.getRoot(), result, version, true), errors); } | getOutgoingCommits |
25,404 | void (@NotNull CommitLoader commitLoader) { commitLoader.reloadCommits(); } | handleError |
25,405 | void (@NotNull Map<HgRepository, PushSpec<HgPushSource, HgTarget>> pushSpecs, @Nullable VcsPushOptionValue vcsPushOptionValue, boolean force) { for (Map.Entry<HgRepository, PushSpec<HgPushSource, HgTarget>> entry : pushSpecs.entrySet()) { HgRepository repository = entry.getKey(); PushSpec<HgPushSource, HgTarget> hgSpec = entry.getValue(); HgTarget destination = hgSpec.getTarget(); HgPushSource source = hgSpec.getSource(); Project project = repository.getProject(); final HgPushCommand pushCommand = new HgPushCommand(project, repository.getRoot(), destination.myTarget); pushCommand.setIsNewBranch(true); // set always true, because it just allow mercurial to create a new one if needed pushCommand.setForce(force); String branchName = source.getBranch(); if (branchName.equals(repository.getCurrentBookmark())) { if (vcsPushOptionValue == HgVcsPushOptionValue.Current) { pushCommand.setBookmarkName(branchName); } else { pushCommand.setRevision(branchName); } } else { pushCommand.setBranchName(branchName); } pushSynchronously(project, pushCommand); } } | push |
25,406 | void (final @NotNull Project project, @NotNull HgPushCommand command) { final VirtualFile repo = command.getRepo(); HgCommandResult result = command.executeInCurrentThread(); if (result == null) { return; } if (result.getExitValue() == PUSH_SUCCEEDED_EXIT_VALUE) { int commitsNum = getNumberOfPushedCommits(result); String successTitle = HgBundle.message("action.hg4idea.push.success"); String successDescription = HgBundle.message("action.hg4idea.push.success.msg", commitsNum, repo.getPresentableName()); VcsNotifier.getInstance(project).notifySuccess(PUSH_SUCCESS, successTitle, successDescription); } else if (result.getExitValue() == NOTHING_TO_PUSH_EXIT_VALUE) { VcsNotifier.getInstance(project).notifySuccess(NOTHING_TO_PUSH, "", HgBundle.message("action.hg4idea.push.nothing")); } else { new HgCommandResultNotifier(project).notifyError(PUSH_ERROR, result, HgBundle.message("action.hg4idea.push.error"), HgBundle.message("action.hg4idea.push.error.msg", repo.getPresentableName())); } } | pushSynchronously |
25,407 | int (@NotNull HgCommandResult result) { int numberOfCommitsInAllSubrepos = 0; final List<String> outputLines = result.getOutputLines(); for (String outputLine : outputLines) { outputLine = outputLine.trim(); final Matcher matcher = PUSH_COMMITS_PATTERN.matcher(outputLine); if (matcher.matches()) { try { String numberOfCommits = matcher.group(1); numberOfCommitsInAllSubrepos += ONE.equals(numberOfCommits) ? 1 : Integer.parseInt(numberOfCommits); } catch (NumberFormatException e) { LOG.error("getNumberOfPushedCommits ", e); return -1; } } } return numberOfCommitsInAllSubrepos; } | getNumberOfPushedCommits |
25,408 | OptionsPanelPosition () { return OptionsPanelPosition.SOUTH; } | getPosition |
25,409 | String () { return myBranch; } | getPresentation |
25,410 | HgConfig (Project project, VirtualFile root) { return new HgConfig(project, root); } | getInstance |
25,411 | String () { return getNamedConfig("paths", "default"); } | getDefaultPath |
25,412 | String () { String path = getNamedConfig("paths", "default:pushurl"); if (path == null) { path = getNamedConfig("paths", "default-push"); } if (path == null) { path = getNamedConfig("paths", "default"); } return path; } | getDefaultPushPath |
25,413 | String (@NotNull @NonNls String sectionName, @Nullable @NonNls String configName) { if (StringUtil.isEmptyOrSpaces(sectionName) || StringUtil.isEmptyOrSpaces(configName)) { return null; } Map<String, String> sectionValues = myConfigMap.get(sectionName); return sectionValues != null ? sectionValues.get(configName) : null; } | getNamedConfig |
25,414 | Collection<String> () { Map<String, String> pathOptions = myConfigMap.get("paths"); //NON-NLS return pathOptions != null ? pathOptions.values() : Collections.emptyList(); } | getPaths |
25,415 | boolean () { String value = getNamedConfig("extensions", "mq"); return (value != null && !value.trim().startsWith("!")); } | isMqUsed |
25,416 | VcsKey () { return HgVcs.getKey(); } | getSupportedVcs |
25,417 | String () { return myCurrentBranch; } | getCurrentBranch |
25,418 | Collection<HgNameWithHashInfo> () { return myBookmarks; } | getBookmarks |
25,419 | Collection<HgNameWithHashInfo> () { return myTags; } | getTags |
25,420 | Collection<HgNameWithHashInfo> () { return myLocalTags; } | getLocalTags |
25,421 | String () { return myTipRevision; } | getTipRevision |
25,422 | String () { return myCurrentRevision; } | getCurrentRevision |
25,423 | String () { return myCurrentBookmark; } | getCurrentBookmark |
25,424 | List<HgNameWithHashInfo> () { return myMQApplied; } | getMQApplied |
25,425 | List<String> () { return myMqNames; } | getMqPatchNames |
25,426 | boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; HgRepoInfo info = (HgRepoInfo)o; if (myState != info.myState) return false; if (myTipRevision != null ? !myTipRevision.equals(info.myTipRevision) : info.myTipRevision != null) return false; if (myCurrentRevision != null ? !myCurrentRevision.equals(info.myCurrentRevision) : info.myCurrentRevision != null) return false; if (!myCurrentBranch.equals(info.myCurrentBranch)) return false; if (myCurrentBookmark != null ? !myCurrentBookmark.equals(info.myCurrentBookmark) : info.myCurrentBookmark != null) return false; if (!myBranches.equals(info.myBranches)) return false; if (!myBookmarks.equals(info.myBookmarks)) return false; if (!myTags.equals(info.myTags)) return false; if (!myLocalTags.equals(info.myLocalTags)) return false; if (!mySubrepos.equals(info.mySubrepos)) return false; if (!myMQApplied.equals(info.myMQApplied)) return false; if (!myMqNames.equals(info.myMqNames)) return false; return true; } | equals |
25,427 | int () { return Objects.hash(myCurrentBranch, myCurrentRevision, myTipRevision, myCurrentBookmark, myState, myBranches, myBookmarks, myTags, myLocalTags, mySubrepos, myMQApplied, myMqNames); } | hashCode |
25,428 | String () { return String.format("HgRepository{myCurrentBranch=%s, myCurrentRevision='%s', myState=%s}", myCurrentBranch, myCurrentRevision, myState); } | toString |
25,429 | boolean () { return !mySubrepos.isEmpty(); } | hasSubrepos |
25,430 | Collection<HgNameWithHashInfo> () { return mySubrepos; } | getSubrepos |
25,431 | File (@NotNull HgVersion version, @NotNull File parentCacheFile) { //before 2.5 only branchheads exist; branchheads-served after mercurial 2.5; branch2-served after 2.9; // when project is recently cloned there are only base file if (version.hasBranch2()) { File file = new File(parentCacheFile, "branch2-served"); return file.exists() ? file : new File(parentCacheFile, "branch2-base"); } if (version.hasBranchHeadsBaseServed()) { File file = new File(parentCacheFile, "branchheads-served"); return file.exists() ? file : new File(parentCacheFile, "branchheads-base"); } return new File(parentCacheFile, "branchheads"); } | identifyBranchHeadFile |
25,432 | String () { if (!isDirStateInfoAvailable()) return null; try { return BaseEncoding.base16().lowerCase().encode(readHashBytesFromFile(myDirStateFile)); } catch (IOException e) { // dirState exists if not fresh, if we could not load dirState info repository must be corrupted LOG.error("IOException while trying to read current repository state information.", e); return null; } } | readCurrentRevision |
25,433 | String () { if (!isBranchInfoAvailable()) return null; String[] branchesWithHeads; try { branchesWithHeads = DvcsUtil.tryLoadFile(myBranchHeadsFile).split("\n"); } catch (RepoStateException e) { LOG.error(e); return null; } String head = branchesWithHeads[0]; Matcher matcher = HASH_NAME.matcher(head); if (matcher.matches()) { return (matcher.group(1)); } return null; } | readCurrentTipRevision |
25,434 | boolean () { myBranchHeadsFile = identifyBranchHeadFile(myVcs.getVersion(), myCacheDir); return !isFresh() && myBranchHeadsFile.exists(); } | isBranchInfoAvailable |
25,435 | boolean () { return myDirStateFile.exists(); } | isDirStateInfoAvailable |
25,436 | String () { return branchExist() ? DvcsUtil.tryLoadFileOrReturn(myCurrentBranch, HgRepository.DEFAULT_BRANCH) : HgRepository.DEFAULT_BRANCH; } | readCurrentBranch |
25,437 | boolean () { return new File(myHgDir, "merge").exists(); } | isMergeInProgress |
25,438 | boolean () { return mySubrepoFile.exists(); } | hasSubrepos |
25,439 | boolean () { return new File(myHgDir, "rebasestate").exists(); } | isRebaseInProgress |
25,440 | boolean () { return new File(myHgDir, "graftstate").exists(); } | isCherryPickInProgress |
25,441 | boolean () { return !myCacheDir.exists(); } | isFresh |
25,442 | boolean () { return myCurrentBranch.exists(); } | branchExist |
25,443 | Collection<HgNameWithHashInfo> () { return readReferences(myBookmarksFile); } | readBookmarks |
25,444 | Collection<HgNameWithHashInfo> () { return readReferences(myTagsFile); } | readTags |
25,445 | Collection<HgNameWithHashInfo> () { return readReferences(myLocalTagsFile); } | readLocalTags |
25,446 | Collection<HgNameWithHashInfo> (@NotNull File fileWithReferences) { HashSet<HgNameWithHashInfo> result = new HashSet<>(); readReferences(fileWithReferences, result); return result; } | readReferences |
25,447 | void (@NotNull File fileWithReferences, @NotNull Collection<HgNameWithHashInfo> resultRefs) { // files like .hg/bookmarks which contains hash + name, f.e. 25e44c95b2612e3cdf29a704dabf82c77066cb67 A_BookMark or //files like .hg/patches/status hash:name, f.e. 25e44c95b2612e3cdf29a704dabf82c77066cb67:1.diff if (!fileWithReferences.exists()) return; String[] namesWithHashes = DvcsUtil.tryLoadFileOrReturn(fileWithReferences, "").split("\n"); for (String str : namesWithHashes) { Matcher matcher = HASH_NAME.matcher(str); if (matcher.matches()) { resultRefs.add(new HgNameWithHashInfo(matcher.group(2), myVcsObjectsFactory.createHash(matcher.group(1)))); } } } | readReferences |
25,448 | String () { return myCurrentBookmark.exists() ? DvcsUtil.tryLoadFileOrReturn(myCurrentBookmark, "") : null; } | readCurrentBookmark |
25,449 | Collection<HgNameWithHashInfo> () { if (!hasSubrepos()) return Collections.emptySet(); return readReferences(mySubrepoFile); } | readSubrepos |
25,450 | List<HgNameWithHashInfo> () { ArrayList<HgNameWithHashInfo> mqPatchRefs = new ArrayList<>(); readReferences(new File(myMqInternalDir, "status"), mqPatchRefs); return mqPatchRefs; } | readMQAppliedPatches |
25,451 | List<String> () { File seriesFile = new File(myMqInternalDir, "series"); return seriesFile.exists() ? StringUtil.split(DvcsUtil.tryLoadFileOrReturn(seriesFile, ""), "\n") : ContainerUtil.emptyList(); } | readMqPatchNames |
25,452 | HgRepository (@NotNull VirtualFile root, @NotNull Project project, @NotNull Disposable parentDisposable) { ProgressManager.checkCanceled(); HgVcs vcs = HgVcs.getInstance(project); if (vcs == null) { throw new IllegalArgumentException("Vcs not found for project " + project); } HgRepositoryImpl repository = new HgRepositoryImpl(root, vcs, parentDisposable); repository.setupUpdater(); return repository; } | getInstance |
25,453 | void () { HgRepositoryUpdater updater = new HgRepositoryUpdater(this); Disposer.register(this, updater); myLocalIgnoredHolder.startRescan(); } | setupUpdater |
25,454 | VirtualFile () { return myHgDir; } | getHgDir |
25,455 | State () { return myInfo.getState(); } | getState |
25,456 | String () { String branchOrBookMarkName = getCurrentBookmark(); if (StringUtil.isEmptyOrSpaces(branchOrBookMarkName)) { branchOrBookMarkName = getCurrentBranch(); } return branchOrBookMarkName; } | getCurrentBranchName |
25,457 | AbstractVcs () { return myVcs; } | getVcs |
25,458 | String () { return myInfo.getCurrentBranch(); } | getCurrentBranch |
25,459 | String () { return myInfo.getCurrentRevision(); } | getCurrentRevision |
25,460 | String () { return myInfo.getTipRevision(); } | getTipRevision |
25,461 | Set<String> () { return myOpenedBranches; } | getOpenedBranches |
25,462 | Collection<HgNameWithHashInfo> () { return myInfo.getBookmarks(); } | getBookmarks |
25,463 | String () { return myInfo.getCurrentBookmark(); } | getCurrentBookmark |
25,464 | Collection<HgNameWithHashInfo> () { return myInfo.getTags(); } | getTags |
25,465 | Collection<HgNameWithHashInfo> () { return myInfo.getLocalTags(); } | getLocalTags |
25,466 | HgConfig () { return myConfig; } | getRepositoryConfig |
25,467 | boolean () { return myInfo.hasSubrepos(); } | hasSubrepos |
25,468 | Collection<HgNameWithHashInfo> () { return myInfo.getSubrepos(); } | getSubrepos |
25,469 | List<HgNameWithHashInfo> () { return myInfo.getMQApplied(); } | getMQAppliedPatches |
25,470 | List<String> () { return myInfo.getMqPatchNames(); } | getAllPatchNames |
25,471 | List<String> () { final List<String> appliedPatches = HgUtil.getNamesWithoutHashes(getMQAppliedPatches()); return ContainerUtil.filter(getAllPatchNames(), s -> !appliedPatches.contains(s)); } | getUnappliedPatchNames |
25,472 | void () { HgRepoInfo currentInfo = readRepoInfo(); // update only if something changed!!! if update every time - new log will be refreshed every time, too. // Then blinking and do not work properly; final Project project = getProject(); if (!project.isDisposed() && !currentInfo.equals(myInfo)) { myInfo = currentInfo; HgCommandResult branchCommandResult = new HgBranchesCommand(project, getRoot()).collectBranches(); if (branchCommandResult == null || branchCommandResult.getExitValue() != 0) { LOG.warn("Could not collect hg opened branches."); // hg executable is not valid myOpenedBranches = myInfo.getBranches().keySet(); } else { myOpenedBranches = HgBranchesCommand.collectNames(branchCommandResult); } BackgroundTaskUtil.executeOnPooledThread(this, () -> BackgroundTaskUtil.syncPublisher(project, HgVcs.STATUS_TOPIC).update(project, getRoot())); } } | update |
25,473 | String () { return "HgRepository " + getRoot() + " : " + myInfo; } | toLogString |
25,474 | HgRepoInfo () { //in GitRepositoryImpl there are temporary state object for reader fields storing! Todo Check; return new HgRepoInfo(myReader.readCurrentBranch(), myReader.readCurrentRevision(), myReader.readCurrentTipRevision(), myReader.readState(), myReader.readBranches(), myReader.readBookmarks(), myReader.readCurrentBookmark(), myReader.readTags(), myReader.readLocalTags(), myReader.readSubrepos(), myReader.readMQAppliedPatches(), myReader.readMqPatchNames()); } | readRepoInfo |
25,475 | void () { myConfig = HgConfig.getInstance(getProject(), getRoot()); } | updateConfig |
25,476 | HgLocalIgnoredHolder () { return myLocalIgnoredHolder; } | getIgnoredFilesHolder |
25,477 | void () { BackgroundTaskUtil.syncPublisher(myProject, VcsManagedFilesHolder.TOPIC).updatingModeChanged(); } | updateStarted |
25,478 | void (@NotNull Collection<FilePath> ignoredPaths, boolean isFullRescan) { if(myProject.isDisposed()) return; BackgroundTaskUtil.syncPublisher(myProject, VcsManagedFilesHolder.TOPIC).updatingModeChanged(); ChangeListManagerImpl.getInstanceImpl(myProject).notifyUnchangedFileStatusChanged(); } | updateFinished |
25,479 | HgRepositoryFiles (@NotNull VirtualFile hgDir) { return new HgRepositoryFiles(hgDir); } | getInstance |
25,480 | String (@NotNull String s) { return "/" + s; } | slash |
25,481 | Collection<String> () { return Arrays.asList(slash(BRANCHHEADS), slash(MERGE)); } | getSubDirRelativePaths |
25,482 | String () { return myBranchHeadsDirPath; } | getBranchHeadsDirPath |
25,483 | String () { return myMQDirPath; } | getMQDirPath |
25,484 | boolean (String filePath) { return filePath.startsWith(myBranchHeadsPath); } | isbranchHeadsFile |
25,485 | boolean (String filePath) { return filePath.equals(myBranchPath); } | isBranchFile |
25,486 | boolean (String filePath) { return filePath.equals(myDirstatePath); } | isDirstateFile |
25,487 | boolean (String filePath) { return filePath.startsWith(myMergePath); } | isMergeFile |
25,488 | boolean (String filePath) { return filePath.startsWith(myRebasePath); } | isRebaseFile |
25,489 | boolean (String filePath) { return filePath.equals(myBookmarksPath); } | isBookmarksFile |
25,490 | boolean (String filePath) { return filePath.equals(myCurrentBookmarkPath); } | isCurrentBookmarksFile |
25,491 | boolean (String filePath) { return filePath.equals(myConfigHgrcPath); } | isConfigHgrcFile |
25,492 | boolean (String filePath) { return filePath.equals(myTagsPath); } | isTagsFile |
25,493 | boolean (String filePath) { return filePath.equals(myLocalTagsPath); } | isLocalTagsFile |
25,494 | boolean (String filePath) { return filePath.startsWith(myMQDirPath); } | isMqFile |
25,495 | boolean (String filePath) { return filePath.equals(myHgIgnorePath); } | isHgIgnore |
25,496 | void () { if (myWatchRequest != null) { LocalFileSystem.getInstance().removeWatchedRoot(myWatchRequest); } myUpdateQueue.cancelAllUpdates(); myUpdateConfigQueue.cancelAllUpdates(); if (myMessageBusConnection != null) { myMessageBusConnection.disconnect(); } } | dispose |
25,497 | void (@NotNull List<? extends @NotNull VFileEvent> events) { // which files in .hg were changed boolean branchHeadsChanged = false; boolean branchFileChanged = false; boolean dirstateFileChanged = false; boolean mergeFileChanged = false; boolean rebaseFileChanged = false; boolean bookmarksFileChanged = false; boolean tagsFileChanged = false; boolean localTagsFileChanged = false; boolean currentBookmarkFileChanged = false; boolean mqChanged = false; boolean hgIgnoreChanged = false; boolean configHgrcChanged = false; for (VFileEvent event : events) { String filePath = event.getPath(); if (myRepositoryFiles.isbranchHeadsFile(filePath)) { branchHeadsChanged = true; } else if (myRepositoryFiles.isBranchFile(filePath)) { branchFileChanged = true; DvcsUtil.ensureAllChildrenInVfs(myBranchHeadsDir); } else if (myRepositoryFiles.isDirstateFile(filePath)) { dirstateFileChanged = true; } else if (myRepositoryFiles.isMergeFile(filePath)) { mergeFileChanged = true; } else if (myRepositoryFiles.isRebaseFile(filePath)) { rebaseFileChanged = true; } else if (myRepositoryFiles.isBookmarksFile(filePath)) { bookmarksFileChanged = true; } else if (myRepositoryFiles.isTagsFile(filePath)) { tagsFileChanged = true; } else if (myRepositoryFiles.isLocalTagsFile(filePath)) { localTagsFileChanged = true; } else if (myRepositoryFiles.isCurrentBookmarksFile(filePath)) { currentBookmarkFileChanged = true; } else if (myRepositoryFiles.isMqFile(filePath)) { mqChanged = true; if (myMqDir == null) { myMqDir = VcsUtil.getVirtualFile(myRepositoryFiles.getMQDirPath()); } DvcsUtil.ensureAllChildrenInVfs(myMqDir); } else if (myRepositoryFiles.isConfigHgrcFile(filePath)) { configHgrcChanged = true; } else if (myRepositoryFiles.isHgIgnore(filePath)) { hgIgnoreChanged = true; } } if (branchHeadsChanged || branchFileChanged || dirstateFileChanged || mergeFileChanged || rebaseFileChanged || bookmarksFileChanged || currentBookmarkFileChanged || tagsFileChanged || localTagsFileChanged || mqChanged) { myUpdateQueue.queue(new MyUpdater("hgrepositoryUpdate")); } if (configHgrcChanged) { myUpdateConfigQueue.queue(new MyUpdater("hgconfigUpdate"){ @Override public void run() { myRepository.updateConfig(); } }); } if (dirstateFileChanged || hgIgnoreChanged) { myRepository.getIgnoredFilesHolder().startRescan(); final VirtualFile root = myRepository.getRoot(); myDirtyScopeManager.dirDirtyRecursively(root); if (dirstateFileChanged) { //update async incoming/outgoing model BackgroundTaskUtil.syncPublisher(myProject, HgVcs.REMOTE_TOPIC).update(myProject, root); } } } | after |
25,498 | void () { myRepository.updateConfig(); } | run |
25,499 | boolean (@NotNull Update update) { return true; } | canEat |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.