当前位置: 首页>>代码示例>>Java>>正文


Java Info.getURL方法代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SvnDiffProvider.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:BranchInfo.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:CreateBranchOrTagDialog.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SvnFileUrlMappingImpl.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PortableStatus.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:SvnAnnotationProvider.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:SvnUtil.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:RootsToWorkingCopies.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MergeRootInfo.java

示例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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:CmdUpdateClient.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:BranchInfo.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:CreateBranchOrTagDialog.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:IntegratedSelectedOptionsDialog.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:SvnHistoryProvider.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:SvnUtil.java


注:本文中的org.jetbrains.idea.svn.info.Info.getURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。