use of com.intellij.openapi.vcs.changes.CurrentContentRevision in project intellij-community by JetBrains.
the class SvnProtocolsTest method testCommitImpl.
private File testCommitImpl(File wc1) throws IOException {
Assert.assertTrue(wc1.isDirectory());
final File file = FileUtil.createTempFile(wc1, "file", ".txt");
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file);
Assert.assertNotNull(vf);
final ArrayList<VirtualFile> files = new ArrayList<>();
files.add(vf);
final List<VcsException> exceptions = myVcs.getCheckinEnvironment().scheduleUnversionedFilesForAddition(files);
Assert.assertTrue(exceptions.isEmpty());
final Change change = new Change(null, new CurrentContentRevision(VcsUtil.getFilePath(vf)));
final List<VcsException> commit = myVcs.getCheckinEnvironment().commit(Collections.singletonList(change), "commit");
Assert.assertTrue(commit.isEmpty());
return file;
}
use of com.intellij.openapi.vcs.changes.CurrentContentRevision in project intellij-community by JetBrains.
the class AbstractFilePatchInProgress method getCurrentRevision.
private ContentRevision getCurrentRevision() {
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 myCurrentRevision;
}
use of com.intellij.openapi.vcs.changes.CurrentContentRevision in project intellij-community by JetBrains.
the class FileHistoryPanelImpl method getChanges.
@Nullable
private Change[] getChanges() {
final VcsFileRevision[] revisions = getSelectedRevisions();
if (revisions.length > 0) {
Arrays.sort(revisions, Comparator.comparing(VcsRevisionDescription::getRevisionNumber));
for (VcsFileRevision revision : revisions) {
if (!myHistorySession.isContentAvailable(revision)) {
return null;
}
}
final ContentRevision startRevision = new LoadedContentRevision(myFilePath, revisions[0], myVcs.getProject());
final ContentRevision endRevision = (revisions.length == 1) ? new CurrentContentRevision(myFilePath) : new LoadedContentRevision(myFilePath, revisions[revisions.length - 1], myVcs.getProject());
return new Change[] { new Change(startRevision, endRevision) };
}
return null;
}
use of com.intellij.openapi.vcs.changes.CurrentContentRevision in project intellij-community by JetBrains.
the class SvnNativeClientAuthTest method testCommitImpl.
private File testCommitImpl(File wc1) throws IOException {
Assert.assertTrue(wc1.isDirectory());
final File file = FileUtil.createTempFile(wc1, "file", ".txt");
final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file);
Assert.assertNotNull(vf);
final ArrayList<VirtualFile> files = new ArrayList<>();
files.add(vf);
final List<VcsException> exceptions = myVcs.getCheckinEnvironment().scheduleUnversionedFilesForAddition(files);
Assert.assertTrue(exceptions.isEmpty());
final Change change = new Change(null, new CurrentContentRevision(VcsUtil.getFilePath(vf)));
final List<VcsException> commit = myVcs.getCheckinEnvironment().commit(Collections.singletonList(change), "commit");
Assert.assertTrue(commit.isEmpty());
++myExpectedCreds;
++myExpectedCert;
return file;
}
Aggregations