jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1481905 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
Date Mon, 13 May 2013 14:59:14 GMT
Author: mreutegg
Date: Mon May 13 14:59:14 2013
New Revision: 1481905

URL: http://svn.apache.org/r1481905
Log:
OAK-168: Basic JCR VersionManager support (work in progress)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java?rev=1481905&r1=1481904&r2=1481905&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionableState.java
Mon May 13 14:59:14 2013
@@ -125,7 +125,7 @@ class VersionableState {
         // add the frozen children and histories
         for (String name : src.getChildNodeNames()) {
             NodeBuilder child = src.getChildNode(name);
-            int opv = getOPV(src, child);
+            int opv = getOPV(src, child, name);
 
             if (opv == OnParentVersionAction.ABORT) {
                 throw new CommitFailedException(CommitFailedException.VERSION, 1,
@@ -192,10 +192,12 @@ class VersionableState {
         }
     }
 
-    private int getOPV(NodeBuilder parent, NodeBuilder child)
+    private int getOPV(NodeBuilder parent, NodeBuilder child, String childName)
             throws RepositoryException {
-        return ntMgr.getDefinition(new ReadOnlyTree(parent.getNodeState()),
-                new ReadOnlyTree(child.getNodeState())).getOnParentVersion();
+        ReadOnlyTree parentTree = new ReadOnlyTree(parent.getNodeState());
+        ReadOnlyTree childTree = new ReadOnlyTree(
+                parentTree, childName, child.getNodeState());
+        return ntMgr.getDefinition(parentTree, childTree).getOnParentVersion();
     }
 
     private int getOPV(NodeBuilder node, PropertyState property)



Mime
View raw message