use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.
the class CmdBrowseClient method list.
@Override
public void list(@NotNull SvnTarget target, @Nullable SVNRevision revision, @Nullable Depth depth, @Nullable DirectoryEntryConsumer handler) throws VcsException {
assertUrl(target);
List<String> parameters = new ArrayList<>();
CommandUtil.put(parameters, target);
CommandUtil.put(parameters, revision);
CommandUtil.put(parameters, depth);
parameters.add("--xml");
CommandExecutor command = execute(myVcs, target, SvnCommandName.list, parameters, null);
Info info = myFactory.createInfoClient().doInfo(target, revision);
try {
parseOutput(target.getURL(), command, handler, info != null ? info.getRepositoryRootURL() : null);
} catch (SVNException e) {
throw new SvnBindException(e);
}
}
use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.
the class SvnKitImportClient method doImport.
@Override
public long doImport(@NotNull File path, @NotNull SVNURL url, @Nullable Depth depth, @NotNull String message, boolean noIgnore, @Nullable CommitEventHandler handler, @Nullable ISVNCommitHandler commitHandler) throws VcsException {
SVNCommitClient client = myVcs.getSvnKitManager().createCommitClient();
client.setEventHandler(toEventHandler(handler));
client.setCommitHandler(commitHandler);
try {
SVNCommitInfo info = client.doImport(path, url, message, null, !noIgnore, false, toDepth(depth));
return info.getNewRevision();
} catch (SVNException e) {
throw new SvnBindException(e);
}
}
use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.
the class AuthenticationService method acceptSSLServerCertificate.
public boolean acceptSSLServerCertificate(@Nullable SVNURL repositoryUrl, final String realm) throws SvnBindException {
if (repositoryUrl == null) {
return false;
}
boolean result;
if (Registry.is("svn.use.svnkit.for.https.server.certificate.check")) {
result = new SSLServerCertificateAuthenticator(this, repositoryUrl, realm).tryAuthenticate();
} else {
HttpClient client = getClient(repositoryUrl);
try {
client.execute(new HttpGet(repositoryUrl.toDecodedString()));
result = true;
} catch (IOException e) {
throw new SvnBindException(fixMessage(e), e);
}
}
return result;
}
use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.
the class SvnKitCheckoutClient method checkout.
@Override
public void checkout(@NotNull SvnTarget source, @NotNull File destination, @Nullable SVNRevision revision, @Nullable Depth depth, boolean ignoreExternals, boolean force, @NotNull WorkingCopyFormat format, @Nullable ProgressTracker handler) throws VcsException {
assertUrl(source);
validateFormat(format, getSupportedFormats());
SVNUpdateClient client = myVcs.getSvnKitManager().createUpdateClient();
client.setIgnoreExternals(ignoreExternals);
client.setEventHandler(toEventHandler(handler));
try {
runCheckout(client, format, source, destination, revision, depth, force);
} catch (SVNException e) {
throw new SvnBindException(e);
}
}
use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.
the class SvnChangeProvider method processCopiedFile.
private void processCopiedFile(@NotNull SvnChangedFile copiedFile, @NotNull SvnChangeProviderContext context, @Nullable VcsDirtyScope dirtyScope) throws SVNException {
boolean foundRename = false;
final Status copiedStatus = copiedFile.getStatus();
final String copyFromURL = ObjectUtils.assertNotNull(copiedFile.getCopyFromURL());
final Set<SvnChangedFile> deletedToDelete = new HashSet<>();
for (SvnChangedFile deletedFile : context.getDeletedFiles()) {
final Status deletedStatus = deletedFile.getStatus();
if (deletedStatus.getURL() != null && Comparing.equal(copyFromURL, deletedStatus.getURL().toString())) {
final String clName = SvnUtil.getChangelistName(copiedFile.getStatus());
applyMovedChange(context, copiedFile.getFilePath(), dirtyScope, deletedToDelete, deletedFile, copiedStatus, clName);
for (SvnChangedFile deletedChild : context.getDeletedFiles()) {
final Status childStatus = deletedChild.getStatus();
final SVNURL childUrl = childStatus.getURL();
if (childUrl == null) {
continue;
}
final String childURL = childUrl.toDecodedString();
if (StringUtil.startsWithConcatenation(childURL, copyFromURL, "/")) {
String relativePath = childURL.substring(copyFromURL.length());
File newPath = new File(copiedFile.getFilePath().getIOFile(), relativePath);
FilePath newFilePath = myFactory.createFilePathOn(newPath);
if (!context.isDeleted(newFilePath)) {
applyMovedChange(context, newFilePath, dirtyScope, deletedToDelete, deletedChild, context.getTreeConflictStatus(newPath), clName);
}
}
}
foundRename = true;
break;
}
}
final List<SvnChangedFile> deletedFiles = context.getDeletedFiles();
for (SvnChangedFile file : deletedToDelete) {
deletedFiles.remove(file);
}
// by building a relative url
if (!foundRename && copiedStatus.getURL() != null) {
File wcPath = myVcs.getSvnFileUrlMapping().getLocalPath(copyFromURL);
if (wcPath != null) {
Status status;
try {
status = myVcs.getFactory(wcPath).createStatusClient().doStatus(wcPath, false);
} catch (SvnBindException ex) {
LOG.info(ex);
status = null;
}
if (status != null && status.is(StatusType.STATUS_DELETED)) {
final FilePath filePath = myFactory.createFilePathOnDeleted(wcPath, false);
final SvnContentRevision beforeRevision = SvnContentRevision.createBaseRevision(myVcs, filePath, status.getRevision());
final ContentRevision afterRevision = CurrentContentRevision.create(copiedFile.getFilePath());
context.getBuilder().processChangeInList(context.createMovedChange(beforeRevision, afterRevision, copiedStatus, status), SvnUtil.getChangelistName(status), SvnVcs.getKey());
foundRename = true;
}
}
}
if (!foundRename) {
// for debug
LOG.info("Rename not found for " + copiedFile.getFilePath().getPresentableUrl());
context.processStatus(copiedFile.getFilePath(), copiedStatus);
}
}
Aggregations