use of org.jetbrains.idea.svn.status.StatusClient in project intellij-community by JetBrains.
the class CmdCheckinClient method filterCommittables.
@NotNull
private List<File> filterCommittables(@NotNull List<File> committables) throws SvnBindException {
final Set<String> childrenOfSomebody = ContainerUtil.newHashSet();
new AbstractFilterChildren<File>() {
@Override
protected void sortAscending(List<File> list) {
Collections.sort(list);
}
@Override
protected boolean isAncestor(File parent, File child) {
// strict here will ensure that for case insensitive file systems paths different only by case will not be treated as ancestors
// of each other which is what we need to perform renames from one case to another on Windows
final boolean isAncestor = FileUtil.isAncestor(parent, child, true);
if (isAncestor) {
childrenOfSomebody.add(child.getPath());
}
return isAncestor;
}
}.doFilter(ContainerUtil.newArrayList(committables));
if (!childrenOfSomebody.isEmpty()) {
List<File> result = ContainerUtil.newArrayList();
StatusClient statusClient = myFactory.createStatusClient();
for (File file : committables) {
if (!childrenOfSomebody.contains(file.getPath())) {
result.add(file);
} else {
try {
final Status status = statusClient.doStatus(file, false);
if (status != null && !StatusType.STATUS_NONE.equals(status.getContentsStatus()) && !StatusType.STATUS_UNVERSIONED.equals(status.getContentsStatus())) {
result.add(file);
}
} catch (SvnBindException e) {
// not versioned
LOG.info(e);
throw e;
}
}
}
return result;
}
return committables;
}
use of org.jetbrains.idea.svn.status.StatusClient in project intellij-community by JetBrains.
the class SvnTreeConflictResolver method getDescendantsWithAddedStatus.
@NotNull
private Set<File> getDescendantsWithAddedStatus(@NotNull File ioFile) throws SvnBindException {
final Set<File> result = ContainerUtil.newHashSet();
StatusClient statusClient = myVcs.getFactory(ioFile).createStatusClient();
statusClient.doStatus(ioFile, SVNRevision.UNDEFINED, Depth.INFINITY, false, false, false, false, status -> {
if (status != null && StatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
result.add(status.getFile());
}
}, null);
return result;
}
use of org.jetbrains.idea.svn.status.StatusClient in project intellij-community by JetBrains.
the class MarkResolvedAction method collectResolvablePaths.
@NotNull
private static Collection<String> collectResolvablePaths(@NotNull SvnVcs vcs, @NotNull VirtualFile[] files) {
Collection<String> result = newTreeSet();
for (VirtualFile file : files) {
try {
File path = VfsUtilCore.virtualToIoFile(file);
StatusClient client = vcs.getFactory(path).createStatusClient();
client.doStatus(path, SVNRevision.UNDEFINED, Depth.INFINITY, false, false, false, false, status -> {
if (status.getContentsStatus() == StatusType.STATUS_CONFLICTED || status.getPropertiesStatus() == StatusType.STATUS_CONFLICTED) {
result.add(status.getFile().getAbsolutePath());
}
}, null);
} catch (SvnBindException e) {
LOG.warn(e);
}
}
return result;
}
Aggregations