jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1430729 - /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java
Date Wed, 09 Jan 2013 08:20:06 GMT
Author: meteatamel
Date: Wed Jan  9 08:20:05 2013
New Revision: 1430729

URL: http://svn.apache.org/viewvc?rev=1430729&view=rev
Log:
OAK-535 - MergeCommand reads complete tree into memory

Minor optimization to attempt the merge from trunk to branch, only if there are changes in
the trunk.

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java?rev=1430729&r1=1430728&r2=1430729&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/MergeCommand.java
Wed Jan  9 08:20:05 2013
@@ -66,9 +66,11 @@ public class MergeCommand extends BaseCo
 
         long branchRootId = Long.parseLong(branchId.substring(0, branchId.indexOf("-")));
 
-        // Merge nodes from head to branch.
+        // Merge changes, if any, from trunk to branch.
         Node currentHeadNode = getNode("/", currentHead);
-        ourRoot = mergeNodes(ourRoot, currentHeadNode, branchRootId);
+        if (currentHead != branchRootId) {
+            ourRoot = mergeNodes(ourRoot, currentHeadNode, branchRootId);
+        }
 
         String diff = new DiffBuilder(MongoUtil.wrap(currentHeadNode),
                 MongoUtil.wrap(ourRoot), "/", -1,



Mime
View raw message