Mercurial > hg > mercurial
changeset 991:f342d25311c1 Indore-2017.2.x
TW-50054 disable custom hg config on server by default
author | Dmitry Neverov <dmitry.neverov@gmail.com> |
---|---|
date | Mon, 29 Jan 2018 09:38:17 +0100 |
parents | cd2e9f29587f |
children | 5ab8be24bdb2 e0e42fc25bc4 |
files | mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/HgVcsRoot.java mercurial-server/resources/buildServerResources/mercurialSettings.jsp mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/CheckoutRepository.java mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java |
diffstat | 4 files changed, 19 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/HgVcsRoot.java Thu Jan 25 17:00:38 2018 +0100 +++ b/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/HgVcsRoot.java Mon Jan 29 09:38:17 2018 +0100 @@ -71,19 +71,10 @@ myUseArchiveForPatch = Boolean.parseBoolean(getProperty(Constants.USE_ARCHIVE_FOR_PATCH)); myPurgePolicy = readPurgePolicy(vcsRootProperties); myIgnoreMissingDefaultBranch = Boolean.valueOf(getProperty(Constants.IGNORE_MISSING_DEFAULT_BRANCH, "false")); - myCustomHgConfig = readCustomHgConfig(); + myCustomHgConfig = getProperty(Constants.CUSTOM_HG_CONFIG_PROP, ""); myUseAgentMirrors = readUseSharedMirrors(); } - @NotNull - private String readCustomHgConfig() { - if (TeamCityProperties.getBooleanOrTrue(Constants.CUSTOM_HG_CONFIG_ENABLED)) { - return getProperty(Constants.CUSTOM_HG_CONFIG_PROP, ""); - } else { - return ""; - } - } - @Nullable private Boolean readUseSharedMirrors() { String prop = getProperty(Constants.USE_AGENT_MIRRORS); @@ -242,6 +233,11 @@ return myCustomHgConfig; } + @NotNull + public String getCustomHgConfigServer() { + return TeamCityProperties.getBoolean(Constants.CUSTOM_HG_CONFIG_ENABLED) ? myCustomHgConfig : ""; + } + @Nullable public Boolean getUseAgentMirrors() { return myUseAgentMirrors;
--- a/mercurial-server/resources/buildServerResources/mercurialSettings.jsp Thu Jan 25 17:00:38 2018 +0100 +++ b/mercurial-server/resources/buildServerResources/mercurialSettings.jsp Mon Jan 29 09:38:17 2018 +0100 @@ -99,13 +99,6 @@ <div class="smallNote" style="margin: 0;">The path will be used on TeamCity server only if it is included into whitelist.<bs:help file="Mercurial" anchor="hgpath"/></div> </td> </tr> - <tr class="advancedSetting"> - <th><label for="customHgConfig">Mercurial config:</label></th> - <td> - <props:multilineProperty name="customHgConfig" className="longField" linkTitle="Edit mercurial config" expanded="${true}" rows="3" cols="60"/> - <span class="error" id="error_customHgConfig"></span> - </td> - </tr> </l:settingsGroup> <l:settingsGroup title="Authorization Settings"> <tr> @@ -128,6 +121,13 @@ <td colspan="2">Agent-specific settings that are used in case of agent checkout.</td> </tr> <tr class="advancedSetting"> + <th><label for="customHgConfig">Mercurial config:</label></th> + <td> + <props:multilineProperty name="customHgConfig" className="longField" linkTitle="Edit mercurial config" expanded="${true}" rows="3" cols="60"/> + <span class="error" id="error_customHgConfig"></span> + </td> + </tr> + <tr class="advancedSetting"> <th> <label for="purgePolicy">Purge settings:</label> </th>
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/CheckoutRepository.java Thu Jan 25 17:00:38 2018 +0100 +++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/CheckoutRepository.java Mon Jan 29 09:38:17 2018 +0100 @@ -99,7 +99,7 @@ .withTimeout(myPullTimeout) .call(); repo.setDefaultPath(root.getRepository()); - repo.setTeamCityConfig(root.getCustomHgConfig()); + repo.setTeamCityConfig(root.getCustomHgConfigServer()); return rev; } @@ -179,7 +179,7 @@ .withTimeout(myPullTimeout) .call(); repo.setDefaultPath(root.getRepository()); - repo.setTeamCityConfig(root.getCustomHgConfig()); + repo.setTeamCityConfig(root.getCustomHgConfigServer()); if (revision != null) return revision;
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java Thu Jan 25 17:00:38 2018 +0100 +++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java Mon Jan 29 09:38:17 2018 +0100 @@ -391,7 +391,7 @@ final HgRepo cloneOfTheMirror = createRepo(root, tempDir); cloneOfTheMirror.init().call(); cloneOfTheMirror.setDefaultPath(root.getRepository()); - cloneOfTheMirror.setTeamCityConfig(root.getCustomHgConfig()); + cloneOfTheMirror.setTeamCityConfig(root.getCustomHgConfigServer()); cloneOfTheMirror.pull().fromRepository(mirrorDir).call(); cloneSubrepos(root, tempDir, subrepos); cloneOfTheMirror.update().toRevision(toVer).call(); @@ -442,7 +442,7 @@ HgRepo cloneOfSubrepoMirror = createRepo(subrepoRoot, subrepoDir); cloneOfSubrepoMirror.init().call(); cloneOfSubrepoMirror.setDefaultPath(subrepoUrl); - cloneOfSubrepoMirror.setTeamCityConfig(mainRoot.getCustomHgConfig()); + cloneOfSubrepoMirror.setTeamCityConfig(mainRoot.getCustomHgConfigServer()); cloneOfSubrepoMirror.pull().fromRepository(subrepoMirrorDir).call(); Map<String, SubRepo> subSubrepos = subrepo.getSubrepositories(subrepoConfig.revision()); if (!subSubrepos.isEmpty()) @@ -533,7 +533,7 @@ if (repo.containsRevision(cset)) return; repo.setDefaultPath(root.getRepository()); - repo.setTeamCityConfig(root.getCustomHgConfig()); + repo.setTeamCityConfig(root.getCustomHgConfigServer()); try { repo.pull().fromRepository(root.getRepository()) .withTimeout(myConfig.getPullTimeout()) @@ -596,7 +596,7 @@ if (!repo.isValidRepository()) repo.init().call(); repo.setDefaultPath(root.getRepository()); - repo.setTeamCityConfig(root.getCustomHgConfig()); + repo.setTeamCityConfig(root.getCustomHgConfigServer()); resetBookmarks(repo); repo.pull().fromRepository(root.getRepository()) .withTimeout(myConfig.getPullTimeout())