本文整理汇总了Java中org.tmatesoft.svn.core.wc2.SvnTarget.fromURL方法的典型用法代码示例。如果您正苦于以下问题:Java SvnTarget.fromURL方法的具体用法?Java SvnTarget.fromURL怎么用?Java SvnTarget.fromURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tmatesoft.svn.core.wc2.SvnTarget
的用法示例。
在下文中一共展示了SvnTarget.fromURL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: remoteFolderIsEmpty
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
public static boolean remoteFolderIsEmpty(final SvnVcs vcs, final String url) throws VcsException {
SvnTarget target = SvnTarget.fromURL(createUrl(url));
final Ref<Boolean> result = new Ref<Boolean>(true);
DirectoryEntryConsumer handler = new DirectoryEntryConsumer() {
@Override
public void consume(final DirectoryEntry entry) throws SVNException {
if (entry != null) {
result.set(false);
}
}
};
vcs.getFactory(target).createBrowseClient().list(target, null, Depth.IMMEDIATES, handler);
return result.get();
}
示例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: doUpdate
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
protected long doUpdate(final File root) throws VcsException {
final SvnConfiguration svnConfig = SvnConfiguration.getInstance(myVcs.getProject());
MergeRootInfo info = svnConfig.getMergeRootInfo(root, myVcs);
if (info.getUrlString1().equals(info.getUrlString2()) &&
info.getRevision1().equals(info.getRevision2())) {
return 0;
}
MergeClient client = myVcs.getFactory(root).createMergeClient();
SvnTarget source1 = SvnTarget.fromURL(info.getUrl1(), info.getRevision1());
SvnTarget source2 = SvnTarget.fromURL(info.getUrl2(), info.getRevision2());
client.merge(source1, source2, root, svnConfig.getUpdateDepth(), svnConfig.isMergeDiffUseAncestry(), svnConfig.isMergeDryRun(), false, false,
svnConfig.getMergeOptions(), myHandler);
return info.getResultRevision();
}
示例4: doMkdir
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
protected static void doMkdir(final SVNURL url, final String comment, final Project project) {
final Ref<Exception> exception = new Ref<Exception>();
Runnable command = new Runnable() {
public void run() {
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.setText(SvnBundle.message("progress.text.browser.creating", url.toString()));
}
SvnVcs vcs = SvnVcs.getInstance(project);
SvnTarget target = SvnTarget.fromURL(url);
try {
vcs.getFactoryFromSettings().createBrowseClient().createDirectory(target, comment, false);
}
catch (VcsException e) {
exception.set(e);
}
}
};
ProgressManager.getInstance().runProcessWithProgressSynchronously(command, SvnBundle.message("progress.text.create.remote.folder"), false, project);
if (!exception.isNull()) {
Messages.showErrorDialog(exception.get().getMessage(), SvnBundle.message("message.text.error"));
}
}
示例5: getDeletionRevision
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
public long getDeletionRevision() {
if (! detectStartRevision()) return -1;
final Ref<Long> latest = new Ref<Long>(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();
}
示例6: run
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
private void run(@NotNull SVNURL branchURL, @NotNull Consumer<CopyData> copyDataConsumer) throws VcsException {
final SvnTarget target = SvnTarget.fromURL(branchURL);
HistoryClient client = ApplicationManager.getApplication().runReadAction(new Computable<HistoryClient>() {
@Override
public HistoryClient compute() {
if (myVcs.getProject().isDisposed()) return null;
return myVcs.getFactory(target).createHistoryClient();
}
});
if (client == null) return;
try {
client.doLog(target, SVNRevision.HEAD, SVNRevision.create(0), false, true, false, -1, null,
new MyLogEntryHandler(copyDataConsumer, myTrunkUrl, myBranchUrl));
}
catch (SvnBindException e) {
// do not throw cancel exception as this means corresponding copy point is found (if progress indicator was not explicitly cancelled)
if (!e.contains(SVNErrorCode.CANCELLED)) {
throw e;
}
}
}
示例7: loadBackwards
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
private void loadBackwards(SVNURL svnurl) throws SVNException, VcsException {
// this method is called when svnurl does not exist in latest repository revision - thus concrete old revision is used for "info"
// command to get repository url
Info info = myVcs.getInfo(svnurl, myPeg, myPeg);
final SVNURL rootURL = info != null ? info.getRepositoryRootURL() : null;
final String root = rootURL != null ? rootURL.toString() : "";
String relativeUrl = myUrl;
if (myUrl.startsWith(root)) {
relativeUrl = myUrl.substring(root.length());
}
final RepositoryLogEntryHandler repositoryLogEntryHandler =
new RepositoryLogEntryHandler(myVcs, myUrl, SVNRevision.UNDEFINED, relativeUrl,
new ThrowableConsumer<VcsFileRevision, SVNException>() {
@Override
public void consume(VcsFileRevision revision) throws SVNException {
myConsumer.consume(revision);
}
}, rootURL);
repositoryLogEntryHandler.setThrowCancelOnMeetPathCreation(true);
SvnTarget target = SvnTarget.fromURL(rootURL, myFrom);
myVcs.getFactory(target).createHistoryClient()
.doLog(target, myFrom, myTo == null ? SVNRevision.create(1) : myTo, false, true, myShowMergeSources && mySupport15, 1, null,
repositoryLogEntryHandler);
}
示例8: searchFromHead
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
private FilePath searchFromHead(@NotNull SVNURL url) throws VcsException {
final SvnCopyPathTracker pathTracker = new SvnCopyPathTracker(repositoryUrl.toDecodedString(), repositoryRelativeUrl);
SvnTarget target = SvnTarget.fromURL(url);
myVcs.getFactory(target).createHistoryClient().doLog(target, SVNRevision.HEAD, revisionBefore, false, true, false, 0, null,
new LogEntryConsumer() {
@Override
public void consume(LogEntry logEntry) {
checkDisposed();
// date could be null for lists where there are paths that user has no rights to observe
if (logEntry.getDate() != null) {
pathTracker.accept(logEntry);
if (logEntry.getRevision() == revisionBefore.getNumber()) {
changeList[0] = createChangeList(logEntry);
}
}
}
}
);
FilePath path = pathTracker.getFilePath(myVcs);
return path == null ? filePath : path;
}
示例9: delete
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@Override
public long delete(@NotNull SVNURL url, @NotNull String message) throws VcsException {
SvnTarget target = SvnTarget.fromURL(url);
List<String> parameters = ContainerUtil.newArrayList();
CommandUtil.put(parameters, target);
parameters.add("--message");
parameters.add(message);
CmdCheckinClient.CommandListener listener = new CmdCheckinClient.CommandListener(null);
execute(myVcs, target, SvnCommandName.delete, parameters, listener);
return listener.getCommittedRevision();
}
示例10: getCommittedChangesImpl
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
private void getCommittedChangesImpl(@NotNull ChangeBrowserSettings settings,
@NotNull SvnRepositoryLocation location,
int maxCount,
@NotNull Consumer<LogEntry> resultConsumer,
boolean includeMergedRevisions,
boolean filterOutByDate) throws VcsException {
SvnTarget target = SvnTarget.fromURL(location.toSvnUrl(), createBeforeRevision(settings));
getCommittedChangesImpl(settings, target, maxCount, resultConsumer, includeMergedRevisions, filterOutByDate);
}
示例11: goUpInRepo
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
private SvnMergeInfoCache.MergeCheckResult goUpInRepo(final long revisionAsked,
final long targetRevision,
final SVNURL branchUrl,
final String trunkUrl) throws VcsException, SVNException {
SvnMergeInfoCache.MergeCheckResult result;
Set<Long> mergeInfo = myPathMergedMap.get(branchUrl.toString() + "@" + targetRevision);
if (mergeInfo != null) {
// take from self or first parent with info; do not go further
result = SvnMergeInfoCache.MergeCheckResult.getInstance(mergeInfo.contains(revisionAsked));
}
else {
SvnTarget target = SvnTarget.fromURL(branchUrl);
PropertyValue mergeinfoProperty = myVcs.getFactory(target).createPropertyClient()
.getProperty(target, SvnPropertyKeys.MERGE_INFO, false, SVNRevision.create(targetRevision));
if (mergeinfoProperty == null) {
final String newTrunkUrl = SVNPathUtil.removeTail(trunkUrl).trim();
final SVNURL newBranchUrl = branchUrl.removePathTail();
final String absoluteTrunk = SVNPathUtil.append(myInfo.getRepoUrl(), newTrunkUrl);
result = newTrunkUrl.length() <= 1 ||
newBranchUrl.toString().length() <= myInfo.getRepoUrl().length() ||
newBranchUrl.toString().equals(absoluteTrunk)
? SvnMergeInfoCache.MergeCheckResult.NOT_MERGED
: goUpInRepo(revisionAsked, targetRevision, newBranchUrl, newTrunkUrl);
}
else {
result = processMergeinfoProperty(branchUrl.toString() + "@" + targetRevision, revisionAsked, mergeinfoProperty, trunkUrl, false);
}
}
return result;
}
示例12: getDefaultConfiguration
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
private static SvnBranchConfigurationNew getDefaultConfiguration(@NotNull SvnVcs vcs, @NotNull SVNURL url)
throws SVNException, VcsException {
SvnBranchConfigurationNew result = new SvnBranchConfigurationNew();
result.setTrunkUrl(url.toString());
SVNURL branchLocationsParent = getBranchLocationsParent(url);
if (branchLocationsParent != null) {
SvnTarget target = SvnTarget.fromURL(branchLocationsParent);
vcs.getFactory(target).createBrowseClient().list(target, SVNRevision.HEAD, Depth.IMMEDIATES, createHandler(result, target.getURL()));
}
return result;
}
示例13: loadBranches
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
@NotNull
public List<SvnBranchItem> loadBranches() throws SVNException, VcsException {
SvnVcs vcs = SvnVcs.getInstance(myProject);
SVNURL branchesUrl = SVNURL.parseURIEncoded(myUrl);
List<SvnBranchItem> result = new LinkedList<SvnBranchItem>();
SvnTarget target = SvnTarget.fromURL(branchesUrl);
DirectoryEntryConsumer handler = createConsumer(result);
vcs.getFactory(target).create(BrowseClient.class, !myPassive).list(target, SVNRevision.HEAD, Depth.IMMEDIATES, handler);
Collections.sort(result);
return result;
}
示例14: run
import org.tmatesoft.svn.core.wc2.SvnTarget; //导入方法依赖的package包/类
public void run() {
final Collection<DirectoryEntry> entries = new TreeSet<DirectoryEntry>();
final RepositoryTreeNode node = myData.first;
final SvnVcs vcs = node.getVcs();
SvnAuthenticationProvider.forceInteractive();
DirectoryEntryConsumer handler = new DirectoryEntryConsumer() {
@Override
public void consume(final DirectoryEntry entry) throws SVNException {
entries.add(entry);
}
};
try {
SvnTarget target = SvnTarget.fromURL(node.getURL());
vcs.getFactoryFromSettings().createBrowseClient().list(target, SVNRevision.HEAD, Depth.IMMEDIATES, handler);
}
catch (final VcsException e) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
setError(myData, e.getMessage());
startNext();
}
});
return;
} finally {
SvnAuthenticationProvider.clearInteractive();
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
setResults(myData, ContainerUtil.newArrayList(entries));
startNext();
}
});
}
示例15: 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));
}