use of org.tmatesoft.svn.core.wc2.SvnInfo in project GMM by Katharsas.
the class SVNTest method latestRevision.
/**
* Find out at which revision number the repo is at.
* Can also be used on single files to find out in which revision the last changed occured to them.
*/
public void latestRevision() throws SVNException {
final SvnGetInfo operation = svnOperationFactory.createGetInfo();
operation.setSingleTarget(workingCopy);
final SvnInfo info = operation.run();
final long revision = info.getRevision();
}
use of org.tmatesoft.svn.core.wc2.SvnInfo in project GMM by Katharsas.
the class SvnPlugin method checkRepoAvailable.
/**
* @return Root URL of the SVN repo as opposed to the checked out URL.
*/
private SVNURL checkRepoAvailable() {
final SvnGetInfo operation = svnOperationFactory.createGetInfo();
operation.setSingleTarget(repository);
try {
final SvnInfo info = operation.run();
logger.info("Successfully reached SVN repository at uri '" + repository.getPathOrUrlDecodedString() + "'.");
return info.getRepositoryRootUrl();
} catch (final SVNException e) {
logger.error("Could not reach SVN repository at uri '" + repository.getPathOrUrlDecodedString() + "'!", e);
throw new UncheckedSVNExeption(e);
}
}
use of org.tmatesoft.svn.core.wc2.SvnInfo in project omegat by omegat-org.
the class ConvertProject26to37team method getSVNTmxVersion.
/**
* Get version of "omegat/project_save.tmx" in SVN.
*/
private static String getSVNTmxVersion(File wc) throws Exception {
final SvnOperationFactory of = new SvnOperationFactory();
final SvnGetInfo infoOp = of.createGetInfo();
infoOp.setSingleTarget(SvnTarget.fromFile(new File(wc, "omegat/project_save.tmx")));
infoOp.setDepth(SVNDepth.EMPTY);
SvnInfo info = infoOp.run();
long r = info.getRevision();
return Long.toString(r);
}
use of org.tmatesoft.svn.core.wc2.SvnInfo in project intellij-community by JetBrains.
the class BranchInfo method checkPathGoingUp.
@NotNull
private SvnMergeInfoCache.MergeCheckResult checkPathGoingUp(final long revisionAsked, final long targetRevision, @NotNull String branchRootPath, @NotNull String path, final String trunkUrl, final boolean self) throws VcsException, SVNException {
SvnMergeInfoCache.MergeCheckResult result;
final File pathFile = new File(path);
// check whether we locally have path
if (targetRevision == -1 && !pathFile.exists()) {
result = goUp(revisionAsked, targetRevision, branchRootPath, path, trunkUrl);
} else {
final Info svnInfo = myVcs.getInfo(pathFile);
if (svnInfo == null || svnInfo.getURL() == null) {
LOG.info("Svninfo for " + pathFile + " is null or not full.");
result = SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
} else {
final long actualRevision = svnInfo.getRevision().getNumber();
final long targetRevisionCorrected = (targetRevision == -1) ? actualRevision : targetRevision;
// here we know local URL and revision
// check existing info
final String keyString = path + "@" + targetRevisionCorrected;
final Set<Long> selfInfo = self ? myNonInheritablePathMergedMap.get(keyString) : null;
final Set<Long> mergeInfo = myPathMergedMap.get(keyString);
if (mergeInfo != null || selfInfo != null) {
boolean merged = mergeInfo != null && mergeInfo.contains(revisionAsked) || selfInfo != null && selfInfo.contains(revisionAsked);
// take from self or first parent with info; do not go further
result = SvnMergeInfoCache.MergeCheckResult.getInstance(merged);
} else {
if (actualRevision != targetRevisionCorrected) {
myMixedRevisionsFound = true;
}
SvnTarget target;
SVNRevision revision;
if (actualRevision == targetRevisionCorrected) {
// look in WC
target = SvnTarget.fromFile(pathFile, SVNRevision.WORKING);
revision = SVNRevision.WORKING;
} else {
// in repo
target = SvnTarget.fromURL(svnInfo.getURL());
revision = SVNRevision.create(targetRevisionCorrected);
}
PropertyValue mergeinfoProperty = myVcs.getFactory(target).createPropertyClient().getProperty(target, SvnPropertyKeys.MERGE_INFO, false, revision);
result = mergeinfoProperty == null ? goUp(revisionAsked, targetRevisionCorrected, branchRootPath, path, trunkUrl) : processMergeinfoProperty(keyString, revisionAsked, mergeinfoProperty, trunkUrl, self);
}
}
}
return result;
}
use of org.tmatesoft.svn.core.wc2.SvnInfo in project omegat by omegat-org.
the class ConvertProject26to37team method getSVNUrl.
/**
* Get repository URL for SVN.
*/
private static String getSVNUrl(File wc) throws Exception {
final SvnOperationFactory of = new SvnOperationFactory();
final SvnGetInfo infoOp = of.createGetInfo();
infoOp.setSingleTarget(SvnTarget.fromFile(wc));
infoOp.setDepth(SVNDepth.EMPTY);
infoOp.setRevision(SVNRevision.WORKING);
final SvnInfo info = infoOp.run();
SVNURL svn = info.getUrl();
return svn.toString();
}
Aggregations