From 36bb84a47d06ff164e0845db7a44532df4ca31ed Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Mon, 28 Jun 2010 11:46:04 +0400 Subject: [PATCH] [Mercurial] IDEA-55943 Using FilePath instead of VirtualFile, because the last one is a VcsVirtualFile which is defined as not from the local file system. --- .../provider/annotate/HgAnnotationProvider.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/annotate/HgAnnotationProvider.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/annotate/HgAnnotationProvider.java index bc86be6c8a41..b9803ea0a377 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/annotate/HgAnnotationProvider.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/annotate/HgAnnotationProvider.java @@ -28,24 +28,22 @@ public class HgAnnotationProvider implements AnnotationProvider { private static final int DEFAULT_LIMIT = 500; - private final Project project; + private final Project myProject; public HgAnnotationProvider(Project project) { - this.project = project; + this.myProject = project; } public FileAnnotation annotate(VirtualFile file) throws VcsException { - VirtualFile vcsRoot = VcsUtil.getVcsRootFor(project, file); + final VirtualFile vcsRoot = VcsUtil.getVcsRootFor(myProject, VcsUtil.getFilePath(file.getPath())); if (vcsRoot == null) { throw new VcsException("vcs root is null"); } - HgFile hgFile = new HgFile(vcsRoot, VfsUtil.virtualToIoFile(file)); - HgAnnotateCommand hgAnnotateCommand = new HgAnnotateCommand(project); - HgLogCommand hgLogCommand = new HgLogCommand(project); + final HgFile hgFile = new HgFile(vcsRoot, VfsUtil.virtualToIoFile(file)); return new HgAnnotation( hgFile, - hgAnnotateCommand.execute(hgFile), - hgLogCommand.execute(hgFile, DEFAULT_LIMIT, false) + (new HgAnnotateCommand(myProject)).execute(hgFile), + (new HgLogCommand(myProject)).execute(hgFile, DEFAULT_LIMIT, false) ); }