本文整理汇总了Java中org.tmatesoft.svn.core.wc2.SvnTarget.fromFile方法的典型用法代码示例。如果您正苦于以下问题:Java SvnTarget.fromFile方法的具体用法?Java SvnTarget.fromFile怎么用?Java SvnTarget.fromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tmatesoft.svn.core.wc2.SvnTarget
的用法示例。
在下文中一共展示了SvnTarget.fromFile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: revert
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@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());
}
}
示例2: append
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
public static SvnTarget append(@NotNull SvnTarget target, @NotNull String path, boolean checkAbsolute) throws SvnBindException {
SvnTarget result;
if (target.isFile()) {
result = SvnTarget.fromFile(resolvePath(target.getFile(), path));
}
else {
try {
result = SvnTarget
.fromURL(checkAbsolute && URI.create(path).isAbsolute() ? SVNURL.parseURIEncoded(path) : target.getURL().appendPath(path, false));
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}
return result;
}
示例3: getPropertyList
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
private static List<PropertyData> getPropertyList(@NotNull SvnVcs vcs,
@Nullable final ContentRevision contentRevision,
@Nullable final SVNRevision revision)
throws SVNException, VcsException {
if (contentRevision == null) {
return Collections.emptyList();
}
SvnTarget target;
if (contentRevision instanceof SvnRepositoryContentRevision) {
final SvnRepositoryContentRevision svnRevision = (SvnRepositoryContentRevision)contentRevision;
target = SvnTarget.fromURL(SVNURL.parseURIEncoded(svnRevision.getFullPath()), revision);
} else {
final File ioFile = contentRevision.getFile().getIOFile();
target = SvnTarget.fromFile(ioFile, revision);
}
return getPropertyList(vcs, target, revision);
}
示例4: mergeInfoChanged
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
private boolean mergeInfoChanged(final File file) {
SvnTarget target = SvnTarget.fromFile(file);
try {
PropertyValue current =
myVcs.getFactory(target).createPropertyClient().getProperty(target, SvnPropertyKeys.MERGE_INFO, false, SVNRevision.WORKING);
PropertyValue base =
myVcs.getFactory(target).createPropertyClient().getProperty(target, SvnPropertyKeys.MERGE_INFO, false, SVNRevision.BASE);
if (current != null) {
return base == null || !Comparing.equal(current, base);
}
}
catch (VcsException e) {
LOG.info(e);
}
return false;
}
示例5: compare
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@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(new File(myVirtualFile.getPath()));
changes.addAll(getClientFactory().createDiffClient().compare(target1, target2));
}
示例6: getChangesBetweenRevisions
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
@Override
protected List<Change> getChangesBetweenRevisions(@NotNull FilePath path, @NotNull SvnFileRevision rev1, @Nullable SvnFileRevision rev2)
throws VcsException {
File file = path.getIOFile();
SvnTarget target1 = SvnTarget.fromURL(SvnUtil.createUrl(rev1.getURL()), rev1.getRevision());
SvnTarget target2 = rev2 != null ? SvnTarget.fromURL(SvnUtil.createUrl(rev2.getURL()), rev2.getRevision()) : SvnTarget.fromFile(file);
return executeDiff(path, target1, target2);
}
示例7: checkPathGoingUp
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@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);
// we didn't find existing item on the path jet
// 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;
}