mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
improve mercurial command handling
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user