use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.
the class LatestExistentSearcher method getDeletionRevision.
public long getDeletionRevision() {
if (!detectStartRevision())
return -1;
final Ref<Long> latest = new Ref<>(myStartNumber);
try {
if (myEndNumber == -1) {
myEndNumber = getLatestRevision();
}
final SVNURL existingParent = getExistingParent(myUrl);
if (existingParent == null) {
return myStartNumber;
}
final SVNRevision startRevision = SVNRevision.create(myStartNumber);
SvnTarget target = SvnTarget.fromURL(existingParent, startRevision);
myVcs.getFactory(target).createHistoryClient().doLog(target, startRevision, SVNRevision.HEAD, false, true, false, 0, null, createHandler(latest));
} catch (VcsException e) {
LOG.info(e);
}
return latest.get().longValue();
}
use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.
the class BranchMerger method mergeNext.
public void mergeNext() throws VcsException {
myAtStart = false;
File destination = new File(myTargetPath);
MergeClient client = myVcs.getFactory(destination).createMergeClient();
SvnTarget source = SvnTarget.fromURL(mySourceUrl);
if (mySupportsMergeInfo) {
client.merge(source, destination, false, myReintegrate, createDiffOptions(), myHandler);
} else {
mySourceLatestRevision = resolveSourceLatestRevision();
SVNRevisionRange range = new SVNRevisionRange(SVNRevision.create(mySourceCopyRevision), mySourceLatestRevision);
client.merge(source, range, destination, Depth.UNKNOWN, false, false, true, createDiffOptions(), myHandler);
}
}
use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.
the class CmdRevertClient method revert.
@Override
public void revert(@NotNull Collection<File> paths, @Nullable Depth depth, @Nullable ProgressTracker handler) throws VcsException {
if (!ContainerUtil.isEmpty(paths)) {
Command command = newCommand(SvnCommandName.revert);
command.put(depth);
command.setTargets(paths);
// 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
// TODO: add possibility to invoke "handler.checkCancelled" - process should be killed
SvnTarget target = SvnTarget.fromFile(ObjectUtils.assertNotNull(ContainerUtil.getFirstItem(paths)));
CommandExecutor executor = execute(myVcs, target, CommandUtil.getHomeDirectory(), command, null);
FileStatusResultParser parser = new FileStatusResultParser(CHANGED_PATH, handler, new RevertStatusConvertor());
parser.parse(executor.getOutput());
}
}
use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.
the class SvnUtil method remoteFolderIsEmpty.
public static boolean remoteFolderIsEmpty(@NotNull SvnVcs vcs, @NotNull String url) throws VcsException {
SvnTarget target = SvnTarget.fromURL(createUrl(url));
Ref<Boolean> result = new Ref<>(true);
DirectoryEntryConsumer handler = entry -> {
if (entry != null) {
result.set(false);
}
};
vcs.getFactory(target).createBrowseClient().list(target, null, Depth.IMMEDIATES, handler);
return result.get();
}
use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.
the class ShareProjectAction method createFolderStructure.
@NotNull
private static SvnTarget createFolderStructure(@NotNull SvnVcs vcs, @NotNull VirtualFile file, @NotNull ShareDialog.ShareTarget shareTarget, boolean createStandardStructure, @NotNull SVNURL parentUrl, @NotNull String commitText) throws VcsException {
switch(shareTarget) {
case useSelected:
return SvnTarget.fromURL(parentUrl, SVNRevision.HEAD);
case useProjectName:
return createRemoteFolder(vcs, parentUrl, file.getName(), commitText);
default:
SvnTarget projectRoot = createRemoteFolder(vcs, parentUrl, file.getName(), commitText);
SvnTarget trunk = createRemoteFolder(vcs, projectRoot.getURL(), "trunk", commitText);
if (createStandardStructure) {
createRemoteFolder(vcs, projectRoot.getURL(), "branches", commitText);
createRemoteFolder(vcs, projectRoot.getURL(), "tags", commitText);
}
return trunk;
}
}
Aggregations