mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
added isSupported method for repository features to RepositoryService
This commit is contained in:
@@ -72,9 +72,6 @@ import java.io.OutputStream;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
@@ -101,15 +98,11 @@ public class HgRepositoryHandler
|
||||
/** Field description */
|
||||
public static final String TYPE_NAME = "hg";
|
||||
|
||||
/** Field description */
|
||||
private static final Set<Feature> SUPPORTED_FEATURES =
|
||||
EnumSet.of(Feature.COMBINED_DEFAULT_BRANCH);
|
||||
|
||||
/** Field description */
|
||||
public static final Type TYPE = new RepositoryType(TYPE_NAME,
|
||||
TYPE_DISPLAYNAME,
|
||||
HgRepositoryServiceProvider.COMMANDS,
|
||||
SUPPORTED_FEATURES);
|
||||
HgRepositoryServiceProvider.FEATURES);
|
||||
|
||||
/** the logger for HgRepositoryHandler */
|
||||
private static final Logger logger =
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.io.Closeables;
|
||||
import com.google.inject.Provider;
|
||||
|
||||
import sonia.scm.repository.Feature;
|
||||
import sonia.scm.repository.HgContext;
|
||||
import sonia.scm.repository.HgRepositoryHandler;
|
||||
import sonia.scm.repository.Repository;
|
||||
@@ -49,6 +50,7 @@ import sonia.scm.repository.api.Command;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -59,11 +61,14 @@ public class HgRepositoryServiceProvider extends RepositoryServiceProvider
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
public static final Set<Command> COMMANDS = ImmutableSet.of(Command.BLAME,
|
||||
Command.BROWSE, Command.CAT,
|
||||
Command.DIFF, Command.LOG,
|
||||
Command.TAGS,
|
||||
Command.BRANCHES);
|
||||
public static final Set<Command> COMMANDS = EnumSet.of(Command.BLAME,
|
||||
Command.BROWSE, Command.CAT,
|
||||
Command.DIFF, Command.LOG,
|
||||
Command.TAGS, Command.BRANCHES);
|
||||
|
||||
/** Field description */
|
||||
public static final Set<Feature> FEATURES =
|
||||
EnumSet.of(Feature.COMBINED_DEFAULT_BRANCH);
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
@@ -187,6 +192,18 @@ public class HgRepositoryServiceProvider extends RepositoryServiceProvider
|
||||
return COMMANDS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Set<Feature> getSupportedFeatures()
|
||||
{
|
||||
return FEATURES;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user