mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 11:05:56 +01:00
Adjust to repository storage with id
This commit is contained in:
@@ -37,7 +37,6 @@ package sonia.scm.repository;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.tmatesoft.svn.core.SVNCancelException;
|
||||
import org.tmatesoft.svn.core.SVNErrorCode;
|
||||
import org.tmatesoft.svn.core.SVNErrorMessage;
|
||||
@@ -45,21 +44,19 @@ import org.tmatesoft.svn.core.SVNException;
|
||||
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.repository.spi.AbstractSvnHookChangesetProvider;
|
||||
import sonia.scm.repository.spi.HookEventFacade;
|
||||
import sonia.scm.repository.spi.SvnHookContextProvider;
|
||||
import sonia.scm.repository.spi.SvnPostReceiveHookChangesetProvier;
|
||||
import sonia.scm.repository.spi.SvnPreReceiveHookChangesetProvier;
|
||||
import sonia.scm.util.AssertUtil;
|
||||
import sonia.scm.util.IOUtil;
|
||||
import sonia.scm.util.Util;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
@@ -166,12 +163,10 @@ public class SvnRepositoryHook implements FSHook
|
||||
{
|
||||
try
|
||||
{
|
||||
String name = getRepositoryName(directory);
|
||||
|
||||
name = IOUtil.trimSeperatorChars(name);
|
||||
String id = getRepositoryId(directory);
|
||||
|
||||
//J-
|
||||
hookEventFacade.handle(SvnRepositoryHandler.TYPE_NAME, name)
|
||||
hookEventFacade.handle(id)
|
||||
.fireHookEvent(
|
||||
changesetProvider.getType(),
|
||||
new SvnHookContextProvider(changesetProvider)
|
||||
@@ -202,11 +197,11 @@ public class SvnRepositoryHook implements FSHook
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
private String getRepositoryName(File directory) throws IOException
|
||||
private String getRepositoryId(File directory) throws IOException
|
||||
{
|
||||
AssertUtil.assertIsNotNull(directory);
|
||||
|
||||
return RepositoryUtil.getRepositoryName(handler, directory);
|
||||
return RepositoryUtil.getRepositoryId(handler, directory);
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
@@ -113,7 +113,7 @@ public class SvnRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase {
|
||||
svnConfig.setRepositoryDirectory(new File("/path"));
|
||||
repositoryHandler.setConfig(svnConfig);
|
||||
|
||||
Repository repository = new Repository("id", "svn", "Name");
|
||||
Repository repository = new Repository("id", "svn", "Space", "Name");
|
||||
|
||||
File path = repositoryHandler.getDirectory(repository);
|
||||
assertEquals("/path/id", path.getAbsolutePath());
|
||||
|
||||
Reference in New Issue
Block a user