Index: src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java (revision 1660870) +++ src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java (revision ) @@ -1076,7 +1076,6 @@ store.dispose(); } - @Ignore("OAK-2513") @Test public void slowRebase() throws Exception { final int NUM_NODES = DocumentRootBuilder.UPDATE_LIMIT / 2; Index: src/main/java/org/apache/jackrabbit/oak/plugins/document/Branch.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- src/main/java/org/apache/jackrabbit/oak/plugins/document/Branch.java (revision 1660870) +++ src/main/java/org/apache/jackrabbit/oak/plugins/document/Branch.java (revision ) @@ -22,9 +22,11 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; +import java.util.Map; import java.util.NavigableMap; import java.util.Set; import java.util.SortedSet; +import java.util.TreeMap; import java.util.concurrent.ConcurrentSkipListMap; import javax.annotation.CheckForNull; @@ -33,7 +35,6 @@ import com.google.common.base.Function; import com.google.common.collect.Iterables; -import com.google.common.collect.Maps; import com.google.common.collect.Sets; /** @@ -277,6 +278,8 @@ abstract boolean isModified(String path); abstract Iterable getModifiedPaths(); + + protected abstract boolean isRebase(); } /** @@ -307,6 +310,11 @@ return modifications; } + @Override + protected boolean isRebase() { + return false; + } + //------------------< LastRevTracker >---------------------------------- @Override @@ -327,7 +335,7 @@ RebaseCommit(Revision base, Revision commit, NavigableMap previous) { super(base, commit); - this.previous = Maps.newTreeMap(previous); + this.previous = squash(previous); } @Override @@ -348,6 +356,11 @@ } @Override + protected boolean isRebase() { + return true; + } + + @Override Iterable getModifiedPaths() { Iterable> paths = transform(previous.values(), new Function>() { @@ -357,6 +370,16 @@ } }); return Iterables.concat(paths); + } + + private static NavigableMap squash(NavigableMap previous) { + NavigableMap result = new TreeMap(previous.comparator()); + for (Map.Entry e : previous.entrySet()){ + if (!e.getValue().isRebase()){ + result.put(e.getKey(), e.getValue()); + } + } + return result; } //------------------< LastRevTracker >----------------------------------