mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 02:06:18 +01:00
improve svn compatibility modus
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* Copyright (c) 2010, Sebastian Sdorra
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of SCM-Manager; nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* http://bitbucket.org/sdorra/scm-manager
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.repository;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public enum Compatibility
|
||||
{
|
||||
NONE(false, false, false), PRE14(true, true, true), PRE15(false, true, true),
|
||||
PRE16(false, false, true);
|
||||
|
||||
/**
|
||||
* Field description
|
||||
*
|
||||
* @param pre14Compatible
|
||||
* @param pre15Compatible
|
||||
* @param pre16Compatible
|
||||
*/
|
||||
private Compatibility(boolean pre14Compatible, boolean pre15Compatible,
|
||||
boolean pre16Compatible)
|
||||
{
|
||||
this.pre14Compatible = pre14Compatible;
|
||||
this.pre15Compatible = pre15Compatible;
|
||||
this.pre16Compatible = pre16Compatible;
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isPre14Compatible()
|
||||
{
|
||||
return pre14Compatible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isPre15Compatible()
|
||||
{
|
||||
return pre15Compatible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isPre16Compatible()
|
||||
{
|
||||
return pre16Compatible;
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private boolean pre14Compatible;
|
||||
|
||||
/** Field description */
|
||||
private boolean pre15Compatible;
|
||||
|
||||
/** Field description */
|
||||
private boolean pre16Compatible;
|
||||
}
|
||||
@@ -51,31 +51,14 @@ public class SvnConfig extends SimpleRepositoryConfig
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isPre14Compatible()
|
||||
public Compatibility getCompatibility()
|
||||
{
|
||||
return pre14Compatible;
|
||||
if (compatibility == null)
|
||||
{
|
||||
compatibility = Compatibility.NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isPre15Compatible()
|
||||
{
|
||||
return pre15Compatible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isPre16Compatible()
|
||||
{
|
||||
return pre16Compatible;
|
||||
return compatibility;
|
||||
}
|
||||
|
||||
//~--- set methods ----------------------------------------------------------
|
||||
@@ -84,43 +67,15 @@ public class SvnConfig extends SimpleRepositoryConfig
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param pre14Compatible
|
||||
* @param compatibility
|
||||
*/
|
||||
public void setPre14Compatible(boolean pre14Compatible)
|
||||
public void setCompatibility(Compatibility compatibility)
|
||||
{
|
||||
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;
|
||||
this.compatibility = compatibility;
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private boolean pre14Compatible = false;
|
||||
|
||||
/** Field description */
|
||||
private boolean pre15Compatible = false;
|
||||
|
||||
/** Field description */
|
||||
private boolean pre16Compatible = false;
|
||||
private Compatibility compatibility = Compatibility.NONE;
|
||||
}
|
||||
|
||||
@@ -154,22 +154,24 @@ public class SvnRepositoryHandler
|
||||
protected void create(Repository repository, File directory)
|
||||
throws RepositoryException, IOException
|
||||
{
|
||||
Compatibility comp = config.getCompatibility();
|
||||
|
||||
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());
|
||||
log.append(comp.isPre14Compatible()).append(", pre15Compatible=");
|
||||
log.append(comp.isPre15Compatible()).append(", pre16Compatible=");
|
||||
log.append(comp.isPre16Compatible());
|
||||
logger.debug(log.toString());
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
SVNRepositoryFactory.createLocalRepository(directory, null, true, false,
|
||||
config.isPre14Compatible(), config.isPre15Compatible(),
|
||||
config.isPre16Compatible());
|
||||
comp.isPre14Compatible(), comp.isPre15Compatible(),
|
||||
comp.isPre16Compatible());
|
||||
}
|
||||
catch (SVNException ex)
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@ Sonia.svn.ConfigPanel = Ext.extend(Sonia.config.SimpleConfigForm, {
|
||||
titleText: 'Subversion Settings',
|
||||
repositoryDirectoryText: 'Repository directory',
|
||||
// TODO i18n
|
||||
noneCompatibility: 'No compatibility modus',
|
||||
pre14CompatibleText: 'Pre 1.4 Compatible',
|
||||
pre15CompatibleText: 'Pre 1.5 Compatible',
|
||||
pre16CompatibleText: 'Pre 1.6 Compatible',
|
||||
@@ -60,23 +61,26 @@ Sonia.svn.ConfigPanel = Ext.extend(Sonia.config.SimpleConfigForm, {
|
||||
helpText: this.repositoryDirectoryHelpText,
|
||||
allowBlank : false
|
||||
},{
|
||||
xtype: 'checkbox',
|
||||
name: 'pre14Compatible',
|
||||
fieldLabel: this.pre14CompatibleText,
|
||||
helpText: this.pre14CompatibleHelpText,
|
||||
inputValue: 'true'
|
||||
xtype: 'radiogroup',
|
||||
name: 'compatibility',
|
||||
columns: 1,
|
||||
items: [{
|
||||
boxLabel: this.noneCompatibility,
|
||||
inputValue: 'NONE',
|
||||
name: 'compatibility'
|
||||
},{
|
||||
xtype: 'checkbox',
|
||||
name: 'pre15Compatible',
|
||||
fieldLabel: this.pre15CompatibleText,
|
||||
helpText: this.pre15CompatibleHelpText,
|
||||
inputValue: 'true'
|
||||
boxLabel: this.pre14CompatibleText,
|
||||
inputValue: 'PRE14',
|
||||
name: 'compatibility'
|
||||
},{
|
||||
xtype: 'checkbox',
|
||||
name: 'pre16Compatible',
|
||||
fieldLabel: this.pre16CompatibleText,
|
||||
helpText: this.pre16CompatibleHelpText,
|
||||
inputValue: 'true'
|
||||
boxLabel: this.pre15CompatibleText,
|
||||
inputValue: 'PRE15',
|
||||
name: 'compatibility'
|
||||
},{
|
||||
boxLabel: this.pre16CompatibleText,
|
||||
inputValue: 'PRE16',
|
||||
name: 'compatibility'
|
||||
}]
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user