mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
added compatibility switches to SvnConfig, see #13
This commit is contained in:
@@ -42,4 +42,85 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||||||
* @author Sebastian Sdorra
|
* @author Sebastian Sdorra
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "config")
|
@XmlRootElement(name = "config")
|
||||||
public class SvnConfig extends SimpleRepositoryConfig {}
|
public class SvnConfig extends SimpleRepositoryConfig
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isPre14Compatible()
|
||||||
|
{
|
||||||
|
return pre14Compatible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isPre15Compatible()
|
||||||
|
{
|
||||||
|
return pre15Compatible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isPre16Compatible()
|
||||||
|
{
|
||||||
|
return pre16Compatible;
|
||||||
|
}
|
||||||
|
|
||||||
|
//~--- set methods ----------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param pre14Compatible
|
||||||
|
*/
|
||||||
|
public void setPre14Compatible(boolean pre14Compatible)
|
||||||
|
{
|
||||||
|
this.pre14Compatible = pre14Compatible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param pre15Compatible
|
||||||
|
*/
|
||||||
|
public void setPre15Compatible(boolean pre15Compatible)
|
||||||
|
{
|
||||||
|
this.pre15Compatible = pre15Compatible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param pre16Compatible
|
||||||
|
*/
|
||||||
|
public void setPre16Compatible(boolean pre16Compatible)
|
||||||
|
{
|
||||||
|
this.pre16Compatible = pre16Compatible;
|
||||||
|
}
|
||||||
|
|
||||||
|
//~--- fields ---------------------------------------------------------------
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
private boolean pre14Compatible = false;
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
private boolean pre15Compatible = false;
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
private boolean pre16Compatible = false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ package sonia.scm.repository;
|
|||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import org.tmatesoft.svn.core.SVNException;
|
import org.tmatesoft.svn.core.SVNException;
|
||||||
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
|
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
|
||||||
|
|
||||||
@@ -71,6 +74,10 @@ public class SvnRepositoryHandler
|
|||||||
/** Field description */
|
/** Field description */
|
||||||
public static final Type TYPE = new Type(TYPE_NAME, TYPE_DISPLAYNAME);
|
public static final Type TYPE = new Type(TYPE_NAME, TYPE_DISPLAYNAME);
|
||||||
|
|
||||||
|
/** the logger for SvnRepositoryHandler */
|
||||||
|
private static final Logger logger =
|
||||||
|
LoggerFactory.getLogger(SvnRepositoryHandler.class);
|
||||||
|
|
||||||
//~--- constructors ---------------------------------------------------------
|
//~--- constructors ---------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -147,9 +154,22 @@ public class SvnRepositoryHandler
|
|||||||
protected void create(Repository repository, File directory)
|
protected void create(Repository repository, File directory)
|
||||||
throws RepositoryException, IOException
|
throws RepositoryException, IOException
|
||||||
{
|
{
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
StringBuilder log = new StringBuilder("create svn repository \"");
|
||||||
|
|
||||||
|
log.append(directory.getName()).append("\": pre14Compatible=");
|
||||||
|
log.append(config.isPre14Compatible()).append(", pre15Compatible=");
|
||||||
|
log.append(config.isPre15Compatible()).append(", pre16Compatible=");
|
||||||
|
log.append(config.isPre16Compatible());
|
||||||
|
logger.debug(log.toString());
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SVNRepositoryFactory.createLocalRepository(directory, true, false);
|
SVNRepositoryFactory.createLocalRepository(directory, null, true, false,
|
||||||
|
config.isPre14Compatible(), config.isPre15Compatible(),
|
||||||
|
config.isPre16Compatible());
|
||||||
}
|
}
|
||||||
catch (SVNException ex)
|
catch (SVNException ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,9 +36,17 @@ Sonia.svn.ConfigPanel = Ext.extend(Sonia.config.SimpleConfigForm, {
|
|||||||
// labels
|
// labels
|
||||||
titleText: 'Subversion Settings',
|
titleText: 'Subversion Settings',
|
||||||
repositoryDirectoryText: 'Repository directory',
|
repositoryDirectoryText: 'Repository directory',
|
||||||
|
// TODO i18n
|
||||||
|
pre14CompatibleText: 'Pre 1.4 Compatible',
|
||||||
|
pre15CompatibleText: 'Pre 1.5 Compatible',
|
||||||
|
pre16CompatibleText: 'Pre 1.6 Compatible',
|
||||||
|
|
||||||
// helpTexts
|
// helpTexts
|
||||||
repositoryDirectoryHelpText: 'Location of the Suberversion repositories.',
|
repositoryDirectoryHelpText: 'Location of the Suberversion repositories.',
|
||||||
|
// TODO
|
||||||
|
pre14CompatibleHelpText: '',
|
||||||
|
pre15CompatibleHelpText: '',
|
||||||
|
pre16CompatibleHelpText: '',
|
||||||
|
|
||||||
initComponent: function(){
|
initComponent: function(){
|
||||||
|
|
||||||
@@ -51,6 +59,24 @@ Sonia.svn.ConfigPanel = Ext.extend(Sonia.config.SimpleConfigForm, {
|
|||||||
fieldLabel: this.repositoryDirectoryText,
|
fieldLabel: this.repositoryDirectoryText,
|
||||||
helpText: this.repositoryDirectoryHelpText,
|
helpText: this.repositoryDirectoryHelpText,
|
||||||
allowBlank : false
|
allowBlank : false
|
||||||
|
},{
|
||||||
|
xtype: 'checkbox',
|
||||||
|
name: 'pre14Compatible',
|
||||||
|
fieldLabel: this.pre14CompatibleText,
|
||||||
|
helpText: this.pre14CompatibleHelpText,
|
||||||
|
inputValue: 'true'
|
||||||
|
},{
|
||||||
|
xtype: 'checkbox',
|
||||||
|
name: 'pre15Compatible',
|
||||||
|
fieldLabel: this.pre15CompatibleText,
|
||||||
|
helpText: this.pre15CompatibleHelpText,
|
||||||
|
inputValue: 'true'
|
||||||
|
},{
|
||||||
|
xtype: 'checkbox',
|
||||||
|
name: 'pre16Compatible',
|
||||||
|
fieldLabel: this.pre16CompatibleText,
|
||||||
|
helpText: this.pre16CompatibleHelpText,
|
||||||
|
inputValue: 'true'
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user