# HG changeset patch # User Dmitry Neverov # Date 1329233621 -14400 # Node ID a4829fde54f52c9bc274e6cfefe0bd8862887069 # Parent feea4e033b5a89936d10dde2e53aaa74772f7c8e Labeling should not affect vcs root settings diff -r feea4e033b5a -r a4829fde54f5 mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java --- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java Thu Feb 09 14:01:54 2012 +0400 +++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java Tue Feb 14 19:33:41 2012 +0400 @@ -710,7 +710,8 @@ File tmpDir = null; try { tmpDir = createLabelingTmpDir(); - Settings settings = createSettings(root, tmpDir); + Settings settings = createSettings(root); + settings.setCustomWorkingDir(tmpDir); syncRepository(settings); File workingDir = getWorkingDir(settings); new UpdateCommand(settings, workingDir).execute(); @@ -768,12 +769,6 @@ return settings; } - /* Creates settings for root and use specified customDir as clone path */ - private Settings createSettings(final VcsRoot root, final File customDir) throws VcsException { - ((VcsRootImpl) root).addProperty(Constants.SERVER_CLONE_PATH_PROP, customDir.getAbsolutePath()); - return createSettings(root); - } - private void createClonedRepositoryParentDir(final File parentDir) throws VcsException { if (!parentDir.exists() && !parentDir.mkdirs()) { throw new VcsException("Failed to create parent directory for cloned repository: " + parentDir.getAbsolutePath()); diff -r feea4e033b5a -r a4829fde54f5 mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java --- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java Thu Feb 09 14:01:54 2012 +0400 +++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java Tue Feb 14 19:33:41 2012 +0400 @@ -492,6 +492,15 @@ } + public void labeling_should_not_change_vcs_root_settings() throws Exception { + VcsRootImpl root = createVcsRoot(simpleRepo(), "test_branch"); + cleanRepositoryAfterTest(simpleRepo()); + assertNull(root.getProperty(Constants.SERVER_CLONE_PATH_PROP)); + myVcs.label("branch_tag", "7:376dcf05cd2a", root, CheckoutRules.DEFAULT); + assertNull(root.getProperty(Constants.SERVER_CLONE_PATH_PROP)); + } + + private void assertFiles(final List expectedFiles, final ModificationData modificationData) { Set actualFiles = new HashSet(); for (VcsChange vc: modificationData.getChanges()) {