changeset 588:868916a31d88

Fix incremental patch for commits with removes only
author Dmitry Neverov <dmitry.neverov@jetbrains.com>
date Tue, 16 Apr 2013 16:44:54 +0400
parents e77ef6cd4ddb
children ed76a2fa86bf
files mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java mercurial-tests/testData/README mercurial-tests/testData/inc_patch_deletes_only/after/dir with space/file with space.txt mercurial-tests/testData/inc_patch_deletes_only/after/dir1/file1.txt mercurial-tests/testData/inc_patch_deletes_only/after/dir1/file3.txt mercurial-tests/testData/inc_patch_deletes_only/after/dir1/subdir/file2.txt mercurial-tests/testData/inc_patch_deletes_only/before/dir with space/file with space.txt mercurial-tests/testData/inc_patch_deletes_only/before/dir1/file1.txt mercurial-tests/testData/inc_patch_deletes_only/before/dir1/file3.txt mercurial-tests/testData/inc_patch_deletes_only/before/dir1/subdir/file2.txt mercurial-tests/testData/inc_patch_deletes_only/before/file.txt mercurial-tests/testData/rep1/hg/branch mercurial-tests/testData/rep1/hg/dirstate mercurial-tests/testData/rep1/hg/store/00changelog.i mercurial-tests/testData/rep1/hg/store/00manifest.i mercurial-tests/testData/rep1/hg/store/undo
diffstat 17 files changed, 28 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Tue Apr 16 16:20:30 2013 +0400
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Tue Apr 16 16:44:54 2013 +0400
@@ -230,8 +230,8 @@
       }
     }
 
-    if (notDeletedFiles.isEmpty())
-      return;
+//    if (notDeletedFiles.isEmpty())
+//      return;
 
     File parentDir = repo.cat().files(notDeletedFiles).atRevision(toVer).call();
     try {
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java	Tue Apr 16 16:20:30 2013 +0400
+++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java	Tue Apr 16 16:44:54 2013 +0400
@@ -339,6 +339,12 @@
     assertEquals(md1.getDescription(), "file modified");
   }
 
+  public void incremental_patch_for_commit_with_deletes_only() throws Exception {
+    setName("inc_patch_deletes_only");
+    VcsRoot root = createVcsRoot(simpleRepo(), "test_remove");
+    checkPatchResult(buildPatch(myVcs, root, "9c6a6b4aede0", "e6935c9c80bf", CheckoutRules.DEFAULT).toByteArray());
+  }
+
   public void test_full_patch_from_branch() throws IOException, VcsException {
     setName("patch3");
     VcsRootImpl vcsRoot = createVcsRoot(simpleRepo(), "test_branch");
--- a/mercurial-tests/testData/README	Tue Apr 16 16:20:30 2013 +0400
+++ b/mercurial-tests/testData/README	Tue Apr 16 16:44:54 2013 +0400
@@ -1,5 +1,7 @@
 rep1 history:
-@   10:9c6a6b4aede0 Multiline description tip
+o   11:e6935c9c80bf create branch and remove file.txt (test_remove)
+|
+o   10:9c6a6b4aede0 Multiline description
 |
 | o  9:9babcf2d5705 name with space branch name with space
 | |
@@ -24,9 +26,9 @@
 
 rep2 history:
 
-o    31:1f355761350e create branch NULL (NULL) tip
+o    31:1f355761350e create branch NULL (NULL)
 
-o    30:4780519e01aa continue default tip
+o    30:4780519e01aa continue default
 |
 | o  29:fd50e4842211 continue topic (topic)
 | |
@@ -50,7 +52,7 @@
 |\
 | o  19:ca64c523f54c Close personal-branch
 | |
-@ |  18:df04faa7575a merge personal-branch tip
+o |  18:df04faa7575a merge personal-branch
 |\|
 | o  17:9ec402c74298 another change to file.txt in personal-branch (personal-branch)
 | |
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_deletes_only/after/dir with space/file with space.txt	Tue Apr 16 16:44:54 2013 +0400
@@ -0,0 +1,1 @@
+some text
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_deletes_only/after/dir1/file1.txt	Tue Apr 16 16:44:54 2013 +0400
@@ -0,0 +1,1 @@
+aaa
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_deletes_only/after/dir1/file3.txt	Tue Apr 16 16:44:54 2013 +0400
@@ -0,0 +1,2 @@
+ccc
+ddd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_deletes_only/after/dir1/subdir/file2.txt	Tue Apr 16 16:44:54 2013 +0400
@@ -0,0 +1,2 @@
+modified
+bbb
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_deletes_only/before/dir with space/file with space.txt	Tue Apr 16 16:44:54 2013 +0400
@@ -0,0 +1,1 @@
+some text
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_deletes_only/before/dir1/file1.txt	Tue Apr 16 16:44:54 2013 +0400
@@ -0,0 +1,1 @@
+aaa
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_deletes_only/before/dir1/file3.txt	Tue Apr 16 16:44:54 2013 +0400
@@ -0,0 +1,2 @@
+ccc
+ddd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_deletes_only/before/dir1/subdir/file2.txt	Tue Apr 16 16:44:54 2013 +0400
@@ -0,0 +1,2 @@
+modified
+bbb
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_deletes_only/before/file.txt	Tue Apr 16 16:44:54 2013 +0400
@@ -0,0 +1,1 @@
+aaa
\ No newline at end of file
--- a/mercurial-tests/testData/rep1/hg/branch	Tue Apr 16 16:20:30 2013 +0400
+++ b/mercurial-tests/testData/rep1/hg/branch	Tue Apr 16 16:44:54 2013 +0400
@@ -1,1 +1,1 @@
-default
+test_remove
Binary file mercurial-tests/testData/rep1/hg/dirstate has changed
Binary file mercurial-tests/testData/rep1/hg/store/00changelog.i has changed
Binary file mercurial-tests/testData/rep1/hg/store/00manifest.i has changed
Binary file mercurial-tests/testData/rep1/hg/store/undo has changed