amit-jain commented on code in PR #880:
URL: https://github.com/apache/jackrabbit-oak/pull/880#discussion_r1155472865
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/migration/version/VersionCopier.java:
##########
@@ -111,6 +125,72 @@ public boolean copyVersionHistory(String versionableUuid,
Calendar minDate, bool
return false;
}
+ private boolean hasNoConflicts(String versionHistoryPath, String
versionableUuid, boolean preserveOnTarget, NodeState sourceVersionHistory) {
+ // if preserveOnTarget is true then check no conflicts which means
version history has moved forward only
+ if (preserveOnTarget) {
+ NodeBuilder targetVersionHistory =
getVersionHistoryBuilder(targetVersionStorage, versionableUuid);
+ if (targetVersionHistory.exists()) {
+ VersionComparator versionComparator = new VersionComparator();
+
+ // version history id not equal
+ boolean conflictingVersionHistory =
!targetVersionHistory.getString(JCR_UUID).equals(sourceVersionHistory.getString(JCR_UUID));
Review Comment:
we are in the version history node path which will mandatorily contain
jcr:uuid property but Objects.equal comparison is good.
--
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]