use of org.jetbrains.idea.svn.info.Info in project intellij-community by JetBrains.
the class SvnUpdateEnvironment method checkAncestry.
// false - do not do update
private boolean checkAncestry(final File sourceFile, final SVNURL targetUrl, final SVNRevision targetRevision) throws SvnBindException {
final Info sourceSvnInfo = myVcs.getInfo(sourceFile);
final Info targetSvnInfo = myVcs.getInfo(targetUrl, targetRevision);
if (sourceSvnInfo == null || targetSvnInfo == null) {
// cannot check
return true;
}
final SVNURL copyFromTarget = targetSvnInfo.getCopyFromURL();
final SVNURL copyFromSource = sourceSvnInfo.getCopyFromURL();
if ((copyFromSource != null) || (copyFromTarget != null)) {
if (sourceSvnInfo.getURL().equals(copyFromTarget) || targetUrl.equals(copyFromSource)) {
return true;
}
}
final int result = Messages.showYesNoDialog(myVcs.getProject(), SvnBundle.message("switch.target.not.copy.current"), SvnBundle.message("switch.target.problem.title"), Messages.getWarningIcon());
return (Messages.YES == result);
}
use of org.jetbrains.idea.svn.info.Info in project intellij-community by JetBrains.
the class LatestExistentSearcher method detectStartRevision.
private boolean detectStartRevision() {
if (!myStartExistsKnown) {
final SvnFileUrlMapping mapping = myVcs.getSvnFileUrlMapping();
final RootUrlInfo rootUrlInfo = mapping.getWcRootForUrl(myUrl.toString());
if (rootUrlInfo == null)
return true;
final VirtualFile vf = rootUrlInfo.getVirtualFile();
final Info info = myVcs.getInfo(vf);
if ((info == null) || (info.getRevision() == null)) {
return false;
}
myStartNumber = info.getRevision().getNumber();
myStartExistsKnown = true;
}
return true;
}
use of org.jetbrains.idea.svn.info.Info 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.info.Info in project intellij-community by JetBrains.
the class SvnRollbackEnvironment method revertFileOrDir.
private void revertFileOrDir(@NotNull FilePath filePath) throws SVNException, VcsException {
File file = filePath.getIOFile();
Info info = mySvnVcs.getInfo(file);
if (info != null) {
if (info.isFile()) {
doRevert(file, false);
} else if (Info.SCHEDULE_ADD.equals(info.getSchedule()) || is17OrGreaterCopy(file, info)) {
doRevert(file, true);
} else {
// do update to restore missing directory.
mySvnVcs.getSvnKitManager().createUpdateClient().doUpdate(file, SVNRevision.HEAD, true);
}
} else {
throw new VcsException("Can not get 'svn info' for " + file.getPath());
}
}
use of org.jetbrains.idea.svn.info.Info in project intellij-community by JetBrains.
the class CmdStatusClient method doStatus.
@Override
public long doStatus(@NotNull final File path, @Nullable final SVNRevision revision, @NotNull final Depth depth, boolean remote, boolean reportAll, boolean includeIgnored, boolean collectParentExternals, @NotNull final StatusConsumer handler, @Nullable final Collection changeLists) throws SvnBindException {
File base = CommandUtil.requireExistingParent(path);
final Info infoBase = myFactory.createInfoClient().doInfo(base, revision);
List<String> parameters = new ArrayList<>();
putParameters(parameters, path, depth, remote, reportAll, includeIgnored, changeLists);
CommandExecutor command = execute(myVcs, SvnTarget.fromFile(path), SvnCommandName.st, parameters, null);
parseResult(path, revision, handler, base, infoBase, command);
return 0;
}
Aggregations