Mercurial > hg > mercurial
changeset 97:3ac056b1932e
TW-10928
author | Pavel.Sher |
---|---|
date | Mon, 08 Feb 2010 14:03:50 +0300 |
parents | 064e6a7a74a5 |
children | 02fb7e4d5aee 7f3e13c22b19 |
files | mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java mercurial-tests/testData/cleanPatch1_checkout_rules/after/file2.txt |
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 21:01:50 2010 +0300 +++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java Mon Feb 08 14:03:50 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 21:01:50 2010 +0300 +++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java Mon Feb 08 14:03:50 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());