jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1466934 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: core/OurChangesRebaseDiff.java spi/state/AbstractRebaseDiff.java spi/state/ConflictAnnotatingRebaseDiff.java
Date Thu, 11 Apr 2013 16:00:25 GMT
Author: mduerig
Date: Thu Apr 11 16:00:25 2013
New Revision: 1466934

URL: http://svn.apache.org/r1466934
Log:
OAK-709: Consider moving permission evaluation to the node state level
Pass before state to rebase handler where available

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/OurChangesRebaseDiff.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractRebaseDiff.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/ConflictAnnotatingRebaseDiff.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/OurChangesRebaseDiff.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/OurChangesRebaseDiff.java?rev=1466934&r1=1466933&r2=1466934&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/OurChangesRebaseDiff.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/OurChangesRebaseDiff.java
Thu Apr 11 16:00:25 2013
@@ -46,7 +46,7 @@ class OurChangesRebaseDiff extends Abstr
     }
 
     @Override
-    protected void addExistingProperty(NodeBuilder builder, PropertyState after) {
+    protected void addExistingProperty(NodeBuilder builder, PropertyState before, PropertyState
after) {
         builder.setProperty(after);
     }
 
@@ -71,7 +71,7 @@ class OurChangesRebaseDiff extends Abstr
     }
 
     @Override
-    protected void addExistingNode(NodeBuilder builder, String name, NodeState after) {
+    protected void addExistingNode(NodeBuilder builder, String name, NodeState before, NodeState
after) {
         builder.setNode(name, after);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractRebaseDiff.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractRebaseDiff.java?rev=1466934&r1=1466933&r2=1466934&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractRebaseDiff.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractRebaseDiff.java
Thu Apr 11 16:00:25 2013
@@ -83,9 +83,10 @@ public abstract class AbstractRebaseDiff
      * exists already in the trunk.
      *
      * @param builder  parent builder
+     * @param before existing property
      * @param after  added property
      */
-    protected abstract void addExistingProperty(NodeBuilder builder, PropertyState after);
+    protected abstract void addExistingProperty(NodeBuilder builder, PropertyState before,
PropertyState after);
 
     /**
      * Called when the property {@code after} was changed on the branch but was
@@ -130,9 +131,10 @@ public abstract class AbstractRebaseDiff
      *
      * @param builder  parent builder
      * @param name  name of the added node
+     * @param before existing node
      * @param after  added added
      */
-    protected abstract void addExistingNode(NodeBuilder builder, String name, NodeState after);
+    protected abstract void addExistingNode(NodeBuilder builder, String name, NodeState before,
NodeState after);
 
     /**
      * Called when the node {@code after} was changed on the branch but was
@@ -168,7 +170,7 @@ public abstract class AbstractRebaseDiff
         if (other == null) {
             builder.setProperty(after);
         } else if (!other.equals(after)) {
-            addExistingProperty(builder, after);
+            addExistingProperty(builder, other, after);
         }
     }
 
@@ -199,7 +201,8 @@ public abstract class AbstractRebaseDiff
     @Override
     public void childNodeAdded(String name, NodeState after) {
         if (builder.hasChildNode(name)) {
-            addExistingNode(builder, name, after);
+            NodeState other = builder.child(name).getNodeState();
+            addExistingNode(builder, name, other, after);
         } else {
             builder.setNode(name, after);
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/ConflictAnnotatingRebaseDiff.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/ConflictAnnotatingRebaseDiff.java?rev=1466934&r1=1466933&r2=1466934&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/ConflictAnnotatingRebaseDiff.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/ConflictAnnotatingRebaseDiff.java
Thu Apr 11 16:00:25 2013
@@ -47,7 +47,7 @@ public class ConflictAnnotatingRebaseDif
     }
 
     @Override
-    protected void addExistingProperty(NodeBuilder builder, PropertyState after) {
+    protected void addExistingProperty(NodeBuilder builder, PropertyState before, PropertyState
after) {
         conflictMarker(builder, ADD_EXISTING_PROPERTY).setProperty(after);
     }
 
@@ -72,7 +72,7 @@ public class ConflictAnnotatingRebaseDif
     }
 
     @Override
-    protected void addExistingNode(NodeBuilder builder, String name, NodeState after) {
+    protected void addExistingNode(NodeBuilder builder, String name, NodeState before, NodeState
after) {
         conflictMarker(builder, ADD_EXISTING_NODE).setNode(name, after);
     }
 



Mime
View raw message