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