mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
hg: support paths.default:pushurl config syntax
* IDEA-185209 HG push doesn't use default:pushurl; * since hg version is around 3.7 new push path syntax is used; * update tests GitOrigin-RevId: b0018385b287e0856fb75e391fd9585b96fc4df7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
749db57fd4
commit
418bacd37b
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user