You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by tr...@apache.org on 2007/03/01 18:23:35 UTC
svn commit: r513414 -
/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Author: tripod
Date: Thu Mar 1 09:23:33 2007
New Revision: 513414
URL: http://svn.apache.org/viewvc?view=rev&rev=513414
Log:
JCR-772 Merging between workspaces fails
Modified:
jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?view=diff&rev=513414&r1=513413&r2=513414
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java Thu Mar 1 09:23:33 2007
@@ -3273,12 +3273,44 @@
* then <code>null</code> is returned. If the result of the merge test is
* 'fail' with bestEffort set to <code>false</code> a MergeException is
* thrown.
+ * <p/>
+ * jsr170 - 8.2.10 Merge:
+ * [...]
+ * <ul>
+ * <li>If N is currently checked-in then:</li>
+ * <ul>
+ * <li>If V' is a successor (to any degree) of V, then the merge result
+ * for N is update.
+ * </li>
+ * <li>If V' is a predecessor (to any degree) of V or if V and
+ * V' are identical (i.e., are actually the same version),
+ * then the merge result for N is leave.
+ * </li>
+ * <li>If V is neither a successor of, predecessor of, nor
+ * identical with V', then the merge result for N is failed.
+ * This is the case where N and N' represent divergent
+ * branches of the version graph, thus determining the
+ * result of a merge is non-trivial.
+ * </li>
+ * </ul>
+ * <li>If N is currently checked-out then:</li>
+ * <ul>
+ * <li>If V' is a predecessor (to any degree) of V or if V and
+ * V' are identical (i.e., are actually the same version),
+ * then the merge result for N is leave.
+ * </li>
+ * <li>If any other relationship holds between V and V',
+ * then the merge result for N is fail.
+ * </li>
+ * </ul>
+ * </ul>
*
- * @param srcSession
- * @param bestEffort
- * @return
- * @throws RepositoryException
- * @throws AccessDeniedException
+ * @param srcSession the source session
+ * @param failedIds the list to store the failed node ids.
+ * @param bestEffort the best effort flag
+ * @return the corresponding source node or <code>null</code>
+ * @throws RepositoryException if an error occurs.
+ * @throws AccessDeniedException if access is denied
*/
private NodeImpl doMergeTest(SessionImpl srcSession, List failedIds, boolean bestEffort)
throws RepositoryException, AccessDeniedException {
@@ -3677,7 +3709,7 @@
try {
dstNode = session.getNodeById(childId);
// check if same parent
- if (!dstNode.getParent().isSame(srcNode)) {
+ if (!isSame(dstNode.getParent())) {
if (removeExisting) {
dstNode.internalRemove(false);
dstNode = null;