jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1341190 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
Date Mon, 21 May 2012 20:19:18 GMT
Author: mduerig
Date: Mon May 21 20:19:18 2012
New Revision: 1341190

URL: http://svn.apache.org/viewvc?rev=1341190&view=rev
Log:
OAK-106: Use NodeStateBuilder instances to record changes in TreeImpl
- fix refresh

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java?rev=1341190&r1=1341189&r2=1341190&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java Mon
May 21 20:19:18 2012
@@ -64,9 +64,9 @@ public interface Root {
     void rebase();
 
     /**
-     * Reverts all changes made to this root.
+     * Reverts all changes made to this root and refreshed to the latest trunk
      */
-    void revert();
+    void refresh();
 
     /**
      * Atomically apply all changes made to the tree beneath this root to the

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java?rev=1341190&r1=1341189&r2=1341190&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
Mon May 21 20:19:18 2012
@@ -149,9 +149,10 @@ public class RootImpl implements Root {
     }
 
     @Override
-    public void revert() {
-        workspaceBuilder = null;
+    public void refresh() {
         root.revert();
+        workspaceBuilder = null;
+        branch = store.branch();
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java?rev=1341190&r1=1341189&r2=1341190&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
Mon May 21 20:19:18 2012
@@ -148,10 +148,12 @@ public class SessionDelegate {
     }
 
     public void refresh(boolean keepChanges) {
-        if (!keepChanges) {
-            root.revert();
+        if (keepChanges) {
+            root.rebase();
+        }
+        else {
+            root.refresh();
         }
-        root.rebase();
     }
 
     /**



Mime
View raw message