Mercurial > hg > mercurial
changeset 46:13d5f0f56e70
compatibility with TeamCity 3.x
author | Pavel.Sher |
---|---|
date | Tue, 07 Oct 2008 15:22:57 +0400 |
parents | 4059fcc5473e |
children | c785bc4c5f39 |
files | mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/PathUtil.java mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/Settings.java mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java mercurial.ipr |
diffstat | 4 files changed, 18 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/PathUtil.java Sat Sep 06 17:46:28 2008 +0400 +++ b/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/PathUtil.java Tue Oct 07 15:22:57 2008 +0400 @@ -17,9 +17,21 @@ import org.jetbrains.annotations.NotNull; +import java.io.File; +import java.io.IOException; + public class PathUtil { @NotNull public static String normalizeSeparator(@NotNull String repPath) { return repPath.replace('\\', '/'); } + + @NotNull + public static File getCanonicalFile(@NotNull File file) { + try { + return file.getCanonicalFile(); + } catch (IOException e) { + return file.getAbsoluteFile(); + } } +}
--- a/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/Settings.java Sat Sep 06 17:46:28 2008 +0400 +++ b/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/Settings.java Tue Oct 07 15:22:57 2008 +0400 @@ -17,15 +17,14 @@ import jetbrains.buildServer.buildTriggers.vcs.mercurial.Constants; import jetbrains.buildServer.buildTriggers.vcs.mercurial.PathUtil; -import jetbrains.buildServer.util.FileUtil; import jetbrains.buildServer.util.Hash; import jetbrains.buildServer.util.StringUtil; import jetbrains.buildServer.vcs.VcsRoot; import org.jetbrains.annotations.NotNull; import java.io.File; +import java.util.HashSet; import java.util.Set; -import java.util.HashSet; /** * Represents Mercurial repository settings @@ -107,7 +106,7 @@ } public void setWorkingDir(@NotNull final File workingDir) { - myWorkingDir = FileUtil.getCanonicalFile(workingDir); + myWorkingDir = PathUtil.getCanonicalFile(workingDir); } /** @@ -136,7 +135,7 @@ private static File getDefaultWorkDir(@NotNull File workFolderParentDir, @NotNull String repPath) { String workingDirname = DEFAULT_WORK_DIR_PREFIX + String.valueOf(Hash.calc(normalize(repPath))); - return FileUtil.getCanonicalFile(new File(workFolderParentDir, workingDirname)); + return PathUtil.getCanonicalFile(new File(workFolderParentDir, workingDirname)); } private static String normalize(final String path) {
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java Sat Sep 06 17:46:28 2008 +0400 +++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java Tue Oct 07 15:22:57 2008 +0400 @@ -432,14 +432,14 @@ }); if (files != null) { for (File f: files) { - workDirs.add(FileUtil.getCanonicalFile(f)); + workDirs.add(PathUtil.getCanonicalFile(f)); } } for (VcsRoot vcsRoot: myVcsManager.getAllRegisteredVcsRoots()) { if (getName().equals(vcsRoot.getVcsName())) { Settings s = createSettings(vcsRoot); - workDirs.remove(FileUtil.getCanonicalFile(s.getWorkingDir())); + workDirs.remove(PathUtil.getCanonicalFile(s.getWorkingDir())); } }
--- a/mercurial.ipr Sat Sep 06 17:46:28 2008 +0400 +++ b/mercurial.ipr Tue Oct 07 15:22:57 2008 +0400 @@ -305,7 +305,7 @@ <SplitterProportionsDataImpl /> </option> </component> - <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="1.5.latest" project-jdk-type="JavaSDK" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.5.latest" project-jdk-type="JavaSDK" /> <component name="ResourceManagerContainer"> <option name="myResourceBundles"> <value>