use of com.intellij.openapi.vcs.FileStatus in project intellij-community by JetBrains.
the class CmdDiffClient method createChange.
@NotNull
private Change createChange(@NotNull SvnTarget target1, @NotNull SvnTarget target2, @NotNull DiffPath diffPath) throws SvnBindException {
// TODO: 1) Unify logic of creating Change instance with SvnDiffEditor and SvnChangeProviderContext
// TODO: 2) If some directory is switched, files inside it are returned as modified in "svn diff --summarize", even if they are equal
// TODO: to branch files by content - possibly add separate processing of all switched files
// TODO: 3) Properties change is currently not added as part of result change like in SvnChangeProviderContext.patchWithPropertyChange
SvnTarget subTarget1 = SvnUtil.append(target1, diffPath.path, true);
String relativePath = SvnUtil.getRelativeUrl(SvnUtil.toDecodedString(target1), SvnUtil.toDecodedString(subTarget1));
if (relativePath == null) {
throw new SvnBindException("Could not get relative path for " + target1 + " and " + subTarget1);
}
SvnTarget subTarget2 = SvnUtil.append(target2, FileUtil.toSystemIndependentName(relativePath));
FilePath target1Path = createFilePath(subTarget1, diffPath.isDirectory());
FilePath target2Path = createFilePath(subTarget2, diffPath.isDirectory());
FileStatus status = SvnStatusConvertor.convertStatus(SvnStatusHandler.getStatus(diffPath.itemStatus), SvnStatusHandler.getStatus(diffPath.propertiesStatus));
// statuses determine changes needs to be done to "target1" to get "target2" state
ContentRevision beforeRevision = status == FileStatus.ADDED ? null : createRevision(target1Path, target2Path, target1.getPegRevision(), status);
ContentRevision afterRevision = status == FileStatus.DELETED ? null : createRevision(target2Path, target1Path, target2.getPegRevision(), status);
return createChange(status, beforeRevision, afterRevision);
}
use of com.intellij.openapi.vcs.FileStatus in project intellij-community by JetBrains.
the class SvnDiffEditor method addDir.
public void addDir(String path, String copyFromPath, long copyFromRevision) throws SVNException {
FileStatus status = FileStatus.ADDED;
if (myChanges.containsKey(path) && myChanges.get(path).getFileStatus() == FileStatus.DELETED) {
// replaced file
myChanges.remove(path);
status = FileStatus.MODIFIED;
}
Change change = createChange(path, status);
myChanges.put(path, change);
}
use of com.intellij.openapi.vcs.FileStatus in project intellij-community by JetBrains.
the class SvnDiffEditor method addFile.
public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException {
FileStatus status = FileStatus.ADDED;
if (myChanges.containsKey(path) && myChanges.get(path).getFileStatus() == FileStatus.DELETED) {
// replaced file
myChanges.remove(path);
status = FileStatus.MODIFIED;
}
Change change = createChange(path, status);
myChanges.put(path, change);
}
use of com.intellij.openapi.vcs.FileStatus in project intellij-community by JetBrains.
the class FormNode method getFileStatus.
@Override
public FileStatus getFileStatus() {
for (BasePsiNode<? extends PsiElement> child : myChildren) {
final PsiElement value = child.getValue();
if (value == null || !value.isValid())
continue;
final FileStatus fileStatus = NavigationItemFileStatus.get(child);
if (fileStatus != FileStatus.NOT_CHANGED) {
return fileStatus;
}
}
return FileStatus.NOT_CHANGED;
}
Aggregations