jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1537072 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKRebaseTest.java
Date Wed, 30 Oct 2013 13:05:59 GMT
Author: mreutegg
Date: Wed Oct 30 13:05:58 2013
New Revision: 1537072

URL: http://svn.apache.org/r1537072
Log:
OAK-1129: Repeated MongoMK.rebase() always adds new revision

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKRebaseTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java?rev=1537072&r1=1537071&r2=1537072&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java
Wed Oct 30 13:05:58 2013
@@ -747,7 +747,7 @@ public final class MongoNodeStore
             // empty branch
             return base.asBranchRevision();
         }
-        if (b.getBase().equals(base)) {
+        if (b.getBase(branchHead).equals(base)) {
             return branchHead;
         }
         // add a pseudo commit to make sure current head of branch

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKRebaseTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKRebaseTest.java?rev=1537072&r1=1537071&r2=1537072&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKRebaseTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKRebaseTest.java
Wed Oct 30 13:05:58 2013
@@ -358,4 +358,14 @@ public class MongoMKRebaseTest extends B
         assertTrue(trunkNode.contains("\"q\":43"));
     }
 
+    @Test
+    public void rebaseMultiple() {
+        String branch = mk.branch(null);
+        branch = mk.commit("/", "+\"x\":{}", branch, null);
+        String head = mk.commit("/", "+\"y\":{}", null, null);
+        branch = mk.rebase(branch, head);
+        assertEquals("repeated rebase with same head must not create new branch revision",
+                branch, mk.rebase(branch, head));
+    }
+
 }
\ No newline at end of file



Mime
View raw message