You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by mr...@apache.org on 2014/09/25 10:26:52 UTC
svn commit: r1627481 - in /jackrabbit/oak/branches/1.0: ./
oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java
Author: mreutegg
Date: Thu Sep 25 08:26:51 2014
New Revision: 1627481
URL: http://svn.apache.org/r1627481
Log:
OAK-2120: Simplify BranchStates
Merged revision 1627047 from trunk
Modified:
jackrabbit/oak/branches/1.0/ (props changed)
jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java
Propchange: jackrabbit/oak/branches/1.0/
------------------------------------------------------------------------------
Merged /jackrabbit/oak/trunk:r1627047
Modified: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java?rev=1627481&r1=1627480&r2=1627481&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java (original)
+++ jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeStoreBranch.java Thu Sep 25 08:26:51 2014
@@ -515,13 +515,11 @@ public abstract class AbstractNodeStoreB
}
/**
- * Instances of this class represent a branch whose base and head differ.
- * All changes are persisted to an underlying branch in the {@code MicroKernel}.
+ * Instances of this class represent a branch whose head is persisted to an
+ * underlying branch in the {@code MicroKernel}.
* <p>
* Transitions to:
* <ul>
- * <li>{@link Unmodified} on {@link #setRoot(NodeState)} if the new root is the same
- * as the base of this branch.
* <li>{@link ResetFailed} on failed reset in {@link #merge(CommitHook, CommitInfo)}</li>
* <li>{@link Merged} on successful {@link #merge(CommitHook, CommitInfo)}</li>
* </ul>
@@ -562,9 +560,7 @@ public abstract class AbstractNodeStoreB
@Override
void setRoot(NodeState root) {
- if (base.equals(root)) {
- branchState = new Unmodified(base);
- } else if (!head.equals(root)) {
+ if (!head.equals(root)) {
persistTransientHead(root);
}
}
@@ -572,15 +568,9 @@ public abstract class AbstractNodeStoreB
@Override
void rebase() {
N root = getRoot();
- if (head.equals(root)) {
- // Nothing was written to this branch: set new base revision
- head = root;
- base = root;
- } else {
- // perform rebase in store
- head = AbstractNodeStoreBranch.this.rebase(head, root);
- base = root;
- }
+ // perform rebase in store
+ head = AbstractNodeStoreBranch.this.rebase(head, root);
+ base = root;
}
@Override