changeset 98:02fb7e4d5aee Darjeeling-5.0.x

TW-10928 fix integrated
author Pavel.Sher
date Mon, 08 Feb 2010 14:05:39 +0300
parents 6c1cff1f61cc (current diff) 3ac056b1932e (diff)
children 09cca4213a3d
files
diffstat 3 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Tue Feb 02 20:59:41 2010 +0300
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Mon Feb 08 14:05:39 2010 +0300
@@ -403,7 +403,7 @@
       for (File realFile: files) {
         String relPath = realFile.getAbsolutePath().substring(repRoot.getAbsolutePath().length());
         String mappedPath = checkoutRules.map(relPath);
-        if (mappedPath != null) {
+        if (mappedPath != null && mappedPath.length() > 0) {
           final File virtualFile = new File(mappedPath);
           if (realFile.isDirectory()) {
             builder.createDirectory(virtualFile);
@@ -416,6 +416,10 @@
               is.close();
             }
           }
+        } else {
+          if (realFile.isDirectory()) {
+            buildPatchFromDirectory(realFile, builder, repRoot, filter, checkoutRules);
+          }
         }
       }
     }
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java	Tue Feb 02 20:59:41 2010 +0300
+++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java	Mon Feb 08 14:05:39 2010 +0300
@@ -166,6 +166,19 @@
     checkPatchResult(output.toByteArray());
   }
 
+  public void test_build_clean_patch_checkout_rules() throws IOException, VcsException {
+    setName("cleanPatch1_checkout_rules");
+    VcsRootImpl vcsRoot = createVcsRoot(simpleRepo());
+
+    final ByteArrayOutputStream output = new ByteArrayOutputStream();
+    final PatchBuilderImpl builder = new PatchBuilderImpl(output);
+
+    myVcs.buildPatch(vcsRoot, null, "4:b06a290a363b", builder, new CheckoutRules("+:dir1/subdir=>."));
+    builder.close();
+
+    checkPatchResult(output.toByteArray());
+  }
+
   public void test_build_incremental_patch_file_with_space() throws IOException, VcsException {
     setName("patch2");
     VcsRootImpl vcsRoot = createVcsRoot(simpleRepo());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/cleanPatch1_checkout_rules/after/file2.txt	Mon Feb 08 14:05:39 2010 +0300
@@ -0,0 +1,1 @@
+bbb
\ No newline at end of file