use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.
the class ShareProjectAction method createRemoteFolder.
@NotNull
private static SvnTarget createRemoteFolder(@NotNull SvnVcs vcs, @NotNull SVNURL parent, @NotNull String folderName, @NotNull String commitText) throws VcsException {
SVNURL url = append(parent, folderName);
String message = message("share.directory.commit.message", folderName, ApplicationNamesInfo.getInstance().getFullProductName(), commitText);
SvnTarget target = SvnTarget.fromURL(url);
progress(message("share.directory.create.dir.progress.text", url.toString()));
long revision = vcs.getFactoryFromSettings().createBrowseClient().createDirectory(target, message, false);
return SvnTarget.fromURL(url, SVNRevision.create(revision));
}
use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.
the class SvnCommittedChangesProvider method loadCommittedChanges.
@Override
public void loadCommittedChanges(@NotNull ChangeBrowserSettings settings, @NotNull RepositoryLocation location, int maxCount, @NotNull AsynchConsumer<CommittedChangeList> consumer) throws VcsException {
try {
SvnRepositoryLocation svnLocation = (SvnRepositoryLocation) location;
String repositoryRoot = getRepositoryRoot(svnLocation);
ChangeBrowserSettings.Filter filter = settings.createFilter();
Consumer<LogEntry> resultConsumer = logEntry -> {
SvnChangeList list = new SvnChangeList(myVcs, svnLocation, logEntry, repositoryRoot);
if (filter.accepts(list)) {
consumer.consume(list);
}
};
SvnTarget target = SvnTarget.fromURL(svnLocation.toSvnUrl(), createBeforeRevision(settings));
getCommittedChangesImpl(settings, target, maxCount, resultConsumer, false, true);
} finally {
consumer.finished();
}
}
use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.
the class SvnCommittedChangesProvider method getCommittedChanges.
@Override
@NotNull
public List<SvnChangeList> getCommittedChanges(@NotNull ChangeBrowserSettings settings, @NotNull RepositoryLocation location, int maxCount) throws VcsException {
SvnRepositoryLocation svnLocation = (SvnRepositoryLocation) location;
List<SvnChangeList> result = newArrayList();
String repositoryRoot = getRepositoryRoot(svnLocation);
Consumer<LogEntry> resultConsumer = logEntry -> result.add(new SvnChangeList(myVcs, svnLocation, logEntry, repositoryRoot));
SvnTarget target = SvnTarget.fromURL(svnLocation.toSvnUrl(), createBeforeRevision(settings));
getCommittedChangesImpl(settings, target, maxCount, resultConsumer, false, true);
settings.filterChanges(result);
return result;
}
use of org.tmatesoft.svn.core.wc2.SvnTarget 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.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.
the class DirectoryWithBranchComparer method compare.
@Override
protected void compare() throws SVNException, VcsException {
titleBuilder.append(SvnBundle.message("repository.browser.compare.title", myElementUrl, FileUtil.toSystemDependentName(myVirtualFile.getPresentableUrl())));
SvnTarget target1 = SvnTarget.fromURL(myElementUrl);
SvnTarget target2 = SvnTarget.fromFile(virtualToIoFile(myVirtualFile));
changes.addAll(getClientFactory().createDiffClient().compare(target1, target2));
}
Aggregations