changeset 241:ffd7234f9d1f

test to reproduce TW-16278
author Dmitry Neverov <dmitry.neverov@jetbrains.com>
date Tue, 19 Apr 2011 16:34:32 +0400
parents 43bb90fd750e
children e62ba1023e2c
files mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java
diffstat 2 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Fri Apr 15 09:50:35 2011 +0400
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Tue Apr 19 16:34:32 2011 +0400
@@ -639,7 +639,6 @@
 
   public String label(@NotNull String label, @NotNull String version, @NotNull VcsRoot root, @NotNull CheckoutRules checkoutRules) throws VcsException {
     syncRepository(root);
-
     Settings settings = createSettings(root);
     File workingDir = getWorkingDir(settings);
     // I do not know why but hg tag does not work correctly if
@@ -705,4 +704,10 @@
   public boolean isAgentSideCheckoutAvailable() {
     return true;
   }
+
+
+  /* for tests only */
+  public MirrorManager getMirrorManager() {
+    return myMirrorManager;
+  }
 }
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java	Fri Apr 15 09:50:35 2011 +0400
+++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java	Tue Apr 19 16:34:32 2011 +0400
@@ -245,6 +245,24 @@
     assertTrue(res.getStdout().contains("7:376dcf05cd2a"));
   }
 
+
+  public void labeling_should_not_populate_files_in_local_mirror() throws Exception {
+    VcsRootImpl root = createVcsRoot(simpleRepo());
+    cleanRepositoryAfterTest(simpleRepo());
+    myVcs.getCurrentVersion(root);
+    File mirror = myVcs.getMirrorManager().getMirrorDir(root.getProperty(Constants.REPOSITORY_PROP));
+    File[] files = mirror.listFiles();
+    assertEquals(files.length, 1);
+    assertEquals(files[0].getName(), ".hg");
+
+    myVcs.label("v1.0", "7:376dcf05cd2a", root, new CheckoutRules(""));
+
+    files = mirror.listFiles();
+    assertEquals(files.length, 1);
+    assertEquals(files[0].getName(), ".hg");
+  }
+
+
   public void test_collect_changes_in_branch() throws Exception {
     VcsRootImpl vcsRoot = createVcsRoot(simpleRepo(), "test_branch");