Commits

Sebastian Sdorra committed 7e85f02

added compatibility switches to SvnConfig, see #13

  • Participants
  • Parent commits f564246

Comments (0)

Files changed (3)

plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnConfig.java

  * @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;
+}

plugins/scm-svn-plugin/src/main/java/sonia/scm/repository/SvnRepositoryHandler.java

 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;
 
   /** 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 ---------------------------------------------------------
 
   /**
   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)
     {

plugins/scm-svn-plugin/src/main/resources/sonia/scm/svn.config.js

   // 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(){
 
         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'
       }]
     }