mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-09 17:45:10 +00:00
This allows missing nodes to override existing nodes during an update. It
should allow reverts to work correctly in all circumstances. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4429 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
d12551d5cc
commit
a5bd362e24
@ -317,10 +317,10 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
}
|
||||
AVMNodeDescriptor srcDesc = fAVMService.lookup(version,
|
||||
diff.getSourcePath(), true);
|
||||
if (srcDesc == null)
|
||||
{
|
||||
throw new AVMSyncException("Source node not found: " + diff.getSourcePath());
|
||||
}
|
||||
// if (srcDesc == null)
|
||||
// {
|
||||
// throw new AVMSyncException("Source node not found: " + diff.getSourcePath());
|
||||
// }
|
||||
String [] dstParts = AVMNodeConverter.SplitBase(diff.getDestinationPath());
|
||||
if (dstParts[0] == null || diff.getDestinationVersion() >= 0)
|
||||
{
|
||||
@ -416,6 +416,12 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
*/
|
||||
private void linkIn(String parentPath, String name, AVMNodeDescriptor toLink, boolean removeFirst)
|
||||
{
|
||||
// This is a delete.
|
||||
if (toLink == null)
|
||||
{
|
||||
fAVMService.removeNode(parentPath, name);
|
||||
return;
|
||||
}
|
||||
mkdirs(parentPath, AVMNodeConverter.SplitBase(toLink.getPath())[0]);
|
||||
if (removeFirst)
|
||||
{
|
||||
@ -484,6 +490,10 @@ public class AVMSyncServiceImpl implements AVMSyncService
|
||||
*/
|
||||
private int compareOne(AVMNodeDescriptor srcDesc, AVMNodeDescriptor dstDesc)
|
||||
{
|
||||
if (srcDesc == null)
|
||||
{
|
||||
return AVMDifference.OLDER;
|
||||
}
|
||||
if (srcDesc.getId() == dstDesc.getId())
|
||||
{
|
||||
return AVMDifference.SAME;
|
||||
|
Loading…
x
Reference in New Issue
Block a user