use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.
the class CmdHistoryClient method doLog.
@Override
public void doLog(@NotNull SvnTarget target, @NotNull SVNRevision startRevision, @NotNull SVNRevision endRevision, boolean stopOnCopy, boolean discoverChangedPaths, boolean includeMergedRevisions, long limit, @Nullable String[] revisionProperties, @Nullable LogEntryConsumer handler) throws VcsException {
// TODO: add revision properties parameter if necessary
List<String> parameters = prepareCommand(target, startRevision, endRevision, stopOnCopy, discoverChangedPaths, includeMergedRevisions, limit);
try {
CommandExecutor command = execute(myVcs, target, SvnCommandName.log, parameters, null);
// TODO: handler should be called in parallel with command execution, but this will be in other thread
// TODO: check if that is ok for current handler implementation
parseOutput(command, handler);
} catch (SVNException e) {
throw new SvnBindException(e);
}
}
use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.
the class LatestExistentSearcher method existsInRevision.
private boolean existsInRevision(@NotNull SVNURL url, long revisionNumber) throws SvnBindException {
SVNRevision revision = SVNRevision.create(revisionNumber);
Info info = null;
try {
info = myVcs.getInfo(url, revision, revision);
} catch (SvnBindException e) {
// throw error if not "does not exist" error code
if (!e.contains(SVNErrorCode.RA_ILLEGAL_URL)) {
throw e;
}
}
return info != null;
}
use of org.jetbrains.idea.svn.commandLine.SvnBindException 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 org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.
the class CmdDiffClient method compare.
@NotNull
@Override
public List<Change> compare(@NotNull SvnTarget target1, @NotNull SvnTarget target2) throws VcsException {
assertUrl(target1);
if (target2.isFile()) {
// Such combination (file and url) with "--summarize" option is supported only in svn 1.8.
// For svn 1.7 "--summarize" is only supported when both targets are repository urls.
assertDirectory(target2);
WorkingCopyFormat format = WorkingCopyFormat.from(myFactory.createVersionClient().getVersion());
if (format.less(WorkingCopyFormat.ONE_DOT_EIGHT)) {
throw new SvnBindException("Could not compare local file and remote url with executable for svn " + format);
}
}
List<String> parameters = new ArrayList<>();
CommandUtil.put(parameters, target1);
CommandUtil.put(parameters, target2);
parameters.add("--xml");
parameters.add("--summarize");
CommandExecutor executor = execute(myVcs, target1, SvnCommandName.diff, parameters, null);
return parseOutput(target1, target2, executor);
}
use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.
the class CmdDiffClient method unifiedDiff.
@Override
public void unifiedDiff(@NotNull SvnTarget target1, @NotNull SvnTarget target2, @NotNull OutputStream output) throws VcsException {
assertUrl(target1);
assertUrl(target2);
List<String> parameters = ContainerUtil.newArrayList();
CommandUtil.put(parameters, target1);
CommandUtil.put(parameters, target2);
CommandExecutor executor = execute(myVcs, target1, SvnCommandName.diff, parameters, null);
try {
executor.getBinaryOutput().writeTo(output);
} catch (IOException e) {
throw new SvnBindException(e);
}
}
Aggregations