mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Check for Mercurial before setting up test project
This commit is contained in:
@@ -29,29 +29,13 @@ public class HgExecutor extends Executor {
|
||||
private static final String HG_EXECUTABLE_ENV = "IDEA_TEST_HG_EXECUTABLE";
|
||||
//private static final String TEAMCITY_HG_EXECUTABLE_ENV = "TEAMCITY_HG_PATH"; //todo var for server testing
|
||||
|
||||
private static boolean myVersionPrinted;
|
||||
private static final String HG_EXECUTABLE = findHgExecutable();
|
||||
|
||||
private static String findHgExecutable() {
|
||||
return findExecutable("hg", "hg", "hg.exe", Arrays.asList(HG_EXECUTABLE_ENV));
|
||||
}
|
||||
private static final String HG_EXECUTABLE = findExecutable("hg", "hg", "hg.exe", Arrays.asList(HG_EXECUTABLE_ENV));
|
||||
|
||||
public static String hg(String command) {
|
||||
printVersionTheFirstTime();
|
||||
List<String> split = StringUtil.split(command, " ");
|
||||
split.add(0, HG_EXECUTABLE);
|
||||
log("hg " + command);
|
||||
for(int attempt = 0; attempt < 3; attempt++) {
|
||||
return run(split);
|
||||
}
|
||||
throw new RuntimeException("fatal error during execution of Hg command: " + command);
|
||||
return run(split);
|
||||
}
|
||||
|
||||
private static void printVersionTheFirstTime() {
|
||||
if (!myVersionPrinted) {
|
||||
myVersionPrinted = true;
|
||||
hg("version");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,9 @@ public abstract class HgPlatformTest extends LightPlatformTestCase {
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
cd(FileUtil.getTempDirectory());
|
||||
hg("version");
|
||||
|
||||
super.setUp();
|
||||
|
||||
myProject = getProject();
|
||||
@@ -65,11 +68,6 @@ public abstract class HgPlatformTest extends LightPlatformTestCase {
|
||||
setUpHgrc(myRepository);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
private static void setUpHgrc(VirtualFile repository) {
|
||||
cd(".hg");
|
||||
File pluginRoot = new File(PluginPathManager.getPluginHomePath("hg4idea"));
|
||||
|
||||
Reference in New Issue
Block a user