# HG changeset patch # User Dmitry Neverov # Date 1389876993 -3600 # Node ID 5211baefb5ecc8ddb80cfd51dfecbe9e390a209b # Parent 31a1aca3305cfa337fac8b6618492c292165ff96 Handle windows paths in subrepo resolving diff -r 31a1aca3305c -r 5211baefb5ec mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubRepo.java --- a/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubRepo.java Tue Jan 14 12:45:10 2014 +0100 +++ b/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubRepo.java Thu Jan 16 13:56:33 2014 +0100 @@ -17,8 +17,11 @@ package jetbrains.buildServer.buildTriggers.vcs.mercurial; import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.exception.WrongSubrepoUrlException; +import jetbrains.buildServer.util.FileUtil; import org.jetbrains.annotations.NotNull; +import java.io.File; +import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; @@ -73,7 +76,6 @@ @NotNull public String resolveUrl(@NotNull String parentRepoUrl) throws WrongSubrepoUrlException { - //TODO: Handle paths on windows. Those paths are not papable for URL if (!parentRepoUrl.endsWith("/")) parentRepoUrl = parentRepoUrl + "/"; try { @@ -83,6 +85,14 @@ return getUrlWithPathFromRoot(subrepoAbsUrl); return subrepoAbsUrl.toString(); } catch (Exception e) { + File parentRepoDir = new File(parentRepoUrl); + if (parentRepoDir.isDirectory()) {//handle windows paths + try { + return FileUtil.resolvePath(parentRepoDir, url()).getCanonicalPath(); + } catch (IOException e1) { + throw new WrongSubrepoUrlException(parentRepoUrl, url(), e); + } + } throw new WrongSubrepoUrlException(parentRepoUrl, url(), e); } }