diff --git a/plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnConfig.java b/plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnConfig.java index 829f11d5db..ace2cb3689 100644 --- a/plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnConfig.java +++ b/plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnConfig.java @@ -42,4 +42,85 @@ import javax.xml.bind.annotation.XmlRootElement; * @author Sebastian Sdorra */ @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; +} diff --git a/plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnRepositoryHandler.java b/plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnRepositoryHandler.java index 9c8083d627..b5f62c9928 100644 --- a/plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnRepositoryHandler.java +++ b/plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnRepositoryHandler.java @@ -38,6 +38,9 @@ package sonia.scm.repository; import com.google.inject.Inject; import com.google.inject.Singleton; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.io.SVNRepositoryFactory; @@ -71,6 +74,10 @@ public class SvnRepositoryHandler /** Field description */ 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 --------------------------------------------------------- /** @@ -147,9 +154,22 @@ public class SvnRepositoryHandler protected void create(Repository repository, File directory) 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 { - SVNRepositoryFactory.createLocalRepository(directory, true, false); + SVNRepositoryFactory.createLocalRepository(directory, null, true, false, + config.isPre14Compatible(), config.isPre15Compatible(), + config.isPre16Compatible()); } catch (SVNException ex) { diff --git a/plugins/scm-svn-plugin/src/main/resources/sonia/scm/svn.config.js b/plugins/scm-svn-plugin/src/main/resources/sonia/scm/svn.config.js index ecbda2b0ef..d5f10598b2 100644 --- a/plugins/scm-svn-plugin/src/main/resources/sonia/scm/svn.config.js +++ b/plugins/scm-svn-plugin/src/main/resources/sonia/scm/svn.config.js @@ -36,9 +36,17 @@ Sonia.svn.ConfigPanel = Ext.extend(Sonia.config.SimpleConfigForm, { // labels titleText: 'Subversion Settings', repositoryDirectoryText: 'Repository directory', + // TODO i18n + pre14CompatibleText: 'Pre 1.4 Compatible', + pre15CompatibleText: 'Pre 1.5 Compatible', + pre16CompatibleText: 'Pre 1.6 Compatible', // helpTexts repositoryDirectoryHelpText: 'Location of the Suberversion repositories.', + // TODO + pre14CompatibleHelpText: '', + pre15CompatibleHelpText: '', + pre16CompatibleHelpText: '', initComponent: function(){ @@ -51,6 +59,24 @@ Sonia.svn.ConfigPanel = Ext.extend(Sonia.config.SimpleConfigForm, { fieldLabel: this.repositoryDirectoryText, helpText: this.repositoryDirectoryHelpText, 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' }] }