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


Java VcsRevisionDescription类代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.history.VcsRevisionDescription的典型用法代码示例。如果您正苦于以下问题:Java VcsRevisionDescription类的具体用法?Java VcsRevisionDescription怎么用?Java VcsRevisionDescription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getCurrentRevisionDescription

import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的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

示例2: getCurrentRevisionDescription

import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的package包/类
private VcsRevisionDescription getCurrentRevisionDescription(File path) {
  final SVNWCClient client = myVcs.createWCClient();
  try {
    final SVNInfo svnInfo = client.doInfo(path, SVNRevision.UNDEFINED);
    
    if (svnInfo.getCommittedRevision().equals(SVNRevision.UNDEFINED) && ! svnInfo.getCopyFromRevision().equals(SVNRevision.UNDEFINED) &&
      svnInfo.getCopyFromURL() != null) {
      SVNURL copyUrl = svnInfo.getCopyFromURL();
      String localPath = myVcs.getSvnFileUrlMapping().getLocalPath(copyUrl.toString());
      if (localPath != null) {
        return getCurrentRevisionDescription(new File(localPath));
      }
    }
    final String message = getProperties(client, path);
    return new VcsRevisionDescriptionImpl(new SvnRevisionNumber(svnInfo.getCommittedRevision()), svnInfo.getCommittedDate(),
                                          svnInfo.getAuthor(), message);
  }
  catch (SVNException e) {
    LOG.debug(e);    // most likely the file is unversioned
    return null;
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:SvnDiffProvider.java

示例3: fileRecentlyChanged

import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的package包/类
@Nullable
@Override
public VcsRevisionNumber fileRecentlyChanged(VirtualFile vf) {
  final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
  final AbstractVcs vcs = vcsManager.getVcsFor(vf);
  if (vcs == null) return null;
  if (vcs.getDiffProvider() instanceof DiffMixin) {
    final VcsRevisionDescription description = ((DiffMixin)vcs.getDiffProvider()).getCurrentRevisionDescription(vf);
    final Date date = description.getRevisionDate();
    return isRecent(date) ? description.getRevisionNumber() : null;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:VcsContentAnnotationImpl.java

示例4: getCurrentRevisionDescription

import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的package包/类
@Nullable
@Override
public VcsRevisionDescription getCurrentRevisionDescription(final VirtualFile file) {
  if (file.isDirectory()) {
    return null;
  }
  try {
    return GitHistoryUtils.getCurrentRevisionDescription(myProject, VcsUtil.getFilePath(file.getPath()), null);
  }
  catch (VcsException e) {
    return null;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:GitDiffProvider.java

示例5: getCurrentRevisionDescription

import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的package包/类
@Nullable
public static VcsRevisionDescription getCurrentRevisionDescription(final Project project, FilePath filePath, @Nullable String branch) throws VcsException {
  filePath = getLastCommitName(project, filePath);
  GitSimpleHandler h = new GitSimpleHandler(project, GitUtil.getGitRoot(filePath), GitCommand.LOG);
  GitLogParser parser = new GitLogParser(project, HASH, COMMIT_TIME, AUTHOR_NAME, COMMITTER_NAME, SUBJECT, BODY, RAW_BODY);
  h.setSilent(true);
  h.addParameters("-n1", parser.getPretty());
  if (branch != null && !branch.isEmpty()) {
    h.addParameters(branch);
  } else {
    h.addParameters("--all");
  }
  h.endOptions();
  h.addRelativePaths(filePath);
  String result = h.run();
  if (result.length() == 0) {
    return null;
  }
  final GitLogRecord record = parser.parseOneRecord(result);
  if (record == null) {
    return null;
  }
  record.setUsedHandler(h);

  final String author = Comparing.equal(record.getAuthorName(), record.getCommitterName()) ? record.getAuthorName() :
                  record.getAuthorName() + " (" + record.getCommitterName() + ")";
  return new VcsRevisionDescriptionImpl(new GitRevisionNumber(record.getHash(), record.getDate()), record.getDate(), author,
                                        record.getFullMessage());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:GitHistoryUtils.java

示例6: getCurrentRevisionDescription

import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的package包/类
@Nullable
VcsRevisionDescription getCurrentRevisionDescription(final VirtualFile file);
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:DiffMixin.java

示例7: createMessage

import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的package包/类
private static String createMessage(VcsRevisionDescription description, final VirtualFile vf) {
  return "<html><head>" + UIUtil.getCssFontDeclaration(UIUtil.getLabelFont()) + "</head><body>" +
         VcsBundle.message("current.version.text", description.getAuthor(),
                           DateFormatUtil.formatPrettyDateTime(description.getRevisionDate()), description.getCommitMessage(),
                           description.getRevisionNumber().asString(), vf.getName()) + "</body></html>";
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ShowBaseRevisionAction.java

示例8: isBaseRevisionChanged

import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的package包/类
@Override
public boolean isBaseRevisionChanged(VcsRevisionNumber number) {
  final VcsRevisionDescription description = ((SvnDiffProvider)myVcs.getDiffProvider()).getCurrentRevisionDescription(myFile);
  return description != null && ! description.getRevisionNumber().equals(myBaseRevision);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:SvnFileAnnotation.java

示例9: assertRevision

import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的package包/类
private void assertRevision(VirtualFile vf1, SvnDiffProvider diffProvider, final long number) {
  final VcsRevisionDescription vf1Rev = diffProvider.getCurrentRevisionDescription(vf1);
  Assert.assertEquals(number, ((SvnRevisionNumber) vf1Rev.getRevisionNumber()).getLongRevisionNumber());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:SvnAnnotationIsClosedTest.java

示例10: assertRevision

import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的package包/类
private void assertRevision(VirtualFile vf1, SvnDiffProvider diffProvider, final long number) {
  final VcsRevisionDescription vf1Rev = diffProvider.getCurrentRevisionDescription(vf1);
  Assert.assertEquals(number, ((SvnRevisionNumber)vf1Rev.getRevisionNumber()).getLongRevisionNumber());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:SvnAnnotationIsClosedTest.java


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