shodaaan commented on code in PR #1474:
URL: https://github.com/apache/jackrabbit-oak/pull/1474#discussion_r1635977258
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionEditor.java:
##########
@@ -145,27 +146,73 @@ public void propertyChanged(PropertyState before,
PropertyState after)
return;
}
String propName = after.getName();
+
+ // Updates the checked-out / checked-in state of the currently
processed node when the JCR_ISCHECKEDOUT property
+ // change is processed.
if (propName.equals(JCR_ISCHECKEDOUT)) {
if (wasCheckedIn()) {
vMgr.checkout(node);
} else {
vMgr.checkin(node);
}
+
+ /*Completes the restore of a version from version history.
+
+ When the JCR_BASEVERSION property is processed, a check is made for the
current base version property.
+ If a restore is currently in progress for the current base version (the
check for this is that the
+ current base version name has the format "restore-[UUID of the version
to restore to]"), then the restore
+ is completed for the current node to the version specified by the UUID.
+
+ If a node that was moved or copied to the location of a deleted node is
currently being processed
+ (see OAK-8848 for context), the restore operation must NOT be performed
when the JCR_BASEVERSION property change
+ is processed for the node.
+
+ TODO: check if this code ever runs when
after.getValue(Type.REFERENCE).startsWith(RESTORE_PREFIX) is FALSE,
Review Comment:
No, it is not, I remove the comment. I will remove the second check in the
version restore code block - the one for
after.getValue(Type.REFERENCE).startsWith(RESTORE_PREFIX) - since it is not
necessary in order for all of the restore logic and the fix to work fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]