jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1236180 - in /jackrabbit/sandbox/microkernel/src: main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java test/java/org/apache/jackrabbit/mk/ConflictingMoveTest.java
Date Thu, 26 Jan 2012 13:58:35 GMT
Author: thomasm
Date: Thu Jan 26 13:58:34 2012
New Revision: 1236180

URL: http://svn.apache.org/viewvc?rev=1236180&view=rev
Log:
Double delete

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/ConflictingMoveTest.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java?rev=1236180&r1=1236179&r2=1236180&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java
Thu Jan 26 13:58:34 2012
@@ -224,7 +224,10 @@ public class MemoryKernelImpl extends Wr
                 break;
             case '-':
                 diff.tag('-').value(path).newline();
-                data = data.cloneAndRemoveChildNode(from, rev);
+                if (data.exists(from) || !getRevisionDataRoot(revisionId).exists(from)) {
+                    // this will fail if the node didn't exist
+                    data = data.cloneAndRemoveChildNode(from, rev);
+                }
                 break;
             case '^':
                 t.read(':');

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/ConflictingMoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/ConflictingMoveTest.java?rev=1236180&r1=1236179&r2=1236180&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/ConflictingMoveTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/ConflictingMoveTest.java
Thu Jan 26 13:58:34 2012
@@ -93,4 +93,16 @@ public class ConflictingMoveTest extends
         }
     }
 
+    @Test
+    public void doubleDelete() {
+        if (!isMemoryKernel(mk)) {
+            // TODO
+            return;
+        }
+        String head = mk.getHeadRevision();
+        head = mk.commit("/", "+\"a\": {}", head, "");
+        mk.commit("/", "-\"a\"", head, "");
+        mk.commit("/", "-\"a\"", head, "");
+    }
+
 }



Mime
View raw message