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


Java Info类代码示例

本文整理汇总了Java中org.jetbrains.idea.svn.info.Info的典型用法代码示例。如果您正苦于以下问题:Java Info类的具体用法?Java Info怎么用?Java Info使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Info类属于org.jetbrains.idea.svn.info包,在下文中一共展示了Info类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doStatus

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@Override
public long doStatus(@NotNull final File path,
                     @Nullable final SVNRevision revision,
                     @NotNull final Depth depth,
                     boolean remote,
                     boolean reportAll,
                     boolean includeIgnored,
                     boolean collectParentExternals,
                     @NotNull final StatusConsumer handler,
                     @Nullable final Collection changeLists) throws SvnBindException {
  File base = CommandUtil.requireExistingParent(path);
  final Info infoBase = myFactory.createInfoClient().doInfo(base, revision);
  List<String> parameters = new ArrayList<String>();

  putParameters(parameters, path, depth, remote, reportAll, includeIgnored, changeLists);

  CommandExecutor command = execute(myVcs, SvnTarget.fromFile(path), SvnCommandName.st, parameters, null);
  parseResult(path, revision, handler, base, infoBase, command);
  return 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:CmdStatusClient.java

示例2: revertFileOrDir

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private void revertFileOrDir(@NotNull FilePath filePath) throws SVNException, VcsException {
  File file = filePath.getIOFile();
  Info info = mySvnVcs.getInfo(file);
  if (info != null) {
    if (info.isFile()) {
      doRevert(file, false);
    }
    else if (Info.SCHEDULE_ADD.equals(info.getSchedule()) || is17OrGreaterCopy(file, info)) {
      doRevert(file, true);
    }
    else {
      // do update to restore missing directory.
      mySvnVcs.getSvnKitManager().createUpdateClient().doUpdate(file, SVNRevision.HEAD, true);
    }
  }
  else {
    throw new VcsException("Can not get 'svn info' for " + file.getPath());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SvnRollbackEnvironment.java

示例3: get

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@Nullable
@Override
public Repository get() {
  Repository result;

  if (myTarget.isURL()) {
    // TODO: Also could still execute info when target is url - either to use info for authentication or to just get correct repository
    // TODO: url in case of "read" operations are allowed anonymously.
    result = new Repository(myTarget.getURL());
  }
  else {
    Info info = myVcs.getInfo(myTarget.getFile());
    result = info != null ? new Repository(info.getRepositoryRootURL()) : null;
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:InfoCommandRepositoryProvider.java

示例4: createInfoHandler

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@NotNull
private static InfoConsumer createInfoHandler(@NotNull final Map<VirtualFile, VcsRevisionNumber> revisionMap,
                                              @NotNull final Map<String, VirtualFile> fileMap) {
  return new InfoConsumer() {
    @Override
    public void consume(Info info) throws SVNException {
      if (info != null) {
        VirtualFile file = fileMap.get(info.getFile().getAbsolutePath());

        if (file != null) {
          revisionMap.put(file, getRevision(info));
        }
        else {
          LOG.info("Could not find virtual file for path " + info.getFile().getAbsolutePath());
        }
      }
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SvnDiffProvider.java

示例5: getCurrentRevisionDescription

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@Nullable
private VcsRevisionDescription getCurrentRevisionDescription(@NotNull File path) {
  final Info svnInfo = myVcs.getInfo(path);
  if (svnInfo == null) {
    return null;
  }

  if (svnInfo.getCommittedRevision().equals(SVNRevision.UNDEFINED) &&
      !svnInfo.getCopyFromRevision().equals(SVNRevision.UNDEFINED) &&
      svnInfo.getCopyFromURL() != null) {
    String localPath = myVcs.getSvnFileUrlMapping().getLocalPath(svnInfo.getCopyFromURL().toString());

    if (localPath != null) {
      return getCurrentRevisionDescription(new File(localPath));
    }
  }

  return new VcsRevisionDescriptionImpl(new SvnRevisionNumber(svnInfo.getCommittedRevision()), svnInfo.getCommittedDate(),
                                        svnInfo.getAuthor(), getCommitMessage(path, svnInfo));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:SvnDiffProvider.java

示例6: getCommitMessage

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@Nullable
private String getCommitMessage(@NotNull File path, @NotNull Info info) {
  String result;

  try {
    PropertyValue property =
      myVcs.getFactory(path).createPropertyClient()
        .getProperty(SvnTarget.fromFile(path), COMMIT_MESSAGE, true, info.getCommittedRevision());

    result = PropertyValue.toString(property);
  }
  catch (VcsException e) {
    LOG.info("Failed to get commit message for file " + path + ", " + info.getCommittedRevision() + ", " + info.getRevision(), e);
    result = "";
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SvnDiffProvider.java

示例7: 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

示例8: checkAncestry

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private boolean checkAncestry(final File sourceFile, final SVNURL targetUrl, final SVNRevision targetRevision) throws SvnBindException {
  final Info sourceSvnInfo = myVcs.getInfo(sourceFile);
  final Info targetSvnInfo = myVcs.getInfo(targetUrl, targetRevision);

  if (sourceSvnInfo == null || targetSvnInfo == null) {
    // cannot check
    return true;
  }

  final SVNURL copyFromTarget = targetSvnInfo.getCopyFromURL();
  final SVNURL copyFromSource = sourceSvnInfo.getCopyFromURL();

  if ((copyFromSource != null) || (copyFromTarget != null)) {
    if (sourceSvnInfo.getURL().equals(copyFromTarget) || targetUrl.equals(copyFromSource)) {
      return true;
    }
  }

  final int result = Messages.showYesNoDialog(myVcs.getProject(), SvnBundle.message("switch.target.not.copy.current"),
                                              SvnBundle.message("switch.target.problem.title"), Messages.getWarningIcon());
  return (Messages.YES == result);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:SvnUpdateEnvironment.java

示例9: 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

示例10: 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

示例11: resolveRevisionNumber

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private SVNRevision resolveRevisionNumber(@NotNull File path, @Nullable SVNRevision revision) throws VcsException {
  long result = revision != null ? revision.getNumber() : -1;

  // base should be resolved manually - could not set revision to BASE to get revision property
  if (SVNRevision.BASE.equals(revision)) {
    Info info = myVcs.getInfo(path, SVNRevision.BASE);

    result = info != null ? info.getRevision().getNumber() : -1;
  }

  if (result == -1) {
    throw new VcsException("Could not determine revision number for file " + path + " and revision " + revision);
  }

  return SVNRevision.create(result);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CmdPropertyClient.java

示例12: list

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@Override
public void list(@NotNull SvnTarget target,
                 @Nullable SVNRevision revision,
                 @Nullable Depth depth,
                 @Nullable DirectoryEntryConsumer handler) throws VcsException {
  assertUrl(target);

  List<String> parameters = new ArrayList<String>();

  CommandUtil.put(parameters, target);
  CommandUtil.put(parameters, revision);
  CommandUtil.put(parameters, depth);
  parameters.add("--xml");

  CommandExecutor command = execute(myVcs, target, SvnCommandName.list, parameters, null);
  Info info = myFactory.createInfoClient().doInfo(target, revision);

  try {
    parseOutput(target.getURL(), command, handler, info != null ? info.getRepositoryRootURL() : null);
  }
  catch (SVNException e) {
    throw new SvnBindException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:CmdBrowseClient.java

示例13: existsInRevision

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private boolean existsInRevision(@NotNull SVNURL url, long revisionNumber) throws SvnBindException {
  SVNRevision revision = SVNRevision.create(revisionNumber);
  Info info = null;

  try {
    info = myVcs.getInfo(url, revision, revision);
  }
  catch (SvnBindException e) {
    // throw error if not "does not exist" error code
    if (!e.contains(SVNErrorCode.RA_ILLEGAL_URL)) {
      throw e;
    }
  }

  return info != null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:LatestExistentSearcher.java

示例14: doRemoteDetails

import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private void doRemoteDetails() throws SVNException, SvnBindException {
  for (Pair<Integer, Boolean> idxData : myWithoutDirStatus) {
    final Change sourceChange = myDetailedList.get(idxData.first.intValue());
    final SvnRepositoryContentRevision revision = (SvnRepositoryContentRevision)
        (idxData.second.booleanValue() ? sourceChange.getBeforeRevision() : sourceChange.getAfterRevision());
    if (revision == null) {
      continue;
    }
    // TODO: Logic with detecting "isDirectory" status is not clear enough. Why we can't just collect this info from logEntry and
    // TODO: if loading from disk - use cached values? Not to invoke separate call here.
    SVNRevision beforeRevision = SVNRevision.create(getRevision(idxData.second.booleanValue()));
    Info info = myVcs.getInfo(SvnUtil.createUrl(revision.getFullPath()), beforeRevision, beforeRevision);
    boolean isDirectory = info != null && info.isDirectory();
    Change replacingChange = new Change(createRevision((SvnRepositoryContentRevision)sourceChange.getBeforeRevision(), isDirectory),
                                        createRevision((SvnRepositoryContentRevision)sourceChange.getAfterRevision(), isDirectory));
    replacingChange.setIsReplaced(sourceChange.isIsReplaced());
    myDetailedList.set(idxData.first.intValue(), replacingChange);
  }

  myWithoutDirStatus.clear();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SvnChangeList.java

示例15: loadBackwards

import org.jetbrains.idea.svn.info.Info; //导入依赖的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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnHistoryProvider.java


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