added scm-git-plugin

This commit is contained in:
Sebastian Sdorra
2010-09-26 17:02:31 +02:00
parent f02c0e72af
commit 216c4c8786
7 changed files with 208 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sonia.scm.repository;
//~--- JDK imports ------------------------------------------------------------
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Sebastian Sdorra
*/
@XmlRootElement(name = "config")
public class GitConfig extends SimpleRepositoryConfig
{
/**
* Method description
*
*
* @return
*/
public String getGitBinary()
{
return gitBinary;
}
//~--- set methods ----------------------------------------------------------
/**
* Method description
*
*
* @param gitBinary
*/
public void setGitBinary(String gitBinary)
{
this.gitBinary = gitBinary;
}
//~--- fields ---------------------------------------------------------------
/** Field description */
private String gitBinary = "git";
}

View File

@@ -0,0 +1,82 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sonia.scm.repository;
//~--- non-JDK imports --------------------------------------------------------
import sonia.scm.io.ExtendedCommand;
//~--- JDK imports ------------------------------------------------------------
import java.io.File;
/**
*
* @author Sebastian Sdorra
*/
public class GitRepositoryHandler
extends AbstractSimpleRepositoryHandler<GitConfig>
{
/** Field description */
public static final String TYPE_DISPLAYNAME = "Git";
/** Field description */
public static final String TYPE_NAME = "git";
/** Field description */
public static final RepositoryType TYPE = new RepositoryType(TYPE_NAME,
TYPE_DISPLAYNAME);
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
@Override
public RepositoryType getType()
{
return TYPE;
}
//~--- methods --------------------------------------------------------------
/**
* Method description
*
*
* @param repository
* @param directory
*
* @return
*/
@Override
protected ExtendedCommand buildCreateCommand(Repository repository,
File directory)
{
return new ExtendedCommand(config.getGitBinary(), "init", "--bare",
directory.getPath());
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
@Override
protected Class<GitConfig> getConfigClass()
{
return GitConfig.class;
}
}

View File

@@ -0,0 +1,38 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sonia.scm.web;
/**
*
* @author Sebastian Sdorra
*/
public class GitWebPlugin implements ScmWebPlugin
{
/**
* Method description
*
*
* @param context
*/
@Override
public void contextDestroyed(ScmWebPluginContext context)
{
// do nothing
}
/**
* Method description
*
*
* @param context
*/
@Override
public void contextInitialized(ScmWebPluginContext context) {}
}

View File

@@ -0,0 +1 @@
sonia.scm.repository.GitRepositoryHandler

View File

@@ -0,0 +1 @@
sonia.scm.web.GitWebPlugin