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


Java HgUtil.getOriginalFileName方法代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:HgAnnotationProvider.java

示例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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:HgLogCommand.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:HgHistoryUtil.java


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