Smarten up deployment to filesystem.

- Deploying to a filesystem implicitly snapshots the source store. 
  This allows shortcutting the tree comparison for directories, because
  guids on directories act as a deep modification indicator if deployments 
  are always from snapshots.  Doh!
- I'll do this for alfresco -> alfresco deployment too.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5635 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2007-05-07 17:52:04 +00:00
parent b9c662956b
commit c55d48a3e7
4 changed files with 33 additions and 13 deletions

View File

@@ -608,8 +608,13 @@ public class DeploymentServiceImpl implements DeploymentService
callback.eventOccurred(event);
}
report.add(event);
String storeName = srcPath.substring(0, srcPath.indexOf(':'));
System.out.println(storeName);
if (version < 0)
{
version = fAVMService.createSnapshot(storeName, null, null);
}
String ticket = service.begin(target, userName, password);
deployDirectoryPush(service, ticket, report, callback, version, srcPath, "/");
service.commit(ticket);
event = new DeploymentEvent(DeploymentEvent.Type.END,
@@ -683,8 +688,7 @@ public class DeploymentServiceImpl implements DeploymentService
}
if (diff == 0)
{
if (src.isFile() && dst.getType() == FileType.FILE &&
src.getGuid().equals(dst.getGUID()))
if (src.getGuid().equals(dst.getGUID()))
{
src = null;
dst = null;
@@ -701,6 +705,10 @@ public class DeploymentServiceImpl implements DeploymentService
// Source is a directory.
if (dst.getType() == FileType.DIR)
{
if (!dstPath.equals("/"))
{
service.setGuid(ticket, dstPath, src.getGuid());
}
deployDirectoryPush(service, ticket, report, callback, version, src.getPath(), dstPath + '/' + dst.getName());
src = null;
dst = null;