summaryrefslogtreecommitdiff
path: root/plugins/hg4idea/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/hg4idea/src/org')
-rw-r--r--plugins/hg4idea/src/org/zmlx/hg4idea/provider/annotate/HgAnnotationProvider.java8
1 files changed, 5 insertions, 3 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 eaad2b9a0e4c..5592151eea8f 100644
--- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/annotate/HgAnnotationProvider.java
+++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/annotate/HgAnnotationProvider.java
@@ -29,6 +29,7 @@ import org.zmlx.hg4idea.command.HgAnnotateCommand;
import org.zmlx.hg4idea.command.HgLogCommand;
import org.zmlx.hg4idea.command.HgWorkingCopyRevisionsCommand;
import org.zmlx.hg4idea.execution.HgCommandException;
+import org.zmlx.hg4idea.util.HgUtil;
import java.util.List;
@@ -52,10 +53,12 @@ public class HgAnnotationProvider implements AnnotationProvider {
throw new VcsException("vcs root is null for " + file);
}
final HgFile hgFile = new HgFile(vcsRoot, VfsUtilCore.virtualToIoFile(file));
- final List<HgAnnotationLine> annotationResult = (new HgAnnotateCommand(myProject)).execute(hgFile, revision);
+ HgFile fileToAnnotate = revision instanceof HgFileRevision ? HgUtil
+ .getFileNameInTargetRevision(myProject, ((HgFileRevision)revision).getRevisionNumber(), hgFile) : hgFile;
+ final List<HgAnnotationLine> annotationResult = (new HgAnnotateCommand(myProject)).execute(fileToAnnotate, revision);
final List<HgFileRevision> logResult;
try {
- logResult = (new HgLogCommand(myProject)).execute(hgFile, DEFAULT_LIMIT, false);
+ logResult = (new HgLogCommand(myProject)).execute(fileToAnnotate, DEFAULT_LIMIT, false);
}
catch (HgCommandException e) {
throw new VcsException("Can not annotate, " + HgVcsMessages.message("hg4idea.error.log.command.execution"), e);
@@ -69,5 +72,4 @@ public class HgAnnotationProvider implements AnnotationProvider {
public boolean isAnnotationValid(VcsFileRevision rev) {
return true;
}
-
}