From 75edd2104f69ef8d57d231c062da74ca422c2cd1 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Wed, 11 May 2016 18:50:56 +0300 Subject: [PATCH] [hg]: fix file history on windows --- .../src/org/zmlx/hg4idea/provider/HgHistoryProvider.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java index 1845f7424d35..13600b9c029d 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/provider/HgHistoryProvider.java @@ -15,6 +15,7 @@ package org.zmlx.hg4idea.provider; import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vcs.FilePath; import com.intellij.openapi.vcs.VcsActions; import com.intellij.openapi.vcs.VcsConfiguration; @@ -168,7 +169,8 @@ public class HgHistoryProvider implements VcsHistoryProvider { List argsForCmd = ContainerUtil.newArrayList(); String relativePath = originalHgFile.getRelativePath(); argsForCmd.add("--rev"); - argsForCmd.add("reverse(follow(" + relativePath + "))"); + argsForCmd + .add(String.format("reverse(follow(%s))", relativePath != null ? "'" + FileUtil.toSystemIndependentName(relativePath) + "'" : "")); HgCommandResult result = logCommand.execute(vcsRoot, template, limit, relativePath != null ? null : originalHgFile, argsForCmd); return HgHistoryUtil.getCommitRecords(project, result, new HgFileRevisionLogParser(project, originalHgFile, version)); }