mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Allow forceCopy to work on DeletedNodes.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5679 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2469,7 +2469,7 @@ public class AVMRepository
|
|||||||
}
|
}
|
||||||
fLookupCache.onWrite(pathParts[0]);
|
fLookupCache.onWrite(pathParts[0]);
|
||||||
// Just force a copy if needed by looking up in write mode.
|
// Just force a copy if needed by looking up in write mode.
|
||||||
Lookup lPath = store.lookup(-1, pathParts[1], true, false);
|
Lookup lPath = store.lookup(-1, pathParts[1], true, true);
|
||||||
if (lPath == null)
|
if (lPath == null)
|
||||||
{
|
{
|
||||||
throw new AVMNotFoundException("Path not found.");
|
throw new AVMNotFoundException("Path not found.");
|
||||||
|
@@ -84,6 +84,23 @@ import org.alfresco.util.Pair;
|
|||||||
*/
|
*/
|
||||||
public class AVMServiceTest extends AVMServiceTestBase
|
public class AVMServiceTest extends AVMServiceTestBase
|
||||||
{
|
{
|
||||||
|
public void testForceCopyDeleted()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
setupBasicTree();
|
||||||
|
fService.removeNode("main:/a/b/c/foo");
|
||||||
|
fService.createSnapshot("main", null, null);
|
||||||
|
AVMNodeDescriptor desc = fService.forceCopy("main:/a/b/c/foo");
|
||||||
|
assertTrue(desc.isDeleted());
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
fail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void testLayerSnapshots()
|
public void testLayerSnapshots()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@@ -83,8 +83,9 @@ public class DeletedNodeImpl extends AVMNodeImpl implements DeletedNode
|
|||||||
return fDeletedType;
|
return fDeletedType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO What happens when this is called? Does it muck anything up.
|
||||||
/**
|
/**
|
||||||
* This should never be called.
|
* This is only called rarely.
|
||||||
*/
|
*/
|
||||||
public AVMNode copy(Lookup lPath)
|
public AVMNode copy(Lookup lPath)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user