本文整理汇总了Java中org.jetbrains.idea.svn.info.Info.getURL方法的典型用法代码示例。如果您正苦于以下问题:Java Info.getURL方法的具体用法?Java Info.getURL怎么用?Java Info.getURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jetbrains.idea.svn.info.Info
的用法示例。
在下文中一共展示了Info.getURL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLastRevision
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
@NotNull
private ItemLatestState getLastRevision(@NotNull File file) {
Status svnStatus = getFileStatus(file, true);
if (svnStatus == null || itemExists(svnStatus) && SVNRevision.UNDEFINED.equals(svnStatus.getRemoteRevision())) {
// IDEADEV-21785 (no idea why this can happen)
final Info info = myVcs.getInfo(file, SVNRevision.HEAD);
if (info == null || info.getURL() == null) {
LOG.info("No SVN status returned for " + file.getPath());
return defaultResult();
}
return createResult(info.getCommittedRevision(), true, false);
}
if (!itemExists(svnStatus)) {
return createResult(getLastExistingRevision(file, svnStatus), false, false);
}
return createResult(ObjectUtils.notNull(svnStatus.getRemoteRevision(), svnStatus.getRevision()), true, false);
}
示例2: checkAlive
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
@NotNull
private SvnMergeInfoCache.MergeCheckResult checkAlive(@NotNull SvnChangeList list, @NotNull String branchPath) {
final Info info = myVcs.getInfo(new File(branchPath));
if (info == null || info.getURL() == null || !SVNPathUtil.isAncestor(myBranch.getUrl(), info.getURL().toString())) {
return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
}
final String subPathUnderBranch = SVNPathUtil.getRelativePath(myBranch.getUrl(), info.getURL().toString());
MultiMap<SvnMergeInfoCache.MergeCheckResult, String> result = checkPaths(list, branchPath, subPathUnderBranch);
if (result.containsKey(SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS)) {
return SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS;
}
if (result.containsKey(SvnMergeInfoCache.MergeCheckResult.NOT_MERGED)) {
myPartlyMerged.put(list.getNumber(), result.get(SvnMergeInfoCache.MergeCheckResult.NOT_MERGED));
return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
}
return SvnMergeInfoCache.MergeCheckResult.MERGED;
}
示例3: init
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
protected void init() {
super.init();
SvnVcs vcs = SvnVcs.getInstance(myProject);
String revStr = "";
Info info = vcs.getInfo(mySrcFile);
if (info != null) {
mySrcURL = info.getURL() == null ? null : info.getURL().toString();
revStr = String.valueOf(info.getRevision());
myURL = mySrcURL;
}
if (myURL == null) {
return;
}
myWorkingCopyField.setText(mySrcFile.toString());
myRepositoryField.setText(mySrcURL);
myToURLText.setText(myURL);
myRevisionPanel.setRevisionText(revStr);
updateControls();
myWorkingCopyRadioButton.setSelected(true);
}
示例4: fillMapping
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
private void fillMapping(final SvnMapping mapping, final List<SvnCopyRootSimple> list) {
final LocalFileSystem lfs = LocalFileSystem.getInstance();
for (SvnCopyRootSimple simple : list) {
final VirtualFile copyRoot = lfs.findFileByIoFile(new File(simple.myCopyRoot));
final VirtualFile vcsRoot = lfs.findFileByIoFile(new File(simple.myVcsRoot));
if (copyRoot == null || vcsRoot == null) continue;
final SvnVcs vcs = SvnVcs.getInstance(myProject);
final Info svnInfo = vcs.getInfo(copyRoot);
if ((svnInfo == null) || (svnInfo.getRepositoryRootURL() == null)) continue;
Node node = new Node(copyRoot, svnInfo.getURL(), svnInfo.getRepositoryRootURL());
final RootUrlInfo info = new RootUrlInfo(node, SvnFormatSelector.findRootAndGetFormat(svnInfo.getFile()), vcsRoot);
mapping.add(info);
}
}
示例5: getURL
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
@Override
public SVNURL getURL() {
SVNURL url = super.getURL();
if (url == null) {
Info info = initInfo();
url = info != null ? info.getURL() : url;
}
return url;
}
示例6: annotateNonExisting
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
private SvnRemoteFileAnnotation annotateNonExisting(Pair<SvnChangeList, FilePath> pair,
VcsFileRevision revision,
Info info,
Charset charset, final VirtualFile current) throws VcsException, SVNException, IOException {
final File wasFile = pair.getSecond().getIOFile();
final File root = getCommonAncestor(wasFile, info.getFile());
if (root == null) throw new VcsException("Can not find relative path for " + wasFile.getPath() + "@" + revision.getRevisionNumber().asString());
final String relativePath = FileUtil.getRelativePath(root.getPath(), wasFile.getPath(), File.separatorChar);
if (relativePath == null) throw new VcsException("Can not find relative path for " + wasFile.getPath() + "@" + revision.getRevisionNumber().asString());
Info wcRootInfo = myVcs.getInfo(root);
if (wcRootInfo == null || wcRootInfo.getURL() == null) {
throw new VcsException("Can not find relative path for " + wasFile.getPath() + "@" + revision.getRevisionNumber().asString());
}
SVNURL wasUrl = wcRootInfo.getURL();
final String[] strings = relativePath.replace('\\','/').split("/");
for (String string : strings) {
wasUrl = wasUrl.appendPath(string, true);
}
final SVNRevision svnRevision = ((SvnRevisionNumber)revision.getRevisionNumber()).getRevision();
byte[] data = SvnUtil.getFileContents(myVcs, SvnTarget.fromURL(wasUrl), svnRevision, svnRevision);
final String contents = LoadTextUtil.getTextByBinaryPresentation(data, charset == null ? CharsetToolkit.UTF8_CHARSET : charset).toString();
final SvnRemoteFileAnnotation result = new SvnRemoteFileAnnotation(myVcs, contents, revision.getRevisionNumber(), current);
final AnnotationConsumer annotateHandler = createAnnotationHandler(ProgressManager.getInstance().getProgressIndicator(), result);
final boolean calculateMergeinfo = SvnConfiguration.getInstance(myVcs.getProject()).isShowMergeSourcesInAnnotate() &&
SvnUtil.checkRepositoryVersion15(myVcs, wasUrl.toString());
AnnotateClient client = myVcs.getFactory().createAnnotateClient();
client
.annotate(SvnTarget.fromURL(wasUrl, svnRevision), SVNRevision.create(1), svnRevision, calculateMergeinfo, getLogClientOptions(myVcs),
annotateHandler);
return result;
}
示例7: getUrl
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
@Nullable
public static SVNURL getUrl(final SvnVcs vcs, final File file) {
// todo for moved items?
final Info info = vcs.getInfo(file);
return info == null ? null : info.getURL();
}
示例8: calculateRoot
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
@Nullable
private WorkingCopy calculateRoot(@NotNull VirtualFile root) {
File workingCopyRoot = SvnUtil.getWorkingCopyRootNew(new File(root.getPath()));
WorkingCopy workingCopy = null;
if (workingCopyRoot != null) {
final Info svnInfo = myVcs.getInfo(workingCopyRoot);
if (svnInfo != null && svnInfo.getURL() != null) {
workingCopy = new WorkingCopy(workingCopyRoot, svnInfo.getURL(), true);
}
}
return registerWorkingCopy(root, workingCopy);
}
示例9: MergeRootInfo
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
public MergeRootInfo(File file, SvnVcs vcs) {
myRevision1 = SVNRevision.HEAD;
myRevision2 = SVNRevision.HEAD;
Info info = vcs.getInfo(file);
myUrl1 = info != null && info.getURL() != null ? info.getURL().toString() : "";
myUrl2 = myUrl1;
}
示例10: checkWorkingCopy
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
private void checkWorkingCopy(@NotNull File path) throws SvnBindException {
final Info info = myFactory.createInfoClient().doInfo(path, SVNRevision.UNDEFINED);
if (info == null || info.getURL() == null) {
throw new SvnBindException(SVNErrorCode.WC_NOT_WORKING_COPY, path.getPath());
}
}
示例11: goUp
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
@NotNull
private SvnMergeInfoCache.MergeCheckResult goUp(final long revisionAsked,
final long targetRevision,
final String branchRootPath,
final String path,
@NotNull String trunkUrl) throws SVNException, VcsException {
SvnMergeInfoCache.MergeCheckResult result;
String newTrunkUrl = SVNPathUtil.removeTail(trunkUrl).trim();
if (newTrunkUrl.length() == 0 || "/".equals(newTrunkUrl)) {
result = SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
}
else {
String newPath = new File(path).getParent();
if (newPath.length() < branchRootPath.length()) {
// we are higher than WC root -> go into repo only
if (targetRevision == -1) {
// no paths in local copy
result = SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS;
}
else {
Info svnInfo = myVcs.getInfo(new File(branchRootPath));
result = svnInfo == null || svnInfo.getURL() == null
? SvnMergeInfoCache.MergeCheckResult.NOT_MERGED
: goUpInRepo(revisionAsked, targetRevision, svnInfo.getURL().removePathTail(), newTrunkUrl);
}
}
else {
result = checkPathGoingUp(revisionAsked, targetRevision, branchRootPath, newPath, newTrunkUrl, false);
}
}
return result;
}
示例12: isOKActionEnabled
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
public boolean isOKActionEnabled() {
myErrorLabel.setText(" ");
if (myURL == null) {
return false;
}
if (myBranchOrTagRadioButton.isSelected() && myBranchTagBaseComboBox.getComboBox().getSelectedItem() == null) {
myErrorLabel.setText(SvnBundle.message("create.branch.no.base.location.error"));
return false;
}
String url = getToURL();
if (url != null && url.trim().length() > 0) {
if (myRepositoryRadioButton.isSelected()) {
SVNRevision revision;
try {
revision = myRevisionPanel.getRevision();
}
catch (ConfigurationException e) {
revision = SVNRevision.UNDEFINED;
}
if (!revision.isValid() || revision.isLocal()) {
myErrorLabel.setText(SvnBundle.message("create.branch.invalid.revision.error", myRevisionPanel.getRevisionText()));
return false;
}
return true;
}
else if (myWorkingCopyRadioButton.isSelected()) {
Info info = SvnVcs.getInstance(myProject).getInfo(mySrcFile);
String srcUrl = info != null && info.getURL() != null ? info.getURL().toString() : null;
if (srcUrl == null) {
myErrorLabel.setText(SvnBundle.message("create.branch.no.working.copy.error", myWorkingCopyField.getText()));
return false;
}
return true;
}
}
return false;
}
示例13: realTargetUrl
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
@Nullable
private static SVNURL realTargetUrl(final SvnVcs vcs, final WorkingCopyInfo info, final String targetBranchUrl) {
final Info svnInfo = vcs.getInfo(info.getLocalPath());
final SVNURL svnurl = svnInfo != null ? svnInfo.getURL() : null;
return (svnurl != null) && (svnurl.toString().startsWith(targetBranchUrl)) ? svnurl : null;
}
示例14: existsNow
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
private boolean existsNow(SVNURL svnurl) {
final Info info;
try {
info = myVcs.getInfo(svnurl, SVNRevision.HEAD, SVNRevision.HEAD);
}
catch (SvnBindException e) {
return false;
}
return info != null && info.getURL() != null && info.getRevision().isValid();
}
示例15: getExactLocation
import org.jetbrains.idea.svn.info.Info; //导入方法依赖的package包/类
@Nullable
public static String getExactLocation(final SvnVcs vcs, File path) {
Info info = vcs.getInfo(path);
return info != null && info.getURL() != null ? info.getURL().toString() : null;
}