jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1333455 - in /jackrabbit/oak/trunk: oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
Date Thu, 03 May 2012 13:43:43 GMT
Author: stefan
Date: Thu May  3 13:43:43 2012
New Revision: 1333455

URL: http://svn.apache.org/viewvc?rev=1333455&view=rev
Log:
OAK-79: Copy operation misses some child nodes

Modified:
    jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java

Modified: jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java?rev=1333455&r1=1333454&r2=1333455&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
(original)
+++ jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
Thu May  3 13:43:43 2012
@@ -221,22 +221,37 @@ public class MicroKernelIT extends Abstr
         assertEquals(currentHead, newHead);
     }
 
-        @Test
+    @Test
     public void addAndMove() {
         String head = mk.getHeadRevision();
         head = mk.commit("",
                 "+\"/root\":{}\n" +
-                "+\"/root/a\":{}\n" +
-                "",
+                "+\"/root/a\":{}\n",
                 head, "");
 
         head = mk.commit("",
                 "+\"/root/a/b\":{}\n" +
-                ">\"/root/a\":\"/root/c\"\n" +
-                "",
+                ">\"/root/a\":\"/root/c\"\n",
                 head, "");
 
         assertFalse(mk.nodeExists("/root/a", head));
+        assertTrue(mk.nodeExists("/root/c/b", head));
+    }
+
+    @Test
+    public void addAndCopy() {
+        mk.commit("/",
+                "+\"x\":{}\n" +
+                "+\"y\":{}\n",
+                null, "");
+
+        mk.commit("/",
+                "+\"x/a\":{}\n" +
+                "*\"x\":\"y/x1\"\n",
+                null, "");
+
+        assertTrue(mk.nodeExists("/x/a", null));
+        assertTrue(mk.nodeExists("/y/x1/a", null));
     }
 
     @Test

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java?rev=1333455&r1=1333454&r2=1333455&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
Thu May  3 13:43:43 2012
@@ -613,8 +613,8 @@ public class CommitBuilder {
             MutableNode destParent = getOrCreateStagedNode(destParentPath);
             destParent.add(new ChildNode(destNodeName, srcCNE.getId()));
 
-            if (srcCNE.getId() == null) {
-                // a 'new' node is being copied
+            if (staged.containsKey(srcPath)) {
+                // the copied subtree is modified
 
                 // update staging area
                 copyStagedNodes(srcPath, destPath);



Mime
View raw message