improve mercurial command handling

This commit is contained in:
Sebastian Sdorra
2011-10-08 15:31:10 +02:00
parent 7ff44be3b7
commit 8975eccd88
12 changed files with 610 additions and 516 deletions

View File

@@ -35,6 +35,8 @@ package sonia.scm.repository;
//~--- non-JDK imports --------------------------------------------------------
import com.google.inject.Provider;
import sonia.scm.io.DefaultFileSystem;
import sonia.scm.store.StoreFactory;
@@ -87,13 +89,14 @@ public class HgRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase
File directory)
{
HgRepositoryHandler handler = new HgRepositoryHandler(factory,
new DefaultFileSystem());
new DefaultFileSystem(),
new HgContextProvider());
handler.init(contextProvider);
handler.getConfig().setRepositoryDirectory(directory);
// skip tests if hg not in path
if (! handler.isConfigured())
if (!handler.isConfigured())
{
System.out.println("WARNING could not find hg, skipping test");
assumeTrue(false);
@@ -101,4 +104,28 @@ public class HgRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase
return handler;
}
//~--- inner classes --------------------------------------------------------
/**
* Dummy {@link Provider} for {@link HgContext}
*
*
* @author Sebastian Sdorra
*/
private static class HgContextProvider implements Provider<HgContext>
{
/**
* Return context for mercurial
*
*
* @return context for mercurial
*/
@Override
public HgContext get()
{
return new HgContext();
}
}
}