本文整理匯總了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);
}