use of com.intellij.openapi.vcs.changes.ContentRevision in project intellij-community by JetBrains.
the class SvnCommittedViewTest method printChanges.
private static String printChanges(final Data data, final Collection<Change> changes) {
final StringBuilder sb = new StringBuilder("Data: ").append(data.myLocalPath).append(" exists: ").append(new File(data.myLocalPath).exists()).append(" Changes: ");
for (Change change : changes) {
final ContentRevision cr = change.getAfterRevision() == null ? change.getBeforeRevision() : change.getAfterRevision();
final File ioFile = cr.getFile().getIOFile();
sb.append("'").append(ioFile.getAbsolutePath()).append("' exists: ").append(ioFile.exists()).append(" | ");
}
return sb.toString();
}
use of com.intellij.openapi.vcs.changes.ContentRevision in project intellij-community by JetBrains.
the class GitChangesCollector method dirtyPaths.
/**
* Collect dirty file paths
*
* @param includeChanges if true, previous changes are included in collection
* @return the set of dirty paths to check, the paths are automatically collapsed if the summary length more than limit
*/
protected Collection<FilePath> dirtyPaths(boolean includeChanges) {
final List<String> allPaths = new ArrayList<>();
for (FilePath p : myDirtyScope.getRecursivelyDirtyDirectories()) {
addToPaths(p, allPaths);
}
for (FilePath p : myDirtyScope.getDirtyFilesNoExpand()) {
addToPaths(p, allPaths);
}
if (includeChanges) {
for (Change c : myChangeListManager.getChangesIn(myVcsRoot)) {
switch(c.getType()) {
case NEW:
case DELETED:
case MOVED:
ContentRevision afterRevision = c.getAfterRevision();
if (afterRevision != null) {
addToPaths(afterRevision.getFile(), allPaths);
}
ContentRevision beforeRevision = c.getBeforeRevision();
if (beforeRevision != null) {
addToPaths(beforeRevision.getFile(), allPaths);
}
case MODIFICATION:
default:
}
}
}
removeCommonParents(allPaths);
return ContainerUtil.map(allPaths, VcsUtil::getFilePath);
}
use of com.intellij.openapi.vcs.changes.ContentRevision in project intellij-community by JetBrains.
the class GitNewChangesCollector method reportModified.
private void reportModified(String filepath, VcsRevisionNumber head) throws VcsException {
ContentRevision before = GitContentRevision.createRevision(myVcsRoot, filepath, head, myProject, false, true, false);
ContentRevision after = GitContentRevision.createRevision(myVcsRoot, filepath, null, myProject, false, false, false);
reportChange(FileStatus.MODIFIED, before, after);
}
use of com.intellij.openapi.vcs.changes.ContentRevision in project intellij-community by JetBrains.
the class GitNewChangesCollector method reportTypeChanged.
private void reportTypeChanged(String filepath, VcsRevisionNumber head) throws VcsException {
ContentRevision before = GitContentRevision.createRevision(myVcsRoot, filepath, head, myProject, false, true, false);
ContentRevision after = GitContentRevision.createRevisionForTypeChange(myProject, myVcsRoot, filepath, null, false);
reportChange(FileStatus.MODIFIED, before, after);
}
use of com.intellij.openapi.vcs.changes.ContentRevision in project intellij-community by JetBrains.
the class GitNewChangesCollector method reportDeleted.
private void reportDeleted(String filepath, VcsRevisionNumber head) throws VcsException {
ContentRevision before = GitContentRevision.createRevision(myVcsRoot, filepath, head, myProject, true, true, false);
ContentRevision after = null;
reportChange(FileStatus.DELETED, before, after);
}
Aggregations