diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgConfig.java b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgConfig.java index 68458ab0088c..6c805a38308b 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgConfig.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgConfig.java @@ -35,8 +35,14 @@ public final class HgConfig { @Nullable public String getDefaultPushPath() { - String path = getNamedConfig("paths", "default-push"); - return path != null ? path : getNamedConfig("paths", "default"); + String path = getNamedConfig("paths", "default:pushurl"); + if (path == null) { + path = getNamedConfig("paths", "default-push"); + } + if (path == null) { + path = getNamedConfig("paths", "default"); + } + return path; } @Nullable diff --git a/plugins/hg4idea/testSrc/hg4idea/test/config/HgConfigTest.java b/plugins/hg4idea/testSrc/hg4idea/test/config/HgConfigTest.java index 1a3436f13abe..da35a69991b4 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/config/HgConfigTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/config/HgConfigTest.java @@ -67,12 +67,15 @@ public class HgConfigTest extends HgPlatformTest { cd(myChildRepo); String pushPath = "somePath"; appendToHgrc(myChildRepo, "\n[paths]\n" + - "default-push=" + pushPath); + "default-push = " + pushPath); + appendToHgrc(myChildRepo, "\n[paths]\n" + + "default:pushurl = " + pushPath); updateRepoConfig(myProject, myChildRepo); final String defaultPushPath = HgUtil.getRepositoryDefaultPushPath(myProject, myChildRepo); assertNotNull(defaultPushPath); - assertEquals(FileUtil.toSystemIndependentName(myChildRepo.getPath() + "/" + pushPath), - FileUtil.toSystemIndependentName(defaultPushPath)); + String absolutePath = FileUtil.toSystemIndependentName(myChildRepo.getPath() + "/" + pushPath); + // after default-push config deprecation around version 3.7 ,hg reports the same value that is contained in hgrc file + assertTrue(absolutePath.contains(FileUtil.toSystemIndependentName(defaultPushPath))); } public void testPushPathWithoutAppropriateConfig() {