當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。