本文整理汇总了Java中org.zmlx.hg4idea.util.HgUtil.getOriginalFileName方法的典型用法代码示例。如果您正苦于以下问题:Java HgUtil.getOriginalFileName方法的具体用法?Java HgUtil.getOriginalFileName怎么用?Java HgUtil.getOriginalFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.zmlx.hg4idea.util.HgUtil
的用法示例。
在下文中一共展示了HgUtil.getOriginalFileName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: annotate
import org.zmlx.hg4idea.util.HgUtil; //导入方法依赖的package包/类
public FileAnnotation annotate(VirtualFile file, VcsFileRevision revision) throws VcsException {
final VirtualFile vcsRoot = VcsUtil.getVcsRootFor(myProject, VcsUtil.getFilePath(file.getPath()));
if (vcsRoot == null) {
throw new VcsException("vcs root is null for " + file);
}
final HgFile hgFile = new HgFile(vcsRoot, VfsUtilCore.virtualToIoFile(file));
HgFile fileToAnnotate = revision instanceof HgFileRevision
? HgUtil.getFileNameInTargetRevision(myProject, ((HgFileRevision)revision).getRevisionNumber(), hgFile)
: new HgFile(vcsRoot,
HgUtil.getOriginalFileName(hgFile.toFilePath(), ChangeListManager.getInstance(myProject)));
final List<HgAnnotationLine> annotationResult = (new HgAnnotateCommand(myProject)).execute(fileToAnnotate, revision);
final List<HgFileRevision> logResult;
try {
HgLogCommand logCommand = new HgLogCommand(myProject);
logCommand.setFollowCopies(true);
logResult = logCommand.execute(fileToAnnotate, -1, false);
}
catch (HgCommandException e) {
throw new VcsException("Can not annotate, " + HgVcsMessages.message("hg4idea.error.log.command.execution"), e);
}
VcsRevisionNumber revisionNumber = revision == null ?
new HgWorkingCopyRevisionsCommand(myProject).tip(vcsRoot) :
revision.getRevisionNumber();
return new HgAnnotation(myProject, hgFile, annotationResult, logResult, revisionNumber);
}
示例2: execute
import org.zmlx.hg4idea.util.HgUtil; //导入方法依赖的package包/类
/**
* @param limit Pass -1 to set no limits on history
*/
public final List<HgFileRevision> execute(final HgFile hgFile, int limit, boolean includeFiles, @Nullable List<String> argsForCmd)
throws HgCommandException {
if ((limit <= 0 && limit != -1) || hgFile == null) {
return Collections.emptyList();
}
String[] templates = HgBaseLogParser.constructFullTemplateArgument(includeFiles, myVersion);
String template = HgChangesetUtil.makeTemplate(templates);
FilePath originalFileName = HgUtil.getOriginalFileName(hgFile.toFilePath(), ChangeListManager.getInstance(myProject));
HgFile originalHgFile = new HgFile(hgFile.getRepo(), originalFileName);
HgCommandResult result = execute(hgFile.getRepo(), template, limit, originalHgFile, argsForCmd);
return HgHistoryUtil.getCommitRecords(myProject, result,
new HgFileRevisionLogParser(myProject, originalHgFile, myVersion));
}
示例3: getOriginalHgFile
import org.zmlx.hg4idea.util.HgUtil; //导入方法依赖的package包/类
public static HgFile getOriginalHgFile(Project project, VirtualFile root) {
HgFile hgFile = new HgFile(root, VcsUtil.getFilePath(root.getPath()));
if (project.isDisposed()) {
return hgFile;
}
FilePath originalFileName = HgUtil.getOriginalFileName(hgFile.toFilePath(), ChangeListManager.getInstance(project));
return new HgFile(hgFile.getRepo(), originalFileName);
}