# HG changeset patch # User Dmitry Neverov # Date 1282565934 -14400 # Node ID 1c7e94c0ad2fe356518d5faefa6c3c23db069cd6 # Parent d5fe3d08be74d9c697228a120168c4d882ae478c Add ability to use mercurial installed on the system. We bundle hg.exe for tests, but it doesn't work on linux. Add ability to set hg executable to use in our tests in the same way as it done in git-plugin diff -r d5fe3d08be74 -r 1c7e94c0ad2f mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/Constants.java --- a/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/Constants.java Fri Jul 30 20:03:51 2010 +0400 +++ b/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/Constants.java Mon Aug 23 16:18:54 2010 +0400 @@ -22,6 +22,7 @@ String REPOSITORY_PROP = "repositoryPath"; String BRANCH_NAME_PROP = "branchName"; String HG_COMMAND_PATH_PROP = "hgCommandPath"; + String HG_PATH_ENV = "TEAMCITY_HG_PATH"; String SERVER_CLONE_PATH_PROP = "serverClonePath"; String USERNAME = "username"; String PASSWORD = VcsRoot.SECURE_PROPERTY_PREFIX + "password"; diff -r d5fe3d08be74 -r 1c7e94c0ad2f mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/BaseMercurialTestCase.java --- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/BaseMercurialTestCase.java Fri Jul 30 20:03:51 2010 +0400 +++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/BaseMercurialTestCase.java Mon Aug 23 16:18:54 2010 +0400 @@ -52,12 +52,21 @@ protected VcsRootImpl createVcsRoot(@NotNull String repPath) throws IOException { VcsRootImpl vcsRoot = new VcsRootImpl(1, Constants.VCS_NAME); - vcsRoot.addProperty(Constants.HG_COMMAND_PATH_PROP, new File("mercurial-tests/testData/bin/hg.exe").getAbsolutePath()); + vcsRoot.addProperty(Constants.HG_COMMAND_PATH_PROP, new File(getHgPath()).getAbsolutePath()); File repository = LocalRepositoryUtil.prepareRepository(repPath); vcsRoot.addProperty(Constants.REPOSITORY_PROP, repository.getAbsolutePath()); return vcsRoot; } + private String getHgPath() throws IOException { + String providedHg = System.getenv(Constants.HG_PATH_ENV); + if (providedHg != null) { + return providedHg; + } else { + return "mercurial-tests/testData/bin/hg.exe"; + } + } + protected VcsRootImpl createVcsRoot(@NotNull String repPath, @NotNull String branchName) throws IOException { VcsRootImpl vcsRoot = createVcsRoot(repPath); vcsRoot.addProperty(Constants.BRANCH_NAME_PROP, branchName);