jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1593080 - in /jackrabbit/oak/trunk/oak-upgrade/src: main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java
Date Wed, 07 May 2014 17:48:02 GMT
Author: jukka
Date: Wed May  7 17:48:01 2014
New Revision: 1593080

URL: http://svn.apache.org/r1593080
Log:
OAK-1801: Versionable path of version histories not set during migration

Need to set also the rep:VersionablePaths mixin on affected version histories

Modified:
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
    jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java

Modified: jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java?rev=1593080&r1=1593079&r2=1593080&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
Wed May  7 17:48:01 2014
@@ -42,6 +42,7 @@ import static org.apache.jackrabbit.oak.
 import static org.apache.jackrabbit.oak.api.Type.NAMES;
 import static org.apache.jackrabbit.oak.api.Type.STRING;
 import static org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER;
+import static org.apache.jackrabbit.oak.plugins.version.VersionConstants.MIX_REP_VERSIONABLE_PATHS;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -286,7 +287,14 @@ class JackrabbitNodeState extends Abstra
             String uuid = getString(JCR_UUID);
             String path = versionablePaths.get(uuid);
             if (path != null) {
-                properties.put(workspaceName, PropertyStates.createProperty(workspaceName,
path, Type.PATH));
+                properties.put(workspaceName, PropertyStates.createProperty(
+                        workspaceName, path, Type.PATH));
+
+                Set<String> mixins = newLinkedHashSet(getNames(JCR_MIXINTYPES));
+                if (mixins.add(MIX_REP_VERSIONABLE_PATHS)) {
+                    properties.put(JCR_MIXINTYPES, PropertyStates.createProperty(
+                            JCR_MIXINTYPES, mixins, Type.NAMES));
+                }
             }
         }
     }

Modified: jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java?rev=1593080&r1=1593079&r2=1593080&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java
Wed May  7 17:48:01 2014
@@ -434,6 +434,7 @@ public class RepositoryUpgradeTest exten
                     frozenChild2.getProperty(JCR_FROZENUUID).getString());
 
             VersionHistory history = manager.getVersionHistory("/versionable");
+            assertTrue(history.isNodeType("rep:VersionablePaths"));
             Property versionablePath = history.getProperty("default");
             assertEquals("/versionable", versionablePath.getString());
         } finally {



Mime
View raw message