Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
261,300
void () { if (ChangeListManager.getInstance(myProject).isFreezedWithNotification(null)) return; if (myPatches.isEmpty() || (!myContainBasedChanges)) return; final List<AbstractFilePatchInProgress.PatchChange> changes = ContainerUtil.sorted(getAllChanges(), myMyChangeComparator); List<AbstractFilePatchInProgress.PatchCh...
showDiff
261,301
DiffRequestProducer (@NotNull final AbstractFilePatchInProgress patchInProgress) { final String beforePath = patchInProgress.getPatch().getBeforeName(); final String afterPath = patchInProgress.getPatch().getAfterName(); return new DiffRequestProducer() { @NotNull @Override public String getName() { final File ioCurren...
createBaseNotFoundErrorRequest
261,302
String () { final File ioCurrentBase = patchInProgress.getIoCurrentBase(); return ioCurrentBase == null ? patchInProgress.getCurrentPath() : ioCurrentBase.getPath(); }
getName
261,303
String () { return myProducer.getName(); }
getName
261,304
FilePath () { return ChangesUtil.getFilePath(myChange); }
getFilePath
261,305
FileStatus () { return myChange.getFileStatus(); }
getFileStatus
261,306
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MyProducerWrapper wrapper = (MyProducerWrapper)o; return Objects.equals(myProducer, wrapper.myProducer); }
equals
261,307
int () { return Objects.hash(myProducer); }
hashCode
261,308
int (AbstractFilePatchInProgress.PatchChange o1, AbstractFilePatchInProgress.PatchChange o2) { if (PropertiesComponent.getInstance(myProject).isTrueValue("ChangesBrowser.SHOW_FLATTEN")) { return o1.getPatchInProgress().getIoCurrentBase().getName().compareTo(o2.getPatchInProgress().getIoCurrentBase().getName()); } retur...
compare
261,309
void (@NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); ClientAppSession appSession = ClientSessionsManager.getAppSession(); // In a remote development case we cannot receive clipboard content immediately (we need to fetch it from client), // so we make the action enabled unconditionally....
update
261,310
ActionUpdateThread () { return IdeEventQueue.getInstance().isDispatchingOnMainThread ? ActionUpdateThread.EDT : ActionUpdateThread.BGT; }
getActionUpdateThread
261,311
void (@NotNull AnActionEvent e) { final Project project = e.getRequiredData(CommonDataKeys.PROJECT); if (ChangeListManager.getInstance(project).isFreezedWithNotification(VcsBundle.message("patch.apply.cannot.apply.now"))) return; FileDocumentManager.getInstance().saveAllDocuments(); String clipboardText = StringUtil.no...
actionPerformed
261,312
JComponent () { return createAnalyzeOnTheFlyOptionPanel(); }
createDoNotAskCheckbox
261,313
JCheckBox () { final JCheckBox removeOptionCheckBox = new JCheckBox(VcsBundle.message("patch.apply.analyze.from.clipboard.on.the.fly.checkbox")); removeOptionCheckBox.setMnemonic(KeyEvent.VK_L); removeOptionCheckBox.setSelected(VcsApplicationSettings.getInstance().DETECT_PATCH_ON_THE_FLY); removeOptionCheckBox.addActio...
createAnalyzeOnTheFlyOptionPanel
261,314
BinaryContentRevision (@NotNull FilePath newFilePath) { return new SimpleBinaryContentRevision(newFilePath) { @Override public byte @Nullable [] getBinaryContent() { return myPatch.getAfterContent(); } }; }
createNewContentRevision
261,315
Change (Project project) { ContentRevision before = null; ContentRevision after = null; if (!myPatch.isNewFile()) { before = new CurrentBinaryContentRevision(getFilePath()) { @NotNull @Override public VcsRevisionNumber getRevisionNumber() { return new TextRevisionNumber(VcsBundle.message("local.version.title")); } }; }...
createChange
261,316
VcsRevisionNumber () { return new TextRevisionNumber(VcsBundle.message("local.version.title")); }
getRevisionNumber
261,317
void (@NotNull IdeFrame ideFrame) { // we can't get clipboard details especially content size, so we should avoid clipboard processing when it's possible; if (!VcsApplicationSettings.getInstance().DETECT_PATCH_ON_THE_FLY) return; super.applicationActivated(ideFrame); }
applicationActivated
261,318
void (@NotNull IdeFrame ideFrame) { if (!VcsApplicationSettings.getInstance().DETECT_PATCH_ON_THE_FLY) return; super.applicationDeactivated(ideFrame); }
applicationDeactivated
261,319
void (@NotNull Project project, @NotNull String value) { new ApplyPatchFromClipboardAction.MyApplyPatchFromClipboardDialog(project, value).show(); }
handle
261,320
boolean (@NotNull String value) { return PatchReader.isPatchContent(value); }
canHandle
261,321
void (@NotNull final Collection<? extends VirtualFile> autoBases) { final String path = myPatch.getBeforeName() == null ? myPatch.getAfterName() : myPatch.getBeforeName(); for (VirtualFile autoBase : autoBases) { final VirtualFile willBeBase = PathMerger.getBase(autoBase, path); if (willBeBase != null) { myAutoBases.ad...
setAutoBases
261,322
FilePatchStatus (final T patch) { final String beforeName = PathUtil.toSystemIndependentName(patch.getBeforeName()); final String afterName = PathUtil.toSystemIndependentName(patch.getAfterName()); if (patch.isNewFile() || (beforeName == null)) { return FilePatchStatus.ADDED; } else if (patch.isDeletedFile() || (afterN...
getStatus
261,323
PatchChange () { return new PatchChange(getCurrentRevision(), getNewContentRevision(), this); }
getChange
261,324
void (final VirtualFile base) { myBase = base; myNewContentRevision = null; myCurrentRevision = null; myConflicts = null; final String beforeName = myPatch.getBeforeName(); if (beforeName != null) { myIoCurrentBase = PathMerger.getFile(new File(myBase.getPath()), beforeName); myCurrentBase = myIoCurrentBase == null ? n...
setNewBase
261,325
void (final VirtualFile vf) { myCurrentBase = vf; }
setCreatedCurrentBase
261,326
FilePatchStatus () { return myStatus; }
getStatus
261,327
File () { return myIoCurrentBase; }
getIoCurrentBase
261,328
VirtualFile () { return myCurrentBase; }
getCurrentBase
261,329
VirtualFile () { return myBase; }
getBase
261,330
T () { return myPatch; }
getPatch
261,331
boolean () { return myBaseExists; }
isBaseExists
261,332
boolean () { return myBaseExists || FilePatchStatus.ADDED.equals(myStatus); }
baseExistsOrAdded
261,333
FilePath () { return FilePatchStatus.ADDED.equals(myStatus) ? VcsUtil.getFilePath(myIoCurrentBase, false) : detectNewFilePathForMovedOrModified(); }
getFilePath
261,334
FilePath () { return FilePatchStatus.MOVED_OR_RENAMED.equals(myStatus) ? VcsUtil.getFilePath(Objects.requireNonNull(PathMerger.getFile(new File(myBase.getPath()), myPatch.getAfterName())), false) : (myCurrentBase != null) ? VcsUtil.getFilePath(myCurrentBase) : VcsUtil.getFilePath(myIoCurrentBase, false); }
detectNewFilePathForMovedOrModified
261,335
boolean () { if (myConflicts == null) { if ((myCurrentBase != null) && (myNewContentRevision instanceof LazyPatchContentRevision)) { ((LazyPatchContentRevision)myNewContentRevision).getContent(); myConflicts = ((LazyPatchContentRevision)myNewContentRevision).isPatchApplyFailed(); } else { myConflicts = false; } } retur...
isConflictingChange
261,336
ContentRevision () { if (FilePatchStatus.ADDED.equals(myStatus)) return null; if (myCurrentRevision == null) { FilePath filePath = (myCurrentBase != null) ? VcsUtil.getFilePath(myCurrentBase) : VcsUtil.getFilePath(myIoCurrentBase, false); myCurrentRevision = new CurrentContentRevision(filePath); } return myCurrentRevis...
getCurrentRevision
261,337
boolean () { return myPatchInProgress.baseExistsOrAdded(); }
isValid
261,338
List<VirtualFile> () { List<VirtualFile> result = new ArrayList<>(myAutoBases.size() + 1); result.addAll(myAutoBases); return result; }
getAutoBasesCopy
261,339
Couple<String> () { return Couple.of(myPatch.getBeforeName(), myPatch.getAfterName()); }
getKey
261,340
void () { myStrippable.applyBackToPatch(myPatch); setNewBase(myBase); }
refresh
261,341
void () { myStrippable.reset(); refresh(); }
reset
261,342
boolean () { return myStrippable.canDown(); }
canDown
261,343
boolean () { return myStrippable.canUp(); }
canUp
261,344
void () { myStrippable.up(); refresh(); }
up
261,345
void () { myStrippable.down(); refresh(); }
down
261,346
void () { myStrippable.setZero(); refresh(); }
setZero
261,347
String () { return myStrippable.getOriginalBeforePath(); }
getOriginalBeforePath
261,348
int () { return myStrippable.getCurrentStrip(); }
getCurrentStrip
261,349
void () { myCurrentStrip = 0; }
reset
261,350
int () { return myCurrentStrip; }
getCurrentStrip
261,351
boolean () { return myCurrentStrip > 0; }
canDown
261,352
boolean () { return myCurrentStrip < myStripMax; }
canUp
261,353
void () { if (canUp()) { ++myCurrentStrip; } }
up
261,354
void () { if (canDown()) { --myCurrentStrip; } }
down
261,355
void () { myCurrentStrip = myStripMax; }
setZero
261,356
String () { return mySourcePath.substring(myParts[myCurrentStrip]); }
getCurrentPath
261,357
String () { return mySourcePath.toString(); }
getOriginalPath
261,358
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; StripCapablePath that = (StripCapablePath)o; return StringUtil.equals(mySourcePath, that.mySourcePath); }
equals
261,359
int () { return mySourcePath.hashCode(); }
hashCode
261,360
void () { for (Strippable part : myParts) { part.reset(); } }
reset
261,361
boolean () { boolean result = true; for (Strippable part : myParts) { result &= part.canDown(); } return result; }
canDown
261,362
boolean () { boolean result = true; for (Strippable part : myParts) { result &= part.canUp(); } return result; }
canUp
261,363
void () { for (Strippable part : myParts) { part.up(); } }
up
261,364
void () { for (Strippable part : myParts) { part.down(); } }
down
261,365
void () { for (Strippable part : myParts) { part.setZero(); } }
setZero
261,366
String () { return myParts[0].getCurrentPath(); }
getCurrentPath
261,367
String () { return myParts[myBeforeIdx].getOriginalPath(); }
getOriginalBeforePath
261,368
int () { return myParts[0].getCurrentStrip(); }
getCurrentStrip
261,369
void (final FilePatch patch) { final String beforeName = patch.getBeforeName(); if (beforeName != null) { patch.setBeforeName(myParts[myBeforeIdx].getCurrentPath()); } final String afterName = patch.getAfterName(); if (afterName != null) { patch.setAfterName(myParts[myAfterIdx].getCurrentPath()); } }
applyBackToPatch
261,370
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PatchStrippable that = (PatchStrippable)o; if (!Arrays.equals(myParts, that.myParts)) return false; return true; }
equals
261,371
int () { return Arrays.hashCode(myParts); }
hashCode
261,372
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AbstractFilePatchInProgress<?> that = (AbstractFilePatchInProgress<?>)o; if (!myStrippable.equals(that.myStrippable)) return false; return true; }
equals
261,373
int () { return myStrippable.hashCode(); }
hashCode
261,374
String (@NotNull String versionId, @NotNull AbstractVcs vcs) { String vcsPattern = vcs.getRevisionPattern(); if (vcsPattern != null) { Pattern revisionPattern = Pattern.compile(String.format(ourRevisionPatternTemplate, vcsPattern)); Matcher revisionMatcher = revisionPattern.matcher(versionId); if (revisionMatcher.find(...
parseVersionAsRevision
261,375
Date (@NotNull String versionId) { try { Matcher tsMatcher = ourTsPattern.matcher(versionId); if (tsMatcher.find()) { long fromTsPattern = Long.parseLong(tsMatcher.group(1)); return new Date(fromTsPattern); } else { return new Date(versionId); } } catch (IllegalArgumentException e) { return null; } }
parseVersionAsDate
261,376
String (@NotNull FileStatus fileStatus, int mode) { return String.format(FILE_MODE_HEADER, fileStatus == FileStatus.DELETED ? "deleted" : "new", mode); //NON-NLS NON-NLS }
getFileModeHeader
261,377
String (@NotNull String beforeHash, @NotNull String afterHash) { return String.format(INDEX_SHA1_HEADER, beforeHash, afterHash); }
getIndexHeader
261,378
boolean (@NotNull String s1, @NotNull String s2) { if (!SystemInfo.isFileSystemCaseSensitive) { return s1.equalsIgnoreCase(s2); } return s1.equals(s2); }
stringEqual
261,379
String[] (@NotNull String s) { return s.replace(File.separatorChar, '/').split("/"); }
split
261,380
boolean (@Nullable Project project) { if (project == null) return true; return ContainerUtil.exists(ProjectLevelVcsManager.getInstance(project).getAllActiveVcss(), vcs -> vcs.getType() == distributed); }
shouldForceUnixLineSeparator
261,381
Path (@NotNull Project project, @NotNull Collection<? extends Change> changes) { File commonAncestor = ChangesUtil.findCommonAncestor(changes); VirtualFile vcsRoot; if (commonAncestor == null || ChangesUtil.getAffectedVcses(changes, project).size() != 1) { vcsRoot = null; } else { vcsRoot = VcsUtil.getVcsRootFor(projec...
calculateBaseDirForWritingPatch
261,382
boolean (@NotNull Transferable t, @Nullable Editor editor) { List<File> list = FileCopyPasteUtil.getFileList(t); if (list == null || list.size() != 1) return false; return PatchFileType.isPatchFile(list.get(0)); }
canHandle
261,383
boolean (@NotNull Transferable t, @Nullable Editor editor, @NotNull final Project project) { List<File> list = FileCopyPasteUtil.getFileList(t); if (list == null || list.size() != 1) return false; return ApplyPatchAction.showAndGetApplyPatch(project, list.get(0)); }
handleDrop
261,384
BinaryContentRevision (@NotNull FilePath newFilePath) { return new ShelvedBinaryContentRevision(newFilePath, myPatch.getShelvedBinaryFile().SHELVED_PATH); }
createNewContentRevision
261,385
Change (Project project) { return myPatch.getShelvedBinaryFile().createChange(project); }
createChange
261,386
Collection<VirtualFile> (final String fileName) { return FilenameIndex.getVirtualFilesByName(fileName, GlobalSearchScope.projectScope(myProject)); }
findFiles
261,387
String () { return myTitle; }
getTitle
261,388
boolean () { return myCanChangePatchFile; }
isCanChangePatchFile
261,389
PatchBaseDirectoryDetector (Project project) { return project.getService(PatchBaseDirectoryDetector.class); }
getInstance
261,390
String () { return VcsBundle.message("action.import.to.shelf"); }
getName
261,391
void (@NotNull List<? extends FilePatch> remaining, @NotNull MultiMap<VirtualFile, TextFilePatchInProgress> patchGroupsToApply, @Nullable LocalChangeList localList, @Nullable String fileName, @Nullable ThrowableComputable<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo) { if (fileName == nu...
apply
261,392
String () { return myName; }
getName
261,393
CharSequence (@NotNull Project project, @NotNull String path, CommitContext commitContext) { return myMap.get(path); }
provideContent
261,394
void (@NotNull Project project, @NotNull String path, @NotNull CharSequence content, CommitContext commitContext) { throw new UnsupportedOperationException(); }
consumeContentBeforePatchApplied
261,395
void (String fileName, CharSequence value) { myMap.put(fileName, value); }
put
261,396
String () { return VcsBundle.message("action.name.create.patch"); }
getActionText
261,397
String () { return "reference.dialogs.vcs.patch.create"; }
getHelpId
261,398
boolean () { return true; }
supportsPartialCommit
261,399
CommitSession (@NotNull CommitContext commitContext) { return createCommitSession(myProject, new DefaultPatchBuilder(myProject), commitContext); }
createCommitSession