jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1361266 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Date Fri, 13 Jul 2012 15:18:06 GMT
Author: mduerig
Date: Fri Jul 13 15:18:06 2012
New Revision: 1361266

URL: http://svn.apache.org/viewvc?rev=1361266&view=rev
Log:
OAK-186: Avoid unnecessary rebase operations

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java

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=1361266&r1=1361265&r2=1361266&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
Fri Jul 13 15:18:06 2012
@@ -143,11 +143,13 @@ public class RootImpl implements Root {
 
     @Override
     public void rebase(ConflictHandler conflictHandler) {
-        purgePendingChanges();
-        NodeState base = getBaseState();
-        NodeState head = root.getNodeState();
-        refresh();
-        merge(base, head, root, conflictHandler);
+        if (!store.getRoot().equals(root.getBaseState())) {
+            purgePendingChanges();
+            NodeState base = getBaseState();
+            NodeState head = root.getNodeState();
+            refresh();
+            merge(base, head, root, conflictHandler);
+        }
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java?rev=1361266&r1=1361265&r2=1361266&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Fri Jul 13 15:18:06 2012
@@ -1186,7 +1186,7 @@ public class RepositoryTest extends Abst
         Session session2 = createAnonymousSession();
         try {
             session1.getRootNode().addNode("node");
-            session2.getRootNode().addNode("node");
+            session2.getRootNode().addNode("node").setProperty("p", "v");
             assertTrue(session1.getRootNode().hasNode("node"));
             assertTrue(session2.getRootNode().hasNode("node"));
 
@@ -1284,6 +1284,7 @@ public class RepositoryTest extends Abst
         session.save();
 
         Node sourceNode = session.getNode(TEST_PATH + "/source/node");
+        session.refresh(true);
         session.move(TEST_PATH + "/source/node", TEST_PATH + "/target/moved");
         assertEquals("/test_node/target/moved", sourceNode.getPath());
 



Mime
View raw message