use of com.intellij.vcsUtil.VcsUtil 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);
}
Aggregations