subversion support for directory structures

This commit is contained in:
Sebastian Sdorra
2011-10-23 19:06:45 +02:00
parent 76c5c4ce40
commit 69e98420dc
7 changed files with 222 additions and 37 deletions

View File

@@ -102,7 +102,7 @@ public class SvnRepositoryHandler
// register hook
if (repositoryManager != null)
{
FSHooks.registerHook(new SvnRepositoryHook(repositoryManager));
FSHooks.registerHook(new SvnRepositoryHook(repositoryManager, this));
}
else if (logger.isWarnEnabled())
{

View File

@@ -46,6 +46,7 @@ import org.tmatesoft.svn.core.internal.io.fs.FSHook;
import org.tmatesoft.svn.core.internal.io.fs.FSHookEvent;
import org.tmatesoft.svn.core.internal.io.fs.FSHooks;
import sonia.scm.util.IOUtil;
import sonia.scm.util.Util;
//~--- JDK imports ------------------------------------------------------------
@@ -70,10 +71,13 @@ public class SvnRepositoryHook implements FSHook
*
*
* @param repositoryManager
* @param handler
*/
public SvnRepositoryHook(RepositoryManager repositoryManager)
public SvnRepositoryHook(RepositoryManager repositoryManager,
SvnRepositoryHandler handler)
{
this.repositoryManager = repositoryManager;
this.handler = handler;
}
//~--- methods --------------------------------------------------------------
@@ -151,8 +155,14 @@ public class SvnRepositoryHook implements FSHook
{
try
{
repositoryManager.fireHookEvent(SvnRepositoryHandler.TYPE_NAME,
directory.getName(), hookEvent);
String name =
directory.getAbsolutePath()
.substring(handler.getConfig().getRepositoryDirectory()
.getAbsolutePath().length());
name = IOUtil.trimSeperatorChars(name);
repositoryManager.fireHookEvent(SvnRepositoryHandler.TYPE_NAME, name,
hookEvent);
}
catch (Exception ex)
{
@@ -168,6 +178,9 @@ public class SvnRepositoryHook implements FSHook
//~--- fields ---------------------------------------------------------------
/** Field description */
private SvnRepositoryHandler handler;
/** Field description */
private RepositoryManager repositoryManager;
}