本文整理汇总了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));
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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());
}
示例6: getCurrentRevisionDescription
import com.intellij.openapi.vcs.history.VcsRevisionDescription; //导入依赖的package包/类
@Nullable
VcsRevisionDescription getCurrentRevisionDescription(final VirtualFile file);
示例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>";
}
示例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);
}
示例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());
}
示例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());
}