Buix-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- 1440 discussions
r379 - in trunk/lutinvcs: lutinvcs-api/src/main/java/org/codelutin/vcs lutinvcs-api/src/main/java/org/codelutin/vcs/util lutinvcs-api/src/main/resources/i18n lutinvcs-core/src/main/java/org/codelutin/vcs/runner
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 07:31:39 +0000 (Sun, 06 Apr 2008)
New Revision: 379
Modified:
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/package.html
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java
trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.properties
trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSActionThread.java
Log:
i18n +...
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.java 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.java 2008-04-06 07:31:39 UTC (rev 379)
@@ -37,9 +37,20 @@
*/
public interface VCSConnexion {
+ /** @return the provider */
VCSProvider getProvider();
/**
+ * Initialize the connexion.
+ * <p/>
+ * If connexion can not be established, then the method {@link #hasFailed()} will always
+ * return <code>true</code>.
+ *
+ * @param config config to be used to initialize the connexion.
+ */
+ void init(VCSConnexionConfig config);
+
+ /**
* @return the working copy used, can be null if no working copy exists.
* @throws IllegalStateException if {@link #init(VCSConnexionConfig)} was not invoked before.
*/
@@ -58,16 +69,6 @@
VCSConnexionMode getMode() throws IllegalStateException;
/**
- * Initialize the connexion.
- * <p/>
- * If connexion can not be established, then the method {@link #hasFailed()} will always
- * return <code>true</code>.
- *
- * @param config config to be used to initialize the connexion.
- */
- void init(VCSConnexionConfig config);
-
- /**
* @return the config of the connexion
* @throws IllegalStateException if {@link #init(VCSConnexionConfig)} was not invoked before.
*/
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/package.html
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/package.html 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/package.html 2008-04-06 07:31:39 UTC (rev 379)
@@ -1,11 +1,11 @@
<html>
<body>
-<h1>Lutin vcs</h1>
+<h1>Lutin vcs api</h1>
Ensemble de l'api de base pour g�rer des Versionning Concurrent System (aka
<code>vcs</code>) tel que CVS ou SVN.
<br/>
-On retrouve ici des interfaces, des classes g�n�riques et les objets li�s aux vcs.
+On retrouve dans ce paquetage, uniquement des d�finitions de types.
<br/>
-Auncune impl�mentation n'est fournit actuellement ici.
+Auncune impl�mentation n'est fournie dans ce paquetage.
</body>
</html>
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java 2008-04-06 07:31:39 UTC (rev 379)
@@ -45,20 +45,15 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static protected final Log log = LogFactory.getLog(AbstractVCSHandler.class);
- /**
- * FilenameFilter to detect all files in a vcs working copy all files and directories that must be handled by vcs
- *
- * @see VCSHandler#getVersionnableFilenameFilter()
- */
+ public static final String LOCAL_SEP = File.separator;
+ public static final String LOCAL_SEP_PATTERN = "\\".equals(LOCAL_SEP) ? LOCAL_SEP + LOCAL_SEP : LOCAL_SEP;
+ public static final String REMOTE_SEP = "/";
+ public static final String REMOTE_SEP_PATTERN = "/";
+
protected final FilenameFilter versionnableFilenameFilter;
protected final FileFilter versionnableFileFilter;
protected final String confLocalDirName;
protected final String confLocalEntriesFilename;
- public static final String LOCAL_SEP = File.separator;
- public static final String LOCAL_SEP_PATTERN = "\\".equals(LOCAL_SEP) ?
- LOCAL_SEP + LOCAL_SEP : LOCAL_SEP;
- public static final String REMOTE_SEP = "/";
- public static final String REMOTE_SEP_PATTERN = "/";
protected AbstractVCSHandler(final String vCSConfLocalDirName, String vCSConfLocalEntriesFilename) {
this.confLocalDirName = vCSConfLocalDirName;
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java 2008-04-06 07:31:39 UTC (rev 379)
@@ -14,26 +14,33 @@
*/
package org.codelutin.vcs.util;
+import static org.codelutin.i18n.I18n._;
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSConnexionConfig;
-import org.codelutin.vcs.type.VCSConnexionMode;
import org.codelutin.vcs.VCSHandler;
import org.codelutin.vcs.VCSProvider;
+import org.codelutin.vcs.type.VCSConnexionMode;
-import java.lang.reflect.InvocationTargetException;
-
/**
- * base implementation of provider with a cached handler and list of connexions
+ * base implementation of provider with a cached common handler for all connexions.
*
* @author chemit
*/
public abstract class AbstractVCSProvider<C extends VCSConnexion, H extends VCSHandler<C>> implements VCSProvider<C, H> {
-
+ /**
+ * shared cached instance of handler to use for this provider.
+ * <p/>
+ * The handler can be used by all connexions for this provider
+ */
protected H handler;
+ /** name of ne provider */
protected final String name;
+ /** implementation of handler to use */
private final Class<H> handlerImpl;
+
+ /** implementation of connexion to use */
private final Class<C> connexionImpl;
protected AbstractVCSProvider(String name, Class<H> handlerImpl, Class<C> connexionImpl) {
@@ -57,14 +64,8 @@
C connexion = connexionImpl.getConstructor(VCSConnexionMode.class, getClass()).newInstance(mode, this);
connexion.init(config);
return connexion;
- } catch (InstantiationException e) {
- throw new RuntimeException("could not instanciate connexion " + connexionImpl + " for reason " + e.getMessage());
- } catch (IllegalAccessException e) {
- throw new RuntimeException("could not instanciate connexion " + connexionImpl + " for reason " + e.getMessage());
- } catch (InvocationTargetException e) {
- throw new RuntimeException("could not instanciate connexion " + connexionImpl + " for reason " + e.getMessage());
- } catch (NoSuchMethodException e) {
- throw new RuntimeException("could not instanciate connexion " + connexionImpl + " for reason " + e.getMessage());
+ } catch (Exception e) {
+ throw new RuntimeException(_("lutinvcs.error.provider.init.connexion", connexionImpl, this, e.getCause()));
}
}
@@ -72,17 +73,15 @@
if (handler == null) {
try {
handler = handlerImpl.newInstance();
- } catch (InstantiationException e) {
- throw new RuntimeException("could not instanciate the handler " + handlerImpl + " for reason " + e.getMessage());
- } catch (IllegalAccessException e) {
- throw new RuntimeException("could not instanciate the handler " + handlerImpl + " for reason " + e.getMessage());
+ } catch (Exception e) {
+ throw new RuntimeException(_("lutinvcs.error.provider.init.handler", handlerImpl, this, e.getCause()));
}
}
}
protected void checkHandlerInit() throws IllegalStateException {
if (handler == null) {
- throw new IllegalStateException("handler was not init in " + this);
+ throw new IllegalStateException(_("lutinvcs.error.provider.noinit", handler, this));
}
}
Modified: trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.properties 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.properties 2008-04-06 07:31:39 UTC (rev 379)
@@ -9,6 +9,9 @@
lutinvcs.action.revert=revert
lutinvcs.action.update=update
lutinvcs.error.checkout.dir=Can''t checkout dir {0}
+lutinvcs.error.provider.init.connexion=could not instanciate connexion {0}, for provider {1}, reason\: {2}
+lutinvcs.error.provider.init.handler=could not instanciate handler {0}, for provider {1}, reason\: {2}
+lutinvcs.error.provider.noinit=handler {0} was not init for provider {1}
lutinvcs.location.all=All
lutinvcs.location.local=Local
lutinvcs.location.remote=Remote
Modified: trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties 2008-04-06 07:31:39 UTC (rev 379)
@@ -9,6 +9,9 @@
lutinvcs.action.revert=Rollback
lutinvcs.action.update=Update
lutinvcs.error.checkout.dir=Ne peut pas uploader le fichier ''{0}''
+lutinvcs.error.provider.init.connexion=Erreur lors de l''instanciation de la connexion {0}, provider {1}, cause\: {2}
+lutinvcs.error.provider.init.handler=Erreur lors de l''instanciation du handler {0}, provider {1}, cause\: {2}
+lutinvcs.error.provider.noinit=Le handler {0} n''a pas \u00E9t\u00E9 initialis\u00E9 pour le provider {1}
lutinvcs.location.all=All
lutinvcs.location.local=Local
lutinvcs.location.remote=Remote
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSActionThread.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSActionThread.java 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSActionThread.java 2008-04-06 07:31:39 UTC (rev 379)
@@ -56,9 +56,11 @@
catch (Throwable eee) {
if (log.isWarnEnabled()) {
log.warn(_("lutinvcs.error.thread.action", item), eee);
+ //TODO Deal with errors
}
+ } finally {
+ log.info("Stop " + getName() + " at " + new Date());
}
- log.info("Stop " + getName() + " at " + new Date());
}
protected void doAction(VCSActionManager.QueueItem item) throws VCSException {
1
0
06 Apr '08
Author: tchemit
Date: 2008-04-06 07:04:12 +0000 (Sun, 06 Apr 2008)
New Revision: 378
Modified:
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSFactory.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSActionManager.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java
trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHandler.java
trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockConnexion.java
trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockVCSHandler.java
trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java
trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHandler.java
trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHelper.java
trunk/lutinvcs/lutinvcs-provider-svn/src/test/java/org/codelutin/vcs/impl/svn/FindTypeRepoTest.java
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java
Log:
un paquetage pour contenir les constantes (Enum)
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSFactory.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSFactory.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/VCSFactory.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -23,6 +23,7 @@
import org.apache.commons.logging.LogFactory;
import org.codelutin.util.StringUtil;
import org.codelutin.vcs.runner.VCSActionManager;
+import org.codelutin.vcs.type.VCSConnexionMode;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSActionManager.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSActionManager.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSActionManager.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,7 +14,7 @@
*/
package org.codelutin.vcs.runner;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
import java.util.concurrent.PriorityBlockingQueue;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractConfirmUIHandler.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,7 +14,7 @@
*/
package org.codelutin.vcs.ui.handler;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.ui.VCSUIConstants;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractDiffUIHandler.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,7 +14,7 @@
*/
package org.codelutin.vcs.ui.handler;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.ui.VCSUIConstants;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/AbstractSynchUIHandler.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,8 +14,8 @@
*/
package org.codelutin.vcs.ui.handler;
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.VCSUIConstants;
import org.codelutin.vcs.ui.model.SynchUIModel;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/handler/VCSAbsractAction.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -16,7 +16,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import javax.swing.AbstractAction;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractUIModel.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -18,7 +18,7 @@
import org.apache.commons.logging.LogFactory;
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.VCSException;
import java.beans.PropertyChangeListener;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/AbstractVCSEntriesTableModel.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -20,13 +20,13 @@
package org.codelutin.vcs.ui.model;
import static org.codelutin.i18n.I18n._;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSEntries;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSState;
+import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.util.VCSEntriesImpl;
import javax.swing.ListSelectionModel;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/ConfirmUIModel.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,9 +14,9 @@
*/
package org.codelutin.vcs.ui.model;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSEntryLocation;
import static org.codelutin.vcs.ui.VCSUIConstants.ACTION_PROPERTY_CHANGED;
import static org.codelutin.vcs.ui.VCSUIConstants.MESSAGE_HISTORY_PROPERTY_CHANGED;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffPanelUIModel.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -16,7 +16,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.VCSHandler;
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/DiffUIModel.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,9 +14,9 @@
*/
package org.codelutin.vcs.ui.model;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.VCSUIConstants;
/**
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SimpleVCSEntriesTableModelImpl.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -15,7 +15,7 @@
package org.codelutin.vcs.ui.model;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSState;
+import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.ui.VCSUIConstants;
/** @author chemit */
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java
===================================================================
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/ui/model/SynchUIModel.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,8 +14,8 @@
*/
package org.codelutin.vcs.ui.model;
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.VCSUIConstants;
/**
Modified: trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -16,7 +16,7 @@
import org.codelutin.vcs.CVSProvider;
import org.codelutin.vcs.VCSConnexionConfig;
-import org.codelutin.vcs.VCSConnexionMode;
+import org.codelutin.vcs.type.VCSConnexionMode;
import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.util.AbstractVCSConnexion;
import org.netbeans.lib.cvsclient.CVSRoot;
Modified: trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHandler.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHandler.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -4,7 +4,7 @@
import org.codelutin.util.FileUtil;
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSState;
+import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.util.AbstractVCSHandler;
import org.netbeans.lib.cvsclient.command.FileInfoContainer;
import org.netbeans.lib.cvsclient.command.log.LogInformation;
Modified: trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockConnexion.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockConnexion.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockConnexion.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,11 +14,11 @@
*/
package org.codelutin.vcs.impl.mock;
-import org.codelutin.vcs.ConnectionState;
+import org.codelutin.vcs.type.ConnectionState;
+import org.codelutin.vcs.type.VCSConnexionMode;
import org.codelutin.vcs.MockProvider;
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSConnexionMode;
import org.codelutin.vcs.util.AbstractVCSConnexion;
/** @author chemit */
Modified: trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockVCSHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockVCSHandler.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockVCSHandler.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -15,7 +15,7 @@
package org.codelutin.vcs.impl.mock;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSState;
+import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.util.AbstractVCSHandler;
import java.io.File;
Modified: trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -15,10 +15,10 @@
package org.codelutin.vcs.impl.svn;
import static org.codelutin.i18n.I18n._;
-import org.codelutin.vcs.ConnectionState;
+import org.codelutin.vcs.type.ConnectionState;
+import org.codelutin.vcs.type.VCSConnexionMode;
import org.codelutin.vcs.SVNProvider;
import org.codelutin.vcs.VCSConnexionConfig;
-import org.codelutin.vcs.VCSConnexionMode;
import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.VCSRuntimeException;
import org.codelutin.vcs.util.AbstractVCSConnexion;
Modified: trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHandler.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHandler.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -23,11 +23,11 @@
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.VCSRuntimeException;
-import org.codelutin.vcs.VCSState;
-import static org.codelutin.vcs.VCSState.OUT_OF_DATE;
-import static org.codelutin.vcs.VCSState.OUT_OF_DATE_AND_MODIFIED;
-import static org.codelutin.vcs.VCSState.UP_TO_DATE;
-import org.codelutin.vcs.VCSStatus;
+import org.codelutin.vcs.type.VCSState;
+import static org.codelutin.vcs.type.VCSState.OUT_OF_DATE;
+import static org.codelutin.vcs.type.VCSState.OUT_OF_DATE_AND_MODIFIED;
+import static org.codelutin.vcs.type.VCSState.UP_TO_DATE;
+import org.codelutin.vcs.type.VCSStatus;
import org.codelutin.vcs.util.AbstractVCSHandler;
import org.tmatesoft.svn.core.ISVNDirEntryHandler;
import org.tmatesoft.svn.core.ISVNLogEntryHandler;
Modified: trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHelper.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHelper.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHelper.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -24,7 +24,7 @@
import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.util.AbstractVCSHandler;
import org.codelutin.vcs.VCSRuntimeException;
-import org.codelutin.vcs.VCSTypeRepo;
+import org.codelutin.vcs.type.VCSTypeRepo;
import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNNodeKind;
Modified: trunk/lutinvcs/lutinvcs-provider-svn/src/test/java/org/codelutin/vcs/impl/svn/FindTypeRepoTest.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-svn/src/test/java/org/codelutin/vcs/impl/svn/FindTypeRepoTest.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-provider-svn/src/test/java/org/codelutin/vcs/impl/svn/FindTypeRepoTest.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -2,7 +2,7 @@
import junit.framework.TestCase;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSTypeRepo;
+import org.codelutin.vcs.type.VCSTypeRepo;
/**
* User: tony
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/ConfirmUIHandler.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,7 +14,7 @@
*/
package org.codelutin.vcs.ui;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
import org.codelutin.vcs.ui.model.ConfirmUIModel;
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/DiffUIHandler.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,7 +14,7 @@
*/
package org.codelutin.vcs.ui;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/SynchUIHandler.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -1,8 +1,8 @@
package org.codelutin.vcs.ui;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
import org.codelutin.vcs.ui.model.SynchUIModel;
Modified: trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-ui/src/main/java/org/codelutin/vcs/ui/VCSPopupAction.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -14,9 +14,9 @@
*/
package org.codelutin.vcs.ui;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.handler.VCSAbsractAction;
import org.codelutin.vcs.ui.model.AbstractVCSEntriesTableModel;
Modified: trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java
===================================================================
--- trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-ui/src/test/java/org/codelutin/vcs/ui/UITest.java 2008-04-06 07:04:12 UTC (rev 378)
@@ -16,12 +16,12 @@
import org.codelutin.i18n.I18n;
import org.codelutin.vcs.VCSConnexion;
-import org.codelutin.vcs.VCSConnexionMode;
+import org.codelutin.vcs.type.VCSConnexionMode;
+import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.VCSFactory;
-import org.codelutin.vcs.VCSState;
-import org.codelutin.vcs.VCSType;
+import org.codelutin.vcs.type.VCSType;
import org.codelutin.vcs.ui.model.SynchUIModel;
import org.codelutin.vcs.util.VCSConnexionConfigImpl;
import org.codelutin.vcs.util.VCSEntryImpl;
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JConfirmUI.jaxx 2008-04-06 07:04:12 UTC (rev 378)
@@ -2,7 +2,7 @@
resizable='false' height='300' width='400'>
<style source="common.css"/>
<script>
- import org.codelutin.vcs.VCSAction;
+ import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.handler.AbstractConfirmUIHandler;
import org.codelutin.vcs.ui.model.ConfirmUIModel ;
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-06 07:04:12 UTC (rev 378)
@@ -2,8 +2,8 @@
<style source="common.css"/>
<script>
- import org.codelutin.vcs.VCSAction;
- import org.codelutin.vcs.VCSEntryLocation;
+ import org.codelutin.vcs.type.VCSAction;
+ import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
import org.codelutin.vcs.ui.VCSUIConstants;
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-06 07:04:12 UTC (rev 378)
@@ -2,8 +2,8 @@
<style source="common.css"/>
<script>
- import org.codelutin.vcs.VCSAction;
- import org.codelutin.vcs.VCSEntryLocation;
+ import org.codelutin.vcs.type.VCSAction;
+ import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler;
import org.codelutin.vcs.ui.model.SynchUIModel;
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx 2008-04-06 07:03:42 UTC (rev 377)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JVCSPopup.jaxx 2008-04-06 07:04:12 UTC (rev 378)
@@ -1,6 +1,6 @@
<JPopupMenu>
<script>
- import org.codelutin.vcs.VCSAction;
+ import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.ui.handler.VCSAbsractAction;
protected VCSAbsractAction dispatchAction;
1
0
r377 - trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 07:03:42 +0000 (Sun, 06 Apr 2008)
New Revision: 377
Modified:
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSConnexion.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSConnexionConfigImpl.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSEntriesImpl.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSEntryImpl.java
Log:
un paquetage pour contenir les constantes (Enum)
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSConnexion.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSConnexion.java 2008-04-06 07:03:17 UTC (rev 376)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSConnexion.java 2008-04-06 07:03:42 UTC (rev 377)
@@ -17,18 +17,18 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelutin.util.ListenerSet;
-import org.codelutin.vcs.ConnectionState;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.ConnectionState;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSConnexionEvent;
import org.codelutin.vcs.VCSConnexionEvent.Type;
import org.codelutin.vcs.VCSConnexionEventListener;
-import org.codelutin.vcs.VCSConnexionMode;
+import org.codelutin.vcs.type.VCSConnexionMode;
import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.VCSHandler;
import org.codelutin.vcs.VCSProvider;
-import org.codelutin.vcs.VCSState;
+import org.codelutin.vcs.type.VCSState;
import java.io.File;
import java.io.FileFilter;
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java 2008-04-06 07:03:17 UTC (rev 376)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java 2008-04-06 07:03:42 UTC (rev 377)
@@ -26,7 +26,7 @@
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSHandler;
import org.codelutin.vcs.VCSRuntimeException;
-import org.codelutin.vcs.VCSTypeRepo;
+import org.codelutin.vcs.type.VCSTypeRepo;
import java.io.File;
import java.io.FileFilter;
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java 2008-04-06 07:03:17 UTC (rev 376)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java 2008-04-06 07:03:42 UTC (rev 377)
@@ -16,7 +16,7 @@
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSConnexionConfig;
-import org.codelutin.vcs.VCSConnexionMode;
+import org.codelutin.vcs.type.VCSConnexionMode;
import org.codelutin.vcs.VCSHandler;
import org.codelutin.vcs.VCSProvider;
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSConnexionConfigImpl.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSConnexionConfigImpl.java 2008-04-06 07:03:17 UTC (rev 376)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSConnexionConfigImpl.java 2008-04-06 07:03:42 UTC (rev 377)
@@ -15,8 +15,8 @@
package org.codelutin.vcs.util;
import org.codelutin.vcs.VCSConnexionConfig;
-import org.codelutin.vcs.VCSType;
-import org.codelutin.vcs.VCSTypeRepo;
+import org.codelutin.vcs.type.VCSType;
+import org.codelutin.vcs.type.VCSTypeRepo;
import java.io.File;
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSEntriesImpl.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSEntriesImpl.java 2008-04-06 07:03:17 UTC (rev 376)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSEntriesImpl.java 2008-04-06 07:03:42 UTC (rev 377)
@@ -14,13 +14,13 @@
*/
package org.codelutin.vcs.util;
-import org.codelutin.vcs.VCSAction;
+import org.codelutin.vcs.type.VCSAction;
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSEntries;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSEntryLocation;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSState;
+import org.codelutin.vcs.type.VCSState;
import javax.swing.ListSelectionModel;
import java.util.ArrayList;
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSEntryImpl.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSEntryImpl.java 2008-04-06 07:03:17 UTC (rev 376)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/VCSEntryImpl.java 2008-04-06 07:03:42 UTC (rev 377)
@@ -16,8 +16,8 @@
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSEntry;
-import org.codelutin.vcs.VCSEntryLocation;
-import org.codelutin.vcs.VCSState;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSState;
import org.codelutin.vcs.VCSException;
import java.io.BufferedReader;
1
0
r376 - trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 07:03:17 +0000 (Sun, 06 Apr 2008)
New Revision: 376
Modified:
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexionConfig.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntries.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntry.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandler.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSProvider.java
Log:
un paquetage pour contenir les constantes (Enum)
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.java 2008-04-06 07:03:02 UTC (rev 375)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.java 2008-04-06 07:03:17 UTC (rev 376)
@@ -14,6 +14,9 @@
*/
package org.codelutin.vcs;
+import org.codelutin.vcs.type.VCSConnexionMode;
+import org.codelutin.vcs.type.VCSState;
+
import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
@@ -28,7 +31,7 @@
* The method {@link #init(VCSConnexionConfig)} must be invoked before using the connexion.
* <p/>
* Note: you should not instanciate directly this class but use
- * {@link org.codelutin.vcs.VCSProvider#newConnection(org.codelutin.vcs.VCSConnexionMode , VCSConnexionConfig)} instead.
+ * {@link org.codelutin.vcs.VCSProvider#newConnection(org.codelutin.vcs.type.VCSConnexionMode , VCSConnexionConfig)} instead.
*
* @author chemit
*/
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexionConfig.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexionConfig.java 2008-04-06 07:03:02 UTC (rev 375)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexionConfig.java 2008-04-06 07:03:17 UTC (rev 376)
@@ -18,6 +18,9 @@
* ##% */
package org.codelutin.vcs;
+import org.codelutin.vcs.type.VCSType;
+import org.codelutin.vcs.type.VCSTypeRepo;
+
import java.io.File;
/**
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntries.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntries.java 2008-04-06 07:03:02 UTC (rev 375)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntries.java 2008-04-06 07:03:17 UTC (rev 376)
@@ -14,6 +14,10 @@
*/
package org.codelutin.vcs;
+import org.codelutin.vcs.type.VCSAction;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSState;
+
import javax.swing.ListSelectionModel;
import java.util.List;
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntry.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntry.java 2008-04-06 07:03:02 UTC (rev 375)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntry.java 2008-04-06 07:03:17 UTC (rev 376)
@@ -14,6 +14,9 @@
*/
package org.codelutin.vcs;
+import org.codelutin.vcs.type.VCSEntryLocation;
+import org.codelutin.vcs.type.VCSState;
+
import java.io.BufferedReader;
import java.io.File;
import java.io.Serializable;
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandler.java 2008-04-06 07:03:02 UTC (rev 375)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandler.java 2008-04-06 07:03:17 UTC (rev 376)
@@ -19,6 +19,8 @@
*##%*/
package org.codelutin.vcs;
+import org.codelutin.vcs.type.VCSState;
+
import java.io.File;
import java.io.FileFilter;
import java.io.FilenameFilter;
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSProvider.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSProvider.java 2008-04-06 07:03:02 UTC (rev 375)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSProvider.java 2008-04-06 07:03:17 UTC (rev 376)
@@ -14,6 +14,8 @@
*/
package org.codelutin.vcs;
+import org.codelutin.vcs.type.VCSConnexionMode;
+
/**
* The contract to be realized to provide vcs communication.
* <p/>
1
0
r375 - in trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs: . type
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 07:03:02 +0000 (Sun, 06 Apr 2008)
New Revision: 375
Added:
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/ConnectionState.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSAction.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSConnexionMode.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSEntryLocation.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSState.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSStatus.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSType.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSTypeRepo.java
Removed:
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/ConnectionState.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSAction.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexionMode.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntryLocation.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSState.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSStatus.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSType.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSTypeRepo.java
Log:
un paquetage pour contenir les constantes (Enum)
Deleted: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/ConnectionState.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/ConnectionState.java 2008-04-06 07:02:17 UTC (rev 374)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/ConnectionState.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -1,37 +0,0 @@
-/*
-* \#\#% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
-* Tony Chemit
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-* \#\#% */
-package org.codelutin.vcs;
-
-/**
- * Une enumeration pour definir l'�tat du connexion � un serveur vcs.
- *
- * @author chemit
- */
-public enum ConnectionState {
- /** lorsque la connexion a �t� initialis�e (valid�e) mais pas ouverte */
- INIT,
- /** lorsque la connexion n'a pas encore initialis�e */
- UNDEFINED,
- /** lorsque la connexion est ok, mais que l'on est pas connect� */
- OFF_LINE,
- /** lorsque la connexion est �tablie avec succes */
- ON_LINE,
- /** lorsque la connexion a tent�e de s'initialiser sans succes */
- ERROR
-}
Deleted: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSAction.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSAction.java 2008-04-06 07:02:17 UTC (rev 374)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSAction.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -1,100 +0,0 @@
-/* ##%
-* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
-* Benjamin Poussin, Tony Chemit
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*##%*/
-package org.codelutin.vcs;
-
-import static org.codelutin.i18n.I18n._;
-import static org.codelutin.i18n.I18n.n_;
-
-/**
- * a VCSAction represents an action that can be realized on a file in working
- * copy or on remote repository.
- * <p/>
- * Each <code>VCSAction</code> has 4 properties :
- * <ul>
- * <li>libelle : i18n to be used for this action</li>
- * <li>visible : flag to say if action should be visible in ui</li>
- * <li>backup : flag to say if this action need backup</li>
- * <li>write : flag to say if this action need write access to repository</li>
- * </ul>
- *
- * @author chemit
- */
-(a)org.codelutin.i18n.I18nable
-public enum VCSAction {
- /** to refresh the state of a file on repository */
- REFRESH(n_("lutinvcs.action.refresh"), true, false, false, false),
- /** to add an unversionned file on repository */
- ADD(n_("lutinvcs.action.add"), true, false, true, true),
- /** to delete locally and from repository */
- DELETE(n_("lutinvcs.action.delete"), true, true, true, true),
- /** to get another version from repository */
- UPDATE(n_("lutinvcs.action.update"), true, true, false, false),
- /** to get a clean copy from repository */
- OVERWRITE_AND_UPDATE(n_("lutinvcs.action.overwriteAndUpdate"), true, true, false, false),
- /** commit a modification to repository */
- COMMIT(n_("lutinvcs.action.commit"), true, false, true, true),
- /** to rollback to working base revision */
- REVERT(n_("lutinvcs.action.revert"), true, true, false, false),
- /** to acquire a file from repository */
- CHECKOUT(n_("lutinvcs.action.checkout"), true, false, false, false),
- /** to obtain the changelog of a file */
- CHANGELOG(n_("lutinvcs.action.changeLog"), false, false, false, false),
- /** to obtain diif */
- DIFF(n_("lutinvcs.action.diff"), false, false, false, false);
-
- /** libelle of the action */
- private final String libelle;
- /** flag to say if action should be visible in ui TODO Delete this */
- private final boolean visible;
- /** flag to say if this action need backup TODO Delete this ? */
- private final boolean backup;
- /** flag to say if this action need write access to repository */
- private final boolean write;
- /** flag to say if this action need a commit message to be performed */
- private boolean commit;
-
- VCSAction(String libelle, boolean visible, boolean backup, boolean commit, boolean write) {
- this.libelle = libelle;
- this.visible = visible;
- this.backup = backup;
- this.commit = commit;
- this.write = write;
- }
-
- public String getLibelle() {
- return _(libelle);
- }
-
- public boolean isVisible() {
- return visible;
- }
-
- public boolean isBackup() {
- return backup;
- }
-
- public boolean isWrite() {
- return write;
- }
-
- public boolean isCommit() {
- return commit;
- }
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexionMode.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexionMode.java 2008-04-06 07:02:17 UTC (rev 374)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexionMode.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -1,26 +0,0 @@
-/**
- * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
- * This program is free software; you
- * can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. This program is
- * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
- * should have received a copy of the GNU General Public License along with this
- * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
- * - Suite 330, Boston, MA 02111-1307, USA.
- * # #%
- */
-package org.codelutin.vcs;
-
-/**
- * L'ensemble des typs de connexion VCS connues
- *
- * @author chemit
- */
-public enum VCSConnexionMode {
- ANONYMOUS,
- PASSWORD,
- SSH
-}
Deleted: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntryLocation.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntryLocation.java 2008-04-06 07:02:17 UTC (rev 374)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntryLocation.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -1,65 +0,0 @@
-/* ##%
-* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
-* Benjamin Poussin, Tony Chemit
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*##%*/
-package org.codelutin.vcs;
-
-import static org.codelutin.i18n.I18n._;
-import static org.codelutin.i18n.I18n.n_;
-
-/**
- * a VCSEntryLocation represents where a {@link VCSEntry} was found, should be :
- * <p/>
- * <ul>
- * <li>{@link #ALL} : if entry is both on local and on remote</li>
- * <li>{@link #LOCAL} : if entry is only on local </li>
- * <li>{@link #REMOTE} : if entryis only on remote</li>
- * <p/>
- * </ul>
- * VCSAction represents an action that can be realized on a file in working
- * copy or on remote repository.
- * <p/>
- * Each <code>VCSAction</code> has 4 properties :
- * <ul>
- * <li>libelle : i18n to be used for this action</li>
- * <li>visible : flag to say if action should be visible in ui</li>
- * <li>backup : flag to say if this action need backup</li>
- * <li>write : flag to say if this action need write access to repository</li>
- * </ul>
- *
- * @author chemit
- */
-(a)org.codelutin.i18n.I18nable
-public enum VCSEntryLocation {
- ALL(n_("lutinvcs.location.all")),
- LOCAL(n_("lutinvcs.location.local")),
- REMOTE(n_("lutinvcs.location.remote")),
- UNKNOW(n_("lutinvcs.location.unknown"));
-
- /** libelle of location */
- private final String libelle;
-
-
- public String getLibelle() {
- return _(libelle);
- }
-
- VCSEntryLocation(String libelle) {
- this.libelle = libelle;
- }
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSState.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSState.java 2008-04-06 07:02:17 UTC (rev 374)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSState.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -1,180 +0,0 @@
-package org.codelutin.vcs;
-
-import static org.codelutin.i18n.I18n._;
-import static org.codelutin.i18n.I18n.n_;
-import static org.codelutin.vcs.VCSAction.ADD;
-import static org.codelutin.vcs.VCSAction.CHANGELOG;
-import static org.codelutin.vcs.VCSAction.COMMIT;
-import static org.codelutin.vcs.VCSAction.DELETE;
-import static org.codelutin.vcs.VCSAction.DIFF;
-import static org.codelutin.vcs.VCSAction.OVERWRITE_AND_UPDATE;
-import static org.codelutin.vcs.VCSAction.REVERT;
-import static org.codelutin.vcs.VCSAction.UPDATE;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * This constants represents all states for a file.
- * Should contains all static data concerning file state (libelle, actions,
- * icon link, color,...).
- * We associate for each state, all VCSActions authorized for this state.
- */
-(a)org.codelutin.i18n.I18nable
-public enum VCSState {
-
- /**
- * when a local file matches the latest remote copy.
- * <br/>
- * The only action for this state is to delete the file, nothing else.
- */
- UP_TO_DATE("uptodate", n_("lutinvcs.state.uptodate"), VCSEntryLocation.ALL, DELETE),
-
- /**
- * when a local file matches a remote copy but not the latest one.
- * <br/>
- * This state owns 3 actions :
- * <ul>
- * <li>{@link VCSAction#UPDATE}</li>
- * <li>{@link VCSAction#DIFF}</li>
- * <li>{@link VCSAction#CHANGELOG}</li>
- * </ul>
- */
- OUT_OF_DATE("outofdate", n_("lutinvcs.state.outofdate"), VCSEntryLocation.REMOTE, UPDATE, DIFF, CHANGELOG),
-
- /**
- * when a local file does not matches his remote latest copy, but is based
- * on.
- * This state owns 4 actions :
- * <ul>
- * <li>{@link VCSAction#COMMIT}</li>
- * <li>{@link VCSAction#REVERT}</li>
- * <li>{@link VCSAction#OVERWRITE_AND_UPDATE}</li>
- * <li>{@link VCSAction#DIFF}</li>
- * </ul>
- */
- MODIFIED("modified", n_("lutinvcs.state.modified"), VCSEntryLocation.LOCAL, COMMIT, OVERWRITE_AND_UPDATE, REVERT, DIFF),
-
- /**
- * when a local file does not match the working version remote copy and
- * there is also new yougest version on remote : this is the worse case
- * (conflict).
- * This state owns 4 actions :
- * <ul>
- * <li>{@link VCSAction#REVERT}</li>
- * <li>{@link VCSAction#OVERWRITE_AND_UPDATE}</li>
- * <li>{@link VCSAction#DIFF}</li>
- * <li>{@link VCSAction#CHANGELOG}</li>
- * </ul>
- */
- OUT_OF_DATE_AND_MODIFIED("outofdateAndModified", n_("lutinvcs.state.outofdateAndModified"), VCSEntryLocation.ALL, OVERWRITE_AND_UPDATE, REVERT, DIFF, CHANGELOG),
-
- /**
- * when a local file does not exist on remote repository.
- * * This state owns 1 action :
- * <ul>
- * <li>{@link VCSAction#ADD}</li>
- * </ul>
- */
- UNVERSIONNED("unversionned", n_("lutinvcs.state.unversionned"), VCSEntryLocation.LOCAL, ADD, REVERT),
-
- /**
- * when a file exists on remote repository but not locally.
- * * This state owns 1 action :
- * <ul>
- * <li>{@link VCSAction#UPDATE}</li>
- * </ul>
- */
- MISSING("missing", n_("lutinvcs.state.missing"), VCSEntryLocation.REMOTE, UPDATE),
-
- /**
- * when a file is unversionned or missing : this special and durty state
- * correspond for exemple when you want to add a file under a no checked
- * directory...
- * <br/>
- * <b> This state needs special add and update operation to create unchecked
- * directories).</b>
- * This state owns 2 action :
- * <ul>
- * <li>{@link VCSAction#ADD}</li>
- * <li>{@link VCSAction#UPDATE}</li>
- * <p/>
- * </ul>
- */
- UNVERSIONNED_OR_MISSING("unversionnedOrMissing", n_("lutinvcs.state.unversionnedOrMissing"), VCSEntryLocation.LOCAL, ADD, UPDATE),
-
- REMOVED("removed", n_("lutinvcs.state.removed"), VCSEntryLocation.LOCAL, DELETE, REVERT),
-
- /** to deal with other cases (...) */
- UNKNOWN("unknown", n_("lutinvcs.state.unknown"), null);
-
-
- /** libelle to be used */
- private final String libelle;
- /** key of the state */
- private final String key;
-
- /** VCSAction associated with this state */
- private final List<VCSAction> actions;
-
- /** location of the state */
- private VCSEntryLocation location;
-
- VCSState(String key, String libelle, VCSEntryLocation location, VCSAction... actions) {
- this.location = location;
- this.libelle = libelle;
- List<VCSAction> actions1 = new ArrayList<VCSAction>(Arrays.asList(actions));
- // refresh action is enabled for all states
- actions1.add(VCSAction.REFRESH);
- this.actions = Collections.unmodifiableList(actions1);
- this.key = key;
-
- }
-
- public String libelle() {
- return _(libelle);
- }
-
- public List<VCSAction> getActions() {
- return actions;
- }
-
- public String getKey() {
- return key;
- }
-
- public VCSEntryLocation getLocation() {
- return location;
- }
-
- public boolean isLocal() {
- return location != VCSEntryLocation.REMOTE;
- }
-
- public boolean isRemote() {
- return location != VCSEntryLocation.LOCAL;
- }
-
- public boolean authorizeAction(VCSAction... actions) {
- java.util.List<VCSAction> acts = java.util.Arrays.asList(actions);
- for (VCSAction vcsAction : this.actions) {
- if (acts.contains(vcsAction)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @param key key of required state
- * @return the <code>VCSState</code> with <code>key</code> as key value,
- * or <code>null</code> if no state found.
- */
- public static VCSState valueOfKey(String key) {
- for (VCSState state : VCSState.values())
- if (state.key.equals(key)) return state;
- return null;
- }
-}
\ No newline at end of file
Deleted: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSStatus.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSStatus.java 2008-04-06 07:02:17 UTC (rev 374)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSStatus.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -1,32 +0,0 @@
-/* *##%
-* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
-* Benjamin Poussin, Tony Chemit
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*##%*/
-package org.codelutin.vcs;
-
-public enum VCSStatus {
- NORMAL,
- ADDED,
- MODIFIED,
- DELETED,
- UNVERSIONED,
- MISSING,
- IGNORED,
- CONFLICTED,
- NONE
-}
Deleted: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSType.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSType.java 2008-04-06 07:02:17 UTC (rev 374)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSType.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -1,31 +0,0 @@
-/* *##%
-* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
-* Benjamin Poussin, Tony Chemit
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*##%*/
-package org.codelutin.vcs;
-
-/**
- * This type-safe class representing a type of vcs (SVN,CVS,...)
- *
- * @author chemit
- */
-public enum VCSType {
-
- CVS, SVN, MOCK
-
-}
Deleted: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSTypeRepo.java
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSTypeRepo.java 2008-04-06 07:02:17 UTC (rev 374)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSTypeRepo.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -1,55 +0,0 @@
-/* *##%
-* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
-* Benjamin Poussin, Tony Chemit
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*##%*/
-package org.codelutin.vcs;
-
-/**
- * type of repository to used, if no typeRepo (for CVS, use {@link #NONE}
- *
- * @author chemit
- */
-public enum VCSTypeRepo {
- /** head repo : is writable */
- HEAD("trunk", false),
- /** tag repo : readonly */
- TAG("tags", true),
- /** branch repo : should be writable ? */
- BRANCH("branches", false),
- /** no type of repo : readonly */
- NONE(null, true);
-
- /** the path of the type of repo */
- final String path;
-
- /** flag to say this type of repo is readonly or not. */
- final boolean readonly;
-
- VCSTypeRepo(String path, boolean readOnly) {
- this.path = path;
- this.readonly = readOnly;
- }
-
- public String getPath() {
- return path;
- }
-
- public boolean isReadonly() {
- return readonly;
- }
-}
Copied: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/ConnectionState.java (from rev 371, trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/ConnectionState.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/ConnectionState.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/ConnectionState.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -0,0 +1,37 @@
+/*
+* \#\#% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
+* Tony Chemit
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+* \#\#% */
+package org.codelutin.vcs.type;
+
+/**
+ * Une enumeration pour definir l'�tat du connexion � un serveur vcs.
+ *
+ * @author chemit
+ */
+public enum ConnectionState {
+ /** lorsque la connexion a �t� initialis�e (valid�e) mais pas ouverte */
+ INIT,
+ /** lorsque la connexion n'a pas encore initialis�e */
+ UNDEFINED,
+ /** lorsque la connexion est ok, mais que l'on est pas connect� */
+ OFF_LINE,
+ /** lorsque la connexion est �tablie avec succes */
+ ON_LINE,
+ /** lorsque la connexion a tent�e de s'initialiser sans succes */
+ ERROR
+}
Copied: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSAction.java (from rev 371, trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSAction.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSAction.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSAction.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -0,0 +1,100 @@
+/* ##%
+* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
+* Benjamin Poussin, Tony Chemit
+*
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*##%*/
+package org.codelutin.vcs.type;
+
+import static org.codelutin.i18n.I18n._;
+import static org.codelutin.i18n.I18n.n_;
+
+/**
+ * a VCSAction represents an action that can be realized on a file in working
+ * copy or on remote repository.
+ * <p/>
+ * Each <code>VCSAction</code> has 4 properties :
+ * <ul>
+ * <li>libelle : i18n to be used for this action</li>
+ * <li>visible : flag to say if action should be visible in ui</li>
+ * <li>backup : flag to say if this action need backup</li>
+ * <li>write : flag to say if this action need write access to repository</li>
+ * </ul>
+ *
+ * @author chemit
+ */
+(a)org.codelutin.i18n.I18nable
+public enum VCSAction {
+ /** to refresh the state of a file on repository */
+ REFRESH(n_("lutinvcs.action.refresh"), true, false, false, false),
+ /** to add an unversionned file on repository */
+ ADD(n_("lutinvcs.action.add"), true, false, true, true),
+ /** to delete locally and from repository */
+ DELETE(n_("lutinvcs.action.delete"), true, true, true, true),
+ /** to get another version from repository */
+ UPDATE(n_("lutinvcs.action.update"), true, true, false, false),
+ /** to get a clean copy from repository */
+ OVERWRITE_AND_UPDATE(n_("lutinvcs.action.overwriteAndUpdate"), true, true, false, false),
+ /** commit a modification to repository */
+ COMMIT(n_("lutinvcs.action.commit"), true, false, true, true),
+ /** to rollback to working base revision */
+ REVERT(n_("lutinvcs.action.revert"), true, true, false, false),
+ /** to acquire a file from repository */
+ CHECKOUT(n_("lutinvcs.action.checkout"), true, false, false, false),
+ /** to obtain the changelog of a file */
+ CHANGELOG(n_("lutinvcs.action.changeLog"), false, false, false, false),
+ /** to obtain diif */
+ DIFF(n_("lutinvcs.action.diff"), false, false, false, false);
+
+ /** libelle of the action */
+ private final String libelle;
+ /** flag to say if action should be visible in ui TODO Delete this */
+ private final boolean visible;
+ /** flag to say if this action need backup TODO Delete this ? */
+ private final boolean backup;
+ /** flag to say if this action need write access to repository */
+ private final boolean write;
+ /** flag to say if this action need a commit message to be performed */
+ private boolean commit;
+
+ VCSAction(String libelle, boolean visible, boolean backup, boolean commit, boolean write) {
+ this.libelle = libelle;
+ this.visible = visible;
+ this.backup = backup;
+ this.commit = commit;
+ this.write = write;
+ }
+
+ public String getLibelle() {
+ return _(libelle);
+ }
+
+ public boolean isVisible() {
+ return visible;
+ }
+
+ public boolean isBackup() {
+ return backup;
+ }
+
+ public boolean isWrite() {
+ return write;
+ }
+
+ public boolean isCommit() {
+ return commit;
+ }
+}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSConnexionMode.java (from rev 371, trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexionMode.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSConnexionMode.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSConnexionMode.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -0,0 +1,26 @@
+/**
+ * # #% Copyright (C) 2008 Code Lutin, Tony Chemit
+ * This program is free software; you
+ * can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. This program is
+ * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details. You
+ * should have received a copy of the GNU General Public License along with this
+ * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place
+ * - Suite 330, Boston, MA 02111-1307, USA.
+ * # #%
+ */
+package org.codelutin.vcs.type;
+
+/**
+ * L'ensemble des typs de connexion VCS connues
+ *
+ * @author chemit
+ */
+public enum VCSConnexionMode {
+ ANONYMOUS,
+ PASSWORD,
+ SSH
+}
Copied: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSEntryLocation.java (from rev 371, trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSEntryLocation.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSEntryLocation.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSEntryLocation.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -0,0 +1,65 @@
+/* ##%
+* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
+* Benjamin Poussin, Tony Chemit
+*
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*##%*/
+package org.codelutin.vcs.type;
+
+import static org.codelutin.i18n.I18n._;
+import static org.codelutin.i18n.I18n.n_;
+
+/**
+ * a VCSEntryLocation represents where a {@link org.codelutin.vcs.VCSEntry} was found, should be :
+ * <p/>
+ * <ul>
+ * <li>{@link #ALL} : if entry is both on local and on remote</li>
+ * <li>{@link #LOCAL} : if entry is only on local </li>
+ * <li>{@link #REMOTE} : if entryis only on remote</li>
+ * <p/>
+ * </ul>
+ * VCSAction represents an action that can be realized on a file in working
+ * copy or on remote repository.
+ * <p/>
+ * Each <code>VCSAction</code> has 4 properties :
+ * <ul>
+ * <li>libelle : i18n to be used for this action</li>
+ * <li>visible : flag to say if action should be visible in ui</li>
+ * <li>backup : flag to say if this action need backup</li>
+ * <li>write : flag to say if this action need write access to repository</li>
+ * </ul>
+ *
+ * @author chemit
+ */
+(a)org.codelutin.i18n.I18nable
+public enum VCSEntryLocation {
+ ALL(n_("lutinvcs.location.all")),
+ LOCAL(n_("lutinvcs.location.local")),
+ REMOTE(n_("lutinvcs.location.remote")),
+ UNKNOW(n_("lutinvcs.location.unknown"));
+
+ /** libelle of location */
+ private final String libelle;
+
+
+ public String getLibelle() {
+ return _(libelle);
+ }
+
+ VCSEntryLocation(String libelle) {
+ this.libelle = libelle;
+ }
+}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSState.java (from rev 371, trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSState.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSState.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSState.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -0,0 +1,180 @@
+package org.codelutin.vcs.type;
+
+import static org.codelutin.i18n.I18n._;
+import static org.codelutin.i18n.I18n.n_;
+import static org.codelutin.vcs.type.VCSAction.ADD;
+import static org.codelutin.vcs.type.VCSAction.CHANGELOG;
+import static org.codelutin.vcs.type.VCSAction.COMMIT;
+import static org.codelutin.vcs.type.VCSAction.DELETE;
+import static org.codelutin.vcs.type.VCSAction.DIFF;
+import static org.codelutin.vcs.type.VCSAction.OVERWRITE_AND_UPDATE;
+import static org.codelutin.vcs.type.VCSAction.REVERT;
+import static org.codelutin.vcs.type.VCSAction.UPDATE;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * This constants represents all states for a file.
+ * Should contains all static data concerning file state (libelle, actions,
+ * icon link, color,...).
+ * We associate for each state, all VCSActions authorized for this state.
+ */
+(a)org.codelutin.i18n.I18nable
+public enum VCSState {
+
+ /**
+ * when a local file matches the latest remote copy.
+ * <br/>
+ * The only action for this state is to delete the file, nothing else.
+ */
+ UP_TO_DATE("uptodate", n_("lutinvcs.state.uptodate"), VCSEntryLocation.ALL, DELETE),
+
+ /**
+ * when a local file matches a remote copy but not the latest one.
+ * <br/>
+ * This state owns 3 actions :
+ * <ul>
+ * <li>{@link VCSAction#UPDATE}</li>
+ * <li>{@link VCSAction#DIFF}</li>
+ * <li>{@link VCSAction#CHANGELOG}</li>
+ * </ul>
+ */
+ OUT_OF_DATE("outofdate", n_("lutinvcs.state.outofdate"), VCSEntryLocation.REMOTE, UPDATE, DIFF, CHANGELOG),
+
+ /**
+ * when a local file does not matches his remote latest copy, but is based
+ * on.
+ * This state owns 4 actions :
+ * <ul>
+ * <li>{@link VCSAction#COMMIT}</li>
+ * <li>{@link VCSAction#REVERT}</li>
+ * <li>{@link VCSAction#OVERWRITE_AND_UPDATE}</li>
+ * <li>{@link VCSAction#DIFF}</li>
+ * </ul>
+ */
+ MODIFIED("modified", n_("lutinvcs.state.modified"), VCSEntryLocation.LOCAL, COMMIT, OVERWRITE_AND_UPDATE, REVERT, DIFF),
+
+ /**
+ * when a local file does not match the working version remote copy and
+ * there is also new yougest version on remote : this is the worse case
+ * (conflict).
+ * This state owns 4 actions :
+ * <ul>
+ * <li>{@link VCSAction#REVERT}</li>
+ * <li>{@link VCSAction#OVERWRITE_AND_UPDATE}</li>
+ * <li>{@link VCSAction#DIFF}</li>
+ * <li>{@link VCSAction#CHANGELOG}</li>
+ * </ul>
+ */
+ OUT_OF_DATE_AND_MODIFIED("outofdateAndModified", n_("lutinvcs.state.outofdateAndModified"), VCSEntryLocation.ALL, OVERWRITE_AND_UPDATE, REVERT, DIFF, CHANGELOG),
+
+ /**
+ * when a local file does not exist on remote repository.
+ * * This state owns 1 action :
+ * <ul>
+ * <li>{@link VCSAction#ADD}</li>
+ * </ul>
+ */
+ UNVERSIONNED("unversionned", n_("lutinvcs.state.unversionned"), VCSEntryLocation.LOCAL, ADD, REVERT),
+
+ /**
+ * when a file exists on remote repository but not locally.
+ * * This state owns 1 action :
+ * <ul>
+ * <li>{@link VCSAction#UPDATE}</li>
+ * </ul>
+ */
+ MISSING("missing", n_("lutinvcs.state.missing"), VCSEntryLocation.REMOTE, UPDATE),
+
+ /**
+ * when a file is unversionned or missing : this special and durty state
+ * correspond for exemple when you want to add a file under a no checked
+ * directory...
+ * <br/>
+ * <b> This state needs special add and update operation to create unchecked
+ * directories).</b>
+ * This state owns 2 action :
+ * <ul>
+ * <li>{@link VCSAction#ADD}</li>
+ * <li>{@link VCSAction#UPDATE}</li>
+ * <p/>
+ * </ul>
+ */
+ UNVERSIONNED_OR_MISSING("unversionnedOrMissing", n_("lutinvcs.state.unversionnedOrMissing"), VCSEntryLocation.LOCAL, ADD, UPDATE),
+
+ REMOVED("removed", n_("lutinvcs.state.removed"), VCSEntryLocation.LOCAL, DELETE, REVERT),
+
+ /** to deal with other cases (...) */
+ UNKNOWN("unknown", n_("lutinvcs.state.unknown"), null);
+
+
+ /** libelle to be used */
+ private final String libelle;
+ /** key of the state */
+ private final String key;
+
+ /** VCSAction associated with this state */
+ private final List<VCSAction> actions;
+
+ /** location of the state */
+ private VCSEntryLocation location;
+
+ VCSState(String key, String libelle, VCSEntryLocation location, VCSAction... actions) {
+ this.location = location;
+ this.libelle = libelle;
+ List<VCSAction> actions1 = new ArrayList<VCSAction>(Arrays.asList(actions));
+ // refresh action is enabled for all states
+ actions1.add(VCSAction.REFRESH);
+ this.actions = Collections.unmodifiableList(actions1);
+ this.key = key;
+
+ }
+
+ public String libelle() {
+ return _(libelle);
+ }
+
+ public List<VCSAction> getActions() {
+ return actions;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public VCSEntryLocation getLocation() {
+ return location;
+ }
+
+ public boolean isLocal() {
+ return location != VCSEntryLocation.REMOTE;
+ }
+
+ public boolean isRemote() {
+ return location != VCSEntryLocation.LOCAL;
+ }
+
+ public boolean authorizeAction(VCSAction... actions) {
+ java.util.List<VCSAction> acts = java.util.Arrays.asList(actions);
+ for (VCSAction vcsAction : this.actions) {
+ if (acts.contains(vcsAction)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @param key key of required state
+ * @return the <code>VCSState</code> with <code>key</code> as key value,
+ * or <code>null</code> if no state found.
+ */
+ public static VCSState valueOfKey(String key) {
+ for (VCSState state : VCSState.values())
+ if (state.key.equals(key)) return state;
+ return null;
+ }
+}
\ No newline at end of file
Copied: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSStatus.java (from rev 371, trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSStatus.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSStatus.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSStatus.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -0,0 +1,32 @@
+/* *##%
+* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
+* Benjamin Poussin, Tony Chemit
+*
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*##%*/
+package org.codelutin.vcs.type;
+
+public enum VCSStatus {
+ NORMAL,
+ ADDED,
+ MODIFIED,
+ DELETED,
+ UNVERSIONED,
+ MISSING,
+ IGNORED,
+ CONFLICTED,
+ NONE
+}
Copied: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSType.java (from rev 371, trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSType.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSType.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSType.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -0,0 +1,31 @@
+/* *##%
+* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
+* Benjamin Poussin, Tony Chemit
+*
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*##%*/
+package org.codelutin.vcs.type;
+
+/**
+ * This type-safe class representing a type of vcs (SVN,CVS,...)
+ *
+ * @author chemit
+ */
+public enum VCSType {
+
+ CVS, SVN, MOCK
+
+}
Copied: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSTypeRepo.java (from rev 371, trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSTypeRepo.java)
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSTypeRepo.java (rev 0)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/VCSTypeRepo.java 2008-04-06 07:03:02 UTC (rev 375)
@@ -0,0 +1,55 @@
+/* *##%
+* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
+* Benjamin Poussin, Tony Chemit
+*
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*##%*/
+package org.codelutin.vcs.type;
+
+/**
+ * type of repository to used, if no typeRepo (for CVS, use {@link #NONE}
+ *
+ * @author chemit
+ */
+public enum VCSTypeRepo {
+ /** head repo : is writable */
+ HEAD("trunk", false),
+ /** tag repo : readonly */
+ TAG("tags", true),
+ /** branch repo : should be writable ? */
+ BRANCH("branches", false),
+ /** no type of repo : readonly */
+ NONE(null, true);
+
+ /** the path of the type of repo */
+ final String path;
+
+ /** flag to say this type of repo is readonly or not. */
+ final boolean readonly;
+
+ VCSTypeRepo(String path, boolean readOnly) {
+ this.path = path;
+ this.readonly = readOnly;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public boolean isReadonly() {
+ return readonly;
+ }
+}
1
0
r374 - trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
by tchemit@users.labs.libre-entreprise.org 06 Apr '08
06 Apr '08
Author: tchemit
Date: 2008-04-06 07:02:17 +0000 (Sun, 06 Apr 2008)
New Revision: 374
Added:
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/type/
Log:
un paquetage our contenir les constantes (Enum)
1
0
r373 - trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 05 Apr '08
by tchemit@users.labs.libre-entreprise.org 05 Apr '08
05 Apr '08
Author: tchemit
Date: 2008-04-05 20:50:50 +0000 (Sat, 05 Apr 2008)
New Revision: 373
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
Log:
refactor PRovider, Handler and Connexion
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-05 20:48:07 UTC (rev 372)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-05 20:50:50 UTC (rev 373)
@@ -23,7 +23,7 @@
@Override
public void setVisible(boolean b) {
- if (getModel().getModel().getLocation() == null) {
+ if (getModel().getModel().getLocation() == VCSEntryLocation.UNKNOW) {
// first launch, no tab model selected,choose one
allTab.doClick();
}
1
0
r372 - in trunk/lutinvcs: lutinvcs-api/src/main/resources/i18n lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 05 Apr '08
by tchemit@users.labs.libre-entreprise.org 05 Apr '08
05 Apr '08
Author: tchemit
Date: 2008-04-05 20:48:07 +0000 (Sat, 05 Apr 2008)
New Revision: 372
Modified:
trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.properties
trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
Log:
refactor PRovider, Handler and Connexion
Modified: trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.properties 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.properties 2008-04-05 20:48:07 UTC (rev 372)
@@ -12,6 +12,7 @@
lutinvcs.location.all=All
lutinvcs.location.local=Local
lutinvcs.location.remote=Remote
+lutinvcs.location.unknown=Unknow
lutinvcs.state.missing=missing
lutinvcs.state.modified=modified
lutinvcs.state.outofdate=out of date
Modified: trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties
===================================================================
--- trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.properties 2008-04-05 20:48:07 UTC (rev 372)
@@ -12,6 +12,7 @@
lutinvcs.location.all=All
lutinvcs.location.local=Local
lutinvcs.location.remote=Remote
+lutinvcs.location.unknown=Unknow
lutinvcs.state.missing=non pr\u00E9sent
lutinvcs.state.modified=modifi\u00E9
lutinvcs.state.outofdate=obsol\u00E8te
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-05 20:43:39 UTC (rev 371)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-05 20:48:07 UTC (rev 372)
@@ -39,7 +39,7 @@
}
protected void selectFile(JTable table) {
- model.setFileModel(model.getModel().getData(table.getSelectionModel())[0]);
+ //model.setFileModel(model.getModel().getData(table.getSelectionModel())[0]);
}
protected void doAction(VCSAction action) {
1
0
r371 - trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui
by tchemit@users.labs.libre-entreprise.org 05 Apr '08
by tchemit@users.labs.libre-entreprise.org 05 Apr '08
05 Apr '08
Author: tchemit
Date: 2008-04-05 20:43:39 +0000 (Sat, 05 Apr 2008)
New Revision: 371
Modified:
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
Log:
refactor PRovider, Handler and Connexion
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-05 20:43:32 UTC (rev 370)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JDiffUI.jaxx 2008-04-05 20:43:39 UTC (rev 371)
@@ -3,6 +3,7 @@
<script>
import org.codelutin.vcs.VCSAction;
+ import org.codelutin.vcs.VCSEntryLocation;
import org.codelutin.vcs.ui.handler.AbstractDiffUIHandler;
import org.codelutin.vcs.ui.VCSUIConstants;
@@ -14,9 +15,9 @@
@Override
public void setVisible(boolean b) {
- if (getHandler().getModel().getTabModel() == null) {
+ if (getModel().getLocation() == null) {
// first launch, no tab model selected,choose one
- selectTab(VCSUIConstants.DIFF_ALL_MODEL_PROPERTY);
+ allTab.doClick();
}
super.setVisible(b);
}
@@ -33,12 +34,12 @@
this.handler = handler;
}
- protected void selectTab(String tabname) {
- model.setTabModel(model.getModel(tabname));
+ protected void selectTab(VCSEntryLocation location) {
+ getModel().setLocation(location);
}
protected void selectFile(JTable table) {
- model.setFileModel(model.getTabModel().getData(table.getSelectionModel())[0]);
+ model.setFileModel(model.getModel().getData(table.getSelectionModel())[0]);
}
protected void doAction(VCSAction action) {
@@ -77,15 +78,15 @@
<JToggleButton id='allTab' selected='true' buttonGroup='tabs' mnemonic="A"
toolTipText="lutinvcs.tabs.diff.tooltip.all"
icon='{createImageIcon("remote_vs_local.png")}'
- onActionPerformed='selectTab("modelSynchAll")'/>
+ onActionPerformed='selectTab(VCSEntryLocation.ALL)'/>
<JToggleButton id='localTab' selected='false' buttonGroup='tabs' mnemonic="L"
toolTipText="lutinvcs.tabs.diff.tooltip.local"
icon='{createImageIcon("local_vs_local.png")}'
- onActionPerformed='selectTab("modelSynchLocal")'/>
+ onActionPerformed='selectTab(VCSEntryLocation.LOCAL)'/>
<JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' mnemonic="R"
icon='{createImageIcon("remote_vs_remote.png")}'
toolTipText="lutinvcs.tabs.diff.tooltip.remote"
- onActionPerformed='selectTab("modelSynchRemote")'/>
+ onActionPerformed='selectTab(VCSEntryLocation.REMOTE)'/>
<JButton id='nextDiff' toolTipText="lutinvcs.action.tooltip.nextDiff"
@@ -120,16 +121,16 @@
<cell fill='both' weighty='1' weightx='2'>
<JPanel id='preview' layout='{cardLayout}'>
<JScrollPane id='allContent' styleClass='diffScroll' constraints='"modelSynchAll"'>
- <JTable id="modelDiffAllTable" styleClass='diffTable'
- onMouseClicked="selectFile(modelDiffAllTable)"/>
+ <JTable id="allTable" styleClass='diffTable'
+ onMouseClicked="selectFile(allTable)"/>
</JScrollPane>
<JScrollPane id='localContent' styleClass='diffScroll' constraints='"modelSynchLocal"'>
- <JTable id="modelDiffLocalTable" styleClass='diffTable'
- onMouseClicked="selectFile(modelDiffLocalTable)"/>
+ <JTable id="localTable" styleClass='diffTable'
+ onMouseClicked="selectFile(localTable)"/>
</JScrollPane>
<JScrollPane id='remoteContent' styleClass='diffScroll' constraints='"modelSynchRemote"'
- onMouseClicked="selectFile(modelDiffRemoteTable)">
- <JTable id="modelDiffRemoteTable" styleClass='diffTable'/>
+ onMouseClicked="selectFile(remoteTable)">
+ <JTable id="remoteTable" styleClass='diffTable'/>
</JScrollPane>
</JPanel>
</cell>
Modified: trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx
===================================================================
--- trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-05 20:43:32 UTC (rev 370)
+++ trunk/lutinvcs/lutinvcs-ui-jaxx/src/main/uimodel/org/codelutin/vcs/ui/JSynchUI.jaxx 2008-04-05 20:43:39 UTC (rev 371)
@@ -3,6 +3,7 @@
<script>
import org.codelutin.vcs.VCSAction;
+ import org.codelutin.vcs.VCSEntryLocation;
import org.codelutin.vcs.ui.handler.AbstractSynchUIHandler;
import org.codelutin.vcs.ui.model.SynchUIModel;
@@ -20,6 +21,14 @@
return (SynchUIModel) super.getModel();
}
+ @Override
+ public void setVisible(boolean b) {
+ if (getModel().getModel().getLocation() == null) {
+ // first launch, no tab model selected,choose one
+ allTab.doClick();
+ }
+ super.setVisible(b);
+ }
public JTable getTable(String modelName) {
return (JTable) get$objectMap().get(modelName+"Table");
}
@@ -28,19 +37,10 @@
return (JVCSPopup) get$objectMap().get(modelName+"Popup");
}
- @Override
- public void setVisible(boolean b) {
- if (getHandler().getModel().getTabModel() == null) {
- // first launch, no tab model selected,choose one
- selectTab(VCSUIConstants.SYNCH_ALL_MODEL_PROPERTY);
+ protected void setLocation(VCSEntryLocation location) {
+ getModel().setLocation(location);
}
- super.setVisible(b);
- }
- protected void selectTab(String tabname) {
- getModel().setTabModel(getModel().getModel(tabname));
- }
-
protected void doAllAction(VCSAction action) {
getModel().doAllAction(action);
}
@@ -52,22 +52,22 @@
<JPopupMenu enabled='false'>
</JPopupMenu>
- <org.codelutin.vcs.ui.JVCSPopup id="modelSynchAllPopup"/>
- <org.codelutin.vcs.ui.JVCSPopup id="modelSynchLocalPopup"/>
- <org.codelutin.vcs.ui.JVCSPopup id="modelSynchRemotePopup"/>
+ <org.codelutin.vcs.ui.JVCSPopup id="allPopup"/>
+ <org.codelutin.vcs.ui.JVCSPopup id="localPopup"/>
+ <org.codelutin.vcs.ui.JVCSPopup id="remotePopup"/>
<Table>
<row fill='both'>
<cell fill='both' weightx='1'>
<JToolBar>
- <JToggleButton id='allTab' selected='true' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A"
+ <JToggleButton id='allTab' buttonGroup='tabs' text='lutinvcs.tabs.all' mnemonic="A"
toolTipText="lutinvcs.tabs.tooltip.all"
- onActionPerformed='selectTab("modelSynchAll")'/>
+ onActionPerformed='setLocation(VCSEntryLocation.ALL)'/>
<JToggleButton id='localTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.local'
mnemonic="L" toolTipText="lutinvcs.tabs.tooltip.local"
- onActionPerformed='selectTab("modelSynchLocal")'/>
+ onActionPerformed='setLocation(VCSEntryLocation.LOCAL)'/>
<JToggleButton id='remoteTab' selected='false' buttonGroup='tabs' text='lutinvcs.tabs.remote'
mnemonic="R" toolTipText="lutinvcs.tabs.tooltip.remote"
- onActionPerformed='selectTab("modelSynchRemote")'/>
+ onActionPerformed='setLocation(VCSEntryLocation.REMOTE)'/>
<JButton id='refreshAll' toolTipText="lutinvcs.action.tooltip.refreshAll"
icon='{createImageIcon("autoRefresh.png")}'
@@ -98,13 +98,13 @@
<cell fill='both' weighty='1' weightx='2'>
<JPanel id='preview' layout='{cardLayout}'>
<JScrollPane id='allContent' styleClass='updateScroll' constraints='"modelSynchAll"'>
- <JTable id="modelSynchAllTable" styleClass='updateTable'/>
+ <JTable id="allTable" styleClass='updateTable'/>
</JScrollPane>
<JScrollPane id='localContent' styleClass='updateScroll' constraints='"modelSynchLocal"'>
- <JTable id="modelSynchLocalTable" styleClass='updateTable'/>
+ <JTable id="localTable" styleClass='updateTable'/>
</JScrollPane>
<JScrollPane id='remoteContent' styleClass='updateScroll' constraints='"modelSynchRemote"'>
- <JTable id="modelSynchRemoteTable" styleClass='updateTable'/>
+ <JTable id="remoteTable" styleClass='updateTable'/>
</JScrollPane>
</JPanel>
</cell>
1
0
r370 - in trunk/lutinvcs: lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn
by tchemit@users.labs.libre-entreprise.org 05 Apr '08
by tchemit@users.labs.libre-entreprise.org 05 Apr '08
05 Apr '08
Author: tchemit
Date: 2008-04-05 20:43:32 +0000 (Sat, 05 Apr 2008)
New Revision: 370
Modified:
trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java
trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHandler.java
trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHelper.java
trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java
trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHandler.java
trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHelper.java
Log:
refactor PRovider, Handler and Connexion
Modified: trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java 2008-04-05 20:41:33 UTC (rev 369)
+++ trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java 2008-04-05 20:43:32 UTC (rev 370)
@@ -14,23 +14,119 @@
*/
package org.codelutin.vcs.impl.cvs;
+import org.codelutin.vcs.CVSProvider;
+import org.codelutin.vcs.VCSConnexionConfig;
+import org.codelutin.vcs.VCSConnexionMode;
+import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.util.AbstractVCSConnexion;
-import org.codelutin.vcs.VCSConfig;
-import org.codelutin.vcs.VCSHandler;
+import org.netbeans.lib.cvsclient.CVSRoot;
+import org.netbeans.lib.cvsclient.Client;
+import org.netbeans.lib.cvsclient.admin.StandardAdminHandler;
+import org.netbeans.lib.cvsclient.command.GlobalOptions;
+import org.netbeans.lib.cvsclient.connection.Connection;
+import org.netbeans.lib.cvsclient.connection.PServerConnection;
/** @author chemit */
public class CVSConnexion extends AbstractVCSConnexion {
- public void init(VCSConfig config, VCSHandler handler) {
+ public CVSConnexion(VCSConnexionMode mode, CVSProvider provider) {
+ super(mode, provider);
}
+ public void init(VCSConnexionConfig config) {
+ //TODO
+ this.config = config;
+ }
+
+ public void testConnection() throws VCSException {
+ //TODO
+ }
+
@Override
public void close() throws IllegalStateException {
+ //TODO
checkInit();
}
@Override
public void open() throws IllegalStateException {
+ //TODO
checkInit();
}
+
+ public String getRemoteUrl() {
+ checkInit();
+ return (config.isUseSshConnexion() ? ":ext:" : ":pserver:") + config.getUserName() + "@" + config.getHostName() + config.getRemotePath();
+ }
+
+ protected Client getClient() {
+ checkInit();
+ // WARNING TO DEVELOPERS:
+ // Please be warned that attempting to reuse one open connection for
+ // more commands is not supported by cvs servers very well.
+ // You are advised to open a new Connection each time.
+ // If you still want to proceed, please do:
+ // System.setProperty("javacvs.multiple_commands_warning", "false")
+ // That will disable this message.
+
+ // d'ou l'initialisation syst�matique de la connexion.
+
+ String hostName = getConfig().getHostName();
+
+ // R�pertoire distant du CVS
+ String repository = getConfig().getRemotePath();
+
+ String userName = getConfig().getUserName();
+
+ Connection connection;
+ if (getConfig().isUseSshConnexion()) {
+ throw new RuntimeException(CVSHelper.class + " you can not used a ssh connexion with CVS, use instead SVN configuration");
+ // connexion ssh2
+ //TODO Make this works
+ // Localisation de la clef priv�e (pour la connexion ssh2).
+ //File keyFile = new File(config.getKeyFile());
+ // Stockage des cl�s publics pour les hosts ou il y a eu connexion en ssh2
+ //String host = config.getHost();
+ // Localisation de la clef priv�e (pour la connexion ssh2).
+ //File keyFile = new File(IsisConfig.getProperties().getProperty(
+ // IsisConfig.CVS_KEY_FILE));
+ // Stockage des cl�s publics pour les hosts ou il y a eu connexion en ssh2
+ //String host = IsisConfig.getProperties().getProperty(
+ // IsisConfig.CVS_HOST);
+
+// Ssh2Connexion ssh2Connection = new Ssh2Connexion();
+// ssh2Connection.setUserName(userName);
+// ssh2Connection.setHostName(hostName);
+// ssh2Connection.setKeyFile(keyFile);
+// ssh2Connection.setHost(host);
+// ssh2Connection.setRepository(repository);
+// connection = ssh2Connection;
+ } else {
+ String cvsrootString = ":pserver:" + userName + "@" + hostName + repository;
+ CVSRoot cvsroot = CVSRoot.parse(cvsrootString);
+ // connexion pserver
+ PServerConnection PServerConnection;
+ PServerConnection = new PServerConnection(cvsroot);
+// PServerConnection.setUserName(userName);
+// // PServerConnection.setEncodedPassword(encodedPassword);
+// PServerConnection.setHostName(hostName);
+// PServerConnection.setRepository(repository);
+ connection = PServerConnection;
+ }
+
+ // Le connexion est ouverte automatiquement � l'�x�cution de la
+ // commande CVS si elle n'a pas �t� ouverte pr�c�dement. Je l'ouvre pour
+ // obtenir les messages d'erreurs plus clair.
+ // connection.open();
+
+ return new Client(connection, new StandardAdminHandler());
+ }
+
+ public GlobalOptions getGlobalOptions() {
+ checkInit();
+ GlobalOptions result = new GlobalOptions();
+ String repository = getConfig().getRemotePath();
+ result.setCVSRoot(repository);
+ return result;
+ }
}
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHandler.java 2008-04-05 20:41:33 UTC (rev 369)
+++ trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHandler.java 2008-04-05 20:43:32 UTC (rev 370)
@@ -2,10 +2,10 @@
import static org.codelutin.i18n.I18n._;
import org.codelutin.util.FileUtil;
-import org.codelutin.vcs.util.AbstractVCSHandler;
-import org.codelutin.vcs.VCSConfig;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSException;
import org.codelutin.vcs.VCSState;
+import org.codelutin.vcs.util.AbstractVCSHandler;
import org.netbeans.lib.cvsclient.command.FileInfoContainer;
import org.netbeans.lib.cvsclient.command.log.LogInformation;
import org.netbeans.lib.cvsclient.command.status.StatusInformation;
@@ -23,27 +23,25 @@
* @author chemit
*/
-public class CVSHandler extends AbstractVCSHandler {
+public class CVSHandler extends AbstractVCSHandler<CVSConnexion> {
- public CVSHandler(VCSConfig config) {
- super(config, "CVS", "Entries");
+ public CVSHandler() {
+ super("CVS", "Entries");
}
- public void initWorkingCopy() throws VCSException {
+ public void initWorkingCopy(CVSConnexion connexion) throws VCSException {
+ VCSConnexionConfig config = connexion.getConfig();
File root = config.getLocalDatabasePath();
- if (!root.exists()) getLocalDatabasePath().mkdirs();
+ if (!root.exists()) config.getLocalDatabasePath().mkdirs();
//TODO Should checkout root remote directory unrecurse ?
//TODO to have vcs configuration file present in local database directory
//CVSHelper.checkout(root,"");
}
- public String getRemoteUrl() {
- return (config.isUseSshConnexion() ? ":ext:" : ":pserver:") + config.getUserName() + "@" + config.getHostName() + config.getRemotePath();
- }
- public boolean isOnRemote(File file) {
+ public boolean isOnRemote(CVSConnexion connexion, File file) {
boolean result = false;
if (file.isDirectory()) {
File cvsdir = new File(file, confLocalDirName);
@@ -64,9 +62,9 @@
return result;
}
- public boolean isUpToDate(File file) throws VCSException {
+ public boolean isUpToDate(CVSConnexion connexion, File file) throws VCSException {
- CVSCommandResult cvsResult = CVSHelper.cvsStatus(file);
+ CVSCommandResult cvsResult = CVSHelper.cvsStatus(connexion, file);
if (cvsResult.isError()) {
throw new VCSException(_("lutinvcs.error.status.files", cvsResult.getTrace().toString()));
}
@@ -86,12 +84,12 @@
return result;
}
- public void makeRemoteDir(String msg, String... dirNames) throws VCSException {
+ public void makeRemoteDir(CVSConnexion connexion, String msg, String... dirNames) throws VCSException {
//TODO
throw new RuntimeException(getClass().getName() + "#makeRemoteDir is not actually implemented");
}
- public void deleteRemoteDir(String commitMessage, String... dirNames) throws VCSException {
+ public void deleteRemoteDir(CVSConnexion connexion, String commitMessage, String... dirNames) throws VCSException {
throw new RuntimeException(getClass().getName() + "#deleteRemoteDir is not actually implemented");
//TODO
}
@@ -101,52 +99,52 @@
//TODO
}*/
- public VCSState getState(File fileState, Collection tmp) throws VCSException {
- return getState(fileState, tmp, true);
+ public VCSState getState(CVSConnexion connexion, File fileState, Collection tmp) throws VCSException {
+ return getState(connexion, fileState, tmp, true);
}
- public VCSState getState(File file, Collection tmp, boolean noremote) throws VCSException {
+ public VCSState getState(CVSConnexion connexion, File file, Collection tmp, boolean noremote) throws VCSException {
throw new RuntimeException(getClass().getName() + "#getState(File) is not actually implemented");
//TODO
}
- public long add(List<File> files, String msg) throws VCSException {
+ public long add(CVSConnexion connexion, List<File> files, String msg) throws VCSException {
log.debug("files to add: " + files);
- CVSCommandResult result = CVSHelper.cvsAdd(files);
+ CVSCommandResult result = CVSHelper.cvsAdd(connexion, files);
assertCommandResult(result, "Can''t add files: {0}");
- result = CVSHelper.cvsCommit(files, msg);
+ result = CVSHelper.cvsCommit(connexion, files, msg);
assertCommandResult(result, "Can''t commit files: {0}");
return -1;
}
- public void delete(List<File> files, String msg) throws VCSException {
+ public void delete(CVSConnexion connexion, List<File> files, String msg) throws VCSException {
- CVSCommandResult result = CVSHelper.cvsRemove(files);
+ CVSCommandResult result = CVSHelper.cvsRemove(connexion, files);
assertCommandResult(result, "Can''t remove files: {0}");
- result = CVSHelper.cvsCommit(files, msg);
+ result = CVSHelper.cvsCommit(connexion, files, msg);
assertCommandResult(result, "Can''t commit deleted files: {0}");
}
- public long commit(List<File> files, String msg) throws VCSException {
- add(files, msg);
+ public long commit(CVSConnexion connexion, List<File> files, String msg) throws VCSException {
+ add(connexion, files, msg);
return 0;
}
- public void update(File file) throws VCSException {
- CVSCommandResult result = CVSHelper.cvsUpdate(file);
+ public void update(CVSConnexion connexion, File file) throws VCSException {
+ CVSCommandResult result = CVSHelper.cvsUpdate(connexion, file);
assertCommandResult(result, "Can''t update files: {0}");
}
- public void checkout(File destDir, String module, boolean recurse) throws VCSException {
- CVSCommandResult result = CVSHelper.checkout(destDir, module);
+ public void checkout(CVSConnexion connexion, File destDir, String module, boolean recurse) throws VCSException {
+ CVSCommandResult result = CVSHelper.checkout(connexion, destDir, module);
assertCommandResult(result, "Can''t checkout files: {0}");
}
- public void checkoutFile(File destDir, String module) throws VCSException {
+ public void checkoutFile(CVSConnexion connexion, File destDir, String module) throws VCSException {
/*try {
new File(destDir,module).createNewFile();
} catch (IOException e) {
@@ -156,10 +154,10 @@
}
- public List<String> getRemoteStorageNames(File directory) {
+ public List<String> getRemoteStorageNames(CVSConnexion connexion, File directory) {
List<String> result = new ArrayList<String>();
try {
- CVSCommandResult cvsResult = CVSHelper.cvsLog(directory);
+ CVSCommandResult cvsResult = CVSHelper.cvsLog(connexion, directory);
for (FileInfoContainer info : cvsResult.getFileInfo()) {
if (info instanceof LogInformation) {
LogInformation status = (LogInformation) info;
@@ -177,14 +175,15 @@
* Retourne les messages de logs entre la version local et la remote ou null
* si les deux fichiers ont la meme version
*
- * @param file TODO
- * @param logInfo TODO
+ * @param connexion connexion to be used
+ * @param file TODO
+ * @param logInfo TODO
* @return le log ou null
* @throws VCSException TODO
*/
@SuppressWarnings("unchecked")
- public String getLogMessage(File file, LogInformation logInfo) throws VCSException {
- CVSCommandResult cvsResult = CVSHelper.cvsStatus(file);
+ public String getLogMessage(CVSConnexion connexion, File file, LogInformation logInfo) throws VCSException {
+ CVSCommandResult cvsResult = CVSHelper.cvsStatus(connexion, file);
if (cvsResult.isError()) {
throw new VCSException(_("lutinvcs.error.get.status.files", cvsResult.getTrace().toString()));
}
@@ -234,27 +233,27 @@
}
}
- public void revert(List<File> files) throws VCSException {
+ public void revert(CVSConnexion connexion, List<File> files) throws VCSException {
throw new RuntimeException(getClass().getName() + "#revert is not actually implemented");
//TODO
}
- public Object getRevision(File f) throws VCSException {
+ public Object getRevision(CVSConnexion connexion, File f) throws VCSException {
throw new RuntimeException(getClass().getName() + "#getRevision is not actually implemented");
//TODO
}
- public void update(File file, Object revision) throws VCSException {
+ public void update(CVSConnexion connexion, File file, Object revision) throws VCSException {
throw new RuntimeException(getClass().getName() + "#update(File,Object) is not actually implemented");
//TODO
}
- public String getDiff(File file) throws VCSException {
+ public String getDiff(CVSConnexion connexion, File file) throws VCSException {
throw new RuntimeException(getClass().getName() + "#getDiff(File,OutputStream) is not actually implemented");
//TODO
}
- public String getDiff(File file, Object againstRevision) throws VCSException {
+ public String getDiff(CVSConnexion connexion, File file, Object againstRevision) throws VCSException {
throw new RuntimeException(getClass().getName() + "#getDiff(File,Object,OutputStream) is not actually implemented");
//TODO
}
@@ -263,27 +262,27 @@
//TODO
}
- public boolean hasProtocoleChanged() {
+ public boolean hasProtocoleChanged(CVSConnexion connexion) {
throw new RuntimeException(getClass().getName() + "#hasProtocoleChanged() is not actually implemented");
}
- public String getChangeLog(File file) throws VCSException {
+ public String getChangeLog(CVSConnexion connexion, File file) throws VCSException {
throw new RuntimeException(getClass().getName() + "#getChangeLog((File) is not actually implemented");
//TODO
}
- public List getLog(Object startRevision, Object endRevision, File file) throws VCSException {
+ public List getLog(CVSConnexion connexion, Object startRevision, Object endRevision, File file) throws VCSException {
throw new RuntimeException(getClass().getName() + "#getLog(Object,Object,File) is not actually implemented");
//TODO
}
- public String getFileContent(File file, Object revision) throws VCSException {
+ public String getFileContent(CVSConnexion connexion, File file, Object revision) throws VCSException {
throw new RuntimeException(getClass().getName() + "#getFileContent(File,Object) is not actually implemented");
//TODO
}
- public long checkoutOnlyTheDirectory(File root, Object revision) throws VCSException {
- checkoutFile(root.getParentFile(), root.getName());
+ public long checkoutOnlyTheDirectory(CVSConnexion connexion, File root, Object revision) throws VCSException {
+ checkoutFile(connexion, root.getParentFile(), root.getName());
return -1;
//throw new RuntimeException(getClass().getName() + "#checkoutOnlyTheDirectory(File,Object) is not actually implemented");
//TODO
Modified: trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHelper.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHelper.java 2008-04-05 20:41:33 UTC (rev 369)
+++ trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSHelper.java 2008-04-05 20:43:32 UTC (rev 370)
@@ -34,11 +34,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.codelutin.i18n.I18n._;
-import org.codelutin.vcs.VCSConfig;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSRuntimeException;
-import org.codelutin.vcs.VCSType;
-import org.netbeans.lib.cvsclient.CVSRoot;
import org.netbeans.lib.cvsclient.Client;
import org.netbeans.lib.cvsclient.admin.Entry;
import org.netbeans.lib.cvsclient.admin.StandardAdminHandler;
@@ -53,8 +49,6 @@
import org.netbeans.lib.cvsclient.command.status.StatusCommand;
import org.netbeans.lib.cvsclient.command.update.UpdateCommand;
import org.netbeans.lib.cvsclient.connection.AuthenticationException;
-import org.netbeans.lib.cvsclient.connection.Connection;
-import org.netbeans.lib.cvsclient.connection.PServerConnection;
import org.netbeans.lib.cvsclient.event.BinaryMessageEvent;
import org.netbeans.lib.cvsclient.event.CVSListener;
import org.netbeans.lib.cvsclient.event.FileAddedEvent;
@@ -71,108 +65,31 @@
import java.util.ArrayList;
import java.util.List;
-/** @author poussin */
+/**
+ * @author poussin
+ * @author tchemit
+ */
public class CVSHelper {
- private static VCSConfig config;
/** Logger for this class */
private static final Log log = LogFactory.getLog(CVSHelper.class);
- static protected Client getClient() {
- // WARNING TO DEVELOPERS:
- // Please be warned that attempting to reuse one open connection for
- // more commands is not supported by cvs servers very well.
- // You are advised to open a new Connection each time.
- // If you still want to proceed, please do:
- // System.setProperty("javacvs.multiple_commands_warning", "false")
- // That will disable this message.
- // d'ou l'initialisation syst�matique de la connexion.
-
- String hostName = getConfig().getHostName();
-
- // R�pertoire distant du CVS
- String repository = getConfig().getRemotePath();
-
- String userName = getConfig().getUserName();
-
- Connection connection;
- if (getConfig().isUseSshConnexion()) {
- throw new RuntimeException(CVSHelper.class + " you can not used a ssh connexion with CVS, use instead SVN configuration");
- // connexion ssh2
- // Localisation de la clef priv�e (pour la connexion ssh2).
- //File keyFile = new File(config.getKeyFile());
- // Stockage des cl�s publics pour les hosts ou il y a eu connexion en ssh2
- //String host = config.etHost();
- // Localisation de la clef priv�e (pour la connexion ssh2).
- //File keyFile = new File(IsisConfig.getProperties().getProperty(
- // IsisConfig.CVS_KEY_FILE));
- // Stockage des cl�s publics pour les hosts ou il y a eu connexion en ssh2
- //String host = IsisConfig.getProperties().getProperty(
- // IsisConfig.CVS_HOST);
-
-// Ssh2Connexion ssh2Connection = new Ssh2Connexion();
-// ssh2Connection.setUserName(userName);
-// ssh2Connection.setHostName(hostName);
-// ssh2Connection.setKeyFile(keyFile);
-// ssh2Connection.setHost(host);
-// ssh2Connection.setRepository(repository);
-// connection = ssh2Connection;
- } else {
- String cvsrootString = ":pserver:" + userName + "@" + hostName + repository;
- CVSRoot cvsroot = CVSRoot.parse(cvsrootString);
- // connexion pserver
- PServerConnection PServerConnection;
- PServerConnection = new PServerConnection(cvsroot);
-// PServerConnection.setUserName(userName);
-// // PServerConnection.setEncodedPassword(encodedPassword);
-// PServerConnection.setHostName(hostName);
-// PServerConnection.setRepository(repository);
- connection = PServerConnection;
- }
-
- // Le connexion est ouverte automatiquement � l'�x�cution de la
- // commande CVS si elle n'a pas �t� ouverte pr�c�dement. Je l'ouvre pour
- // obtenir les messages d'erreurs plus clair.
- // connection.open();
-
- return new Client(connection, new StandardAdminHandler());
- }
-
- private static VCSConfig getConfig() {
- if (config == null) {
- throw new IllegalStateException("config is null, should use provider to init config, or setConfig method");
- }
- if (config.getType() != VCSType.CVS) {
- throw new VCSRuntimeException("can not execute CVS command with " +
- "a [" + config.getType() + "] handler");
- }
- return config;
- }
-
- static public GlobalOptions getGlobalOptions() {
- GlobalOptions result = new GlobalOptions();
- //String repository = IsisConfig.getProperties().getProperty(
- // IsisConfig.CVS_REPOSITORY);
- String repository = getConfig().getRemotePath();
- result.setCVSRoot(repository);
- return result;
- }
-
/**
* Permet de r�cuperer un nouveau module depuis le serveur
* Les donn�es sur le serveur sont dans /cvsroot/isis-fish/data/...
* on ne souhaite pas voir apparaitre data en local, on utilise donc
* le renomage du module a l'arrive pour retirer data
*
- * @param destdir le repertoire local ou il faut mettre le module
- * @param module le nom du module a recuperer
+ * @param connexion connexion to be used
+ * @param destdir le repertoire local ou il faut mettre le module
+ * @param module le nom du module a recuperer
* @return result of command
- * @throws org.codelutin.vcs.VCSException TODO
+ * @throws VCSException TODO
*/
- static public CVSCommandResult checkout(File destdir, String module) throws VCSException {
- String data = getConfig().getRemoteDatabase();
+ static public CVSCommandResult checkout(CVSConnexion connexion, File destdir, String module) throws VCSException {
+ String data = connexion.getConfig().getRemoteDatabase();
//TODO Fix bug when module is a multi path one, check there is no
//TODO File.separator
String sep = File.separator;
@@ -183,8 +100,8 @@
// connexion ssh ou pserver, globalOption et initialisation client
// Intitialistion des options globals
- GlobalOptions globalOptions = getGlobalOptions();
- Client client = getClient();
+ GlobalOptions globalOptions = connexion.getGlobalOptions();
+ Client client = connexion.getClient();
client.setLocalPath(destdir.getPath());
@@ -215,13 +132,14 @@
/**
* Permet de recuperer les mises a jours faite depuis le serveur
*
- * @param file le fichier ou repertoire a mettre a jour recursivement
+ * @param connexion connexion to be used
+ * @param file le fichier ou repertoire a mettre a jour recursivement
* @return the result of the command
* @throws VCSException if any problem while updating
*/
- static public CVSCommandResult cvsUpdate(File file) throws VCSException {
- GlobalOptions globalOptions = getGlobalOptions();
- Client client = getClient();
+ static public CVSCommandResult cvsUpdate(CVSConnexion connexion, File file) throws VCSException {
+ GlobalOptions globalOptions = connexion.getGlobalOptions();
+ Client client = connexion.getClient();
if (!file.exists() || file.isFile()) {
client.setLocalPath(file.getParent());
@@ -254,13 +172,14 @@
/**
* Permet de recuperer les statuts depuis le serveur
*
- * @param file le fichier ou repertoire dont on souhaite le statut recursivement
+ * @param connexion connexion to be used
+ * @param file le fichier ou repertoire dont on souhaite le statut recursivement
* @return the result of the command
* @throws VCSException if any problem while updating
*/
- static public CVSCommandResult cvsStatus(File file) throws VCSException {
- GlobalOptions globalOptions = getGlobalOptions();
- Client client = getClient();
+ static public CVSCommandResult cvsStatus(CVSConnexion connexion, File file) throws VCSException {
+ GlobalOptions globalOptions = connexion.getGlobalOptions();
+ Client client = connexion.getClient();
if (file.isFile()) {
client.setLocalPath(file.getParent());
@@ -298,13 +217,14 @@
/**
* Permet de recuperer les logs depuis le serveur
*
- * @param file le fichier ou repertoire dont on souhaite le log recursivement
+ * @param connexion connexion to be used
+ * @param file le fichier ou repertoire dont on souhaite le log recursivement
* @return the result of the command
* @throws VCSException if any problem while updating
*/
- static public CVSCommandResult cvsLog(File file) throws VCSException {
- GlobalOptions globalOptions = getGlobalOptions();
- Client client = getClient();
+ static public CVSCommandResult cvsLog(CVSConnexion connexion, File file) throws VCSException {
+ GlobalOptions globalOptions = connexion.getGlobalOptions();
+ Client client = connexion.getClient();
if (file.isFile()) {
client.setLocalPath(file.getParent());
@@ -345,12 +265,13 @@
* Tous les r�pertoires contenant des fichiers a ajouter doivent aussi
* etre ajout� s'il ne sont pas deja dans le CVS.
*
- * @param files la listes des fichiers a ajouter, si les fichiers sont
- * deja ajout�s cela ne produit pas d'erreur
+ * @param connexion connexion to be used
+ * @param files la listes des fichiers a ajouter, si les fichiers sont
+ * deja ajout�s cela ne produit pas d'erreur
* @return the result of the command
* @throws VCSException if any problem while updating
*/
- static public CVSCommandResult cvsAdd(List<File> files) throws VCSException {
+ static public CVSCommandResult cvsAdd(CVSConnexion connexion, List<File> files) throws VCSException {
StandardAdminHandler adminHandler = new StandardAdminHandler();
File root = null;
@@ -383,8 +304,8 @@
return new CVSCommandResult();
} else {
log.debug(_("lutinvcs.message.add.cvs", root, fileToAdd));
- GlobalOptions globalOptions = getGlobalOptions();
- Client client = getClient();
+ GlobalOptions globalOptions = connexion.getGlobalOptions();
+ Client client = connexion.getClient();
client.setLocalPath(root.getPath());
@@ -415,12 +336,13 @@
/**
* Permet de marquer des fichier a supprimer du CVS
*
- * @param files la listes des fichiers a supprimer, si les fichiers sont
- * deja supprim�s cela ne produit pas d'erreur
+ * @param connexion connexion to be used
+ * @param files la listes des fichiers a supprimer, si les fichiers sont
+ * deja supprim�s cela ne produit pas d'erreur
* @return the result of the command
* @throws VCSException if any problem while updating
*/
- static public CVSCommandResult cvsRemove(List<File> files) throws VCSException {
+ static public CVSCommandResult cvsRemove(CVSConnexion connexion, List<File> files) throws VCSException {
File root = null;
File tmpRoot = null;
List<File> fileToRemove = new ArrayList<File>();
@@ -442,8 +364,8 @@
return new CVSCommandResult();
} else {
log.debug(_("lutinvcs.message.remove.files", fileToRemove));
- GlobalOptions globalOptions = getGlobalOptions();
- Client client = getClient();
+ GlobalOptions globalOptions = connexion.getGlobalOptions();
+ Client client = connexion.getClient();
client.setLocalPath(root.getPath());
@@ -476,13 +398,14 @@
/**
* Permet d'envoyer des modifications au CVS
*
- * @param files le fichier ou repertoire a envoyer, si file represente un
- * repertoire alors un commit recursif est fait
- * @param msg message of the commit
+ * @param connexion connexion to be used
+ * @param files le fichier ou repertoire a envoyer, si file represente un
+ * repertoire alors un commit recursif est fait
+ * @param msg message of the commit
* @return the result of the command
* @throws VCSException if any problem while updating
*/
- static public CVSCommandResult cvsCommit(List<File> files, String msg) throws VCSException {
+ static public CVSCommandResult cvsCommit(CVSConnexion connexion, List<File> files, String msg) throws VCSException {
File root = null;
File tmpRoot = null;
for (File file : files) {
@@ -495,8 +418,8 @@
}
}
- GlobalOptions globalOptions = getGlobalOptions();
- Client client = getClient();
+ GlobalOptions globalOptions = connexion.getGlobalOptions();
+ Client client = connexion.getClient();
client.setLocalPath(root.getPath());
@@ -524,9 +447,6 @@
return listener.getResult();
}
- public static void setConfig(VCSConfig config) {
- CVSHelper.config = config;
- }
static protected class LogCVSListener implements CVSListener {
protected CVSCommandResult result = new CVSCommandResult();
Modified: trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java 2008-04-05 20:41:33 UTC (rev 369)
+++ trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java 2008-04-05 20:43:32 UTC (rev 370)
@@ -14,27 +14,163 @@
*/
package org.codelutin.vcs.impl.svn;
+import static org.codelutin.i18n.I18n._;
+import org.codelutin.vcs.ConnectionState;
+import org.codelutin.vcs.SVNProvider;
+import org.codelutin.vcs.VCSConnexionConfig;
+import org.codelutin.vcs.VCSConnexionMode;
+import org.codelutin.vcs.VCSException;
+import org.codelutin.vcs.VCSRuntimeException;
import org.codelutin.vcs.util.AbstractVCSConnexion;
-import org.codelutin.vcs.VCSConfig;
-import org.codelutin.vcs.VCSHandler;
+import org.codelutin.vcs.util.AbstractVCSHandler;
+import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.io.SVNRepository;
+import org.tmatesoft.svn.core.wc.ISVNOptions;
+import org.tmatesoft.svn.core.wc.SVNClientManager;
+import org.tmatesoft.svn.core.wc.SVNWCClient;
+import org.tmatesoft.svn.core.wc.SVNWCUtil;
+import java.io.File;
+import java.util.Arrays;
+
/** @author chemit */
public class SVNConnexion extends AbstractVCSConnexion {
- public void init(VCSConfig config, VCSHandler handler) {
- state = null;
+ protected SVNURL repositoryURL;
+
+ protected SVNRepository repository;
+
+ protected SVNClientManager ourClientManager;
+
+ protected SVNWCClient ourWcClient;
+
+ public SVNConnexion(VCSConnexionMode mode, SVNProvider provider) {
+ super(mode, provider);
}
+ public void init(VCSConnexionConfig config) {
+ state = ConnectionState.UNDEFINED;
+ this.config = config;
+
+ try {
+
+ // construct remote repository SVNURL
+
+ repositoryURL = SVNURL.parseURIEncoded(getRemoteUrl());
+ log.info("repositoryURL " + repositoryURL);
+
+ // instanciate runtime default options
+ ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
+
+ // TODO Deal with authentication
+
+ if (config.isUseSshConnexion()) {
+ // we use a ssh2 authentication mecanism (username /keyFile)
+ // just push in System properties that's we need for this...
+ System.setProperty("svnkit.ssh2.key", config.getKeyFile().getAbsolutePath());
+ System.setProperty("svnkit.ssh2.username", config.getUserName());
+ if (!config.isNoPassPhrase()) {
+ char[] pass = getConfig().getPassphrase().toCharArray();
+ if (pass != null) {
+ System.setProperty("svnkit.ssh2.passphrase", Arrays.toString(pass));
+ Arrays.fill(pass, '0');
+ }
+ }
+ //System.setProperty("svnkit.ssh2.password", "");
+ //System.setProperty("svnkit.ssh2.port", "22");
+
+ // instanciate svn client manager
+ ourClientManager = SVNClientManager.newInstance(options);
+
+ } else {
+ // we use a simple authentication mecanism (username/password)
+ ourClientManager = SVNClientManager.newInstance(options, config.getUserName(), config.getUserName());
+ }
+ // instanciate repo
+ repository = ourClientManager.createRepository(repositoryURL, true);
+
+ // add our svn event logger TODO Remake this logger or use the
+ // DebugLog from svnkit ?
+ ourClientManager.setEventHandler(new SVNHelper.SVNEventLoggerHandler());
+ } catch (SVNException e) {
+ // TODO I18N
+ throw new VCSRuntimeException("could not compute repository url ", e);
+ }
+ }
+
@Override
public void close() throws IllegalStateException {
checkInit();
if (!isOpen()) {
return;
}
+ //TODO to be done
+ log.info(this);
}
@Override
public void open() throws IllegalStateException {
checkInit();
+ //TODO testConnexion ?
}
+
+ public String getRemoteUrl() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(config.isUseSshConnexion() ? "svn+ssh://" : "svn://");
+ sb.append(config.getHostName()).append("/");
+ sb.append(config.getRemotePath()).append("/");
+ sb.append(config.getRemoteDatabase());
+ return sb.toString();
+ }
+
+ public boolean hasProtocoleChanged(SVNHandler handler) throws VCSException {
+ File root = config.getLocalDatabasePath();
+ if (!root.exists() || !AbstractVCSHandler.isFileInCheckedDir(root, handler)) {
+ // local database does not exists, so no switch
+ return false;
+ }
+ String oldProtocol = handler.getSVNStatus(this, root, false).getURL().getProtocol();
+ String newProtocol = repositoryURL.getProtocol();
+ return !oldProtocol.equals(newProtocol);
+ }
+
+ public void testConnection() throws VCSException {
+ //TODO This is not the good place for this, this should be done in provider
+ if (getConfig().isUseSshConnexion()) {
+ // try to test the ssh connection
+
+ File path = getConfig().getKeyFile();
+ try {
+ String passphrase = getConfig().getPassphrase();
+ SVNHelper.testSSHConnection(repositoryURL.toString(), getConfig().getUserName(), path == null ? null : path.getAbsolutePath(), passphrase == null ? new char[0] : passphrase.toCharArray());
+ return;
+ } catch (VCSException e) {
+ log.warn(_("lutinvcs.error.vcs.no.ssh.connection", getConfig().getUserName(), path));
+ }
+ }
+ // do not use ssh connection
+ getConfig().setUseSshConnexion(false);
+ // try to test with a anonymous connection
+ SVNHelper.testAnonymousConnection(repositoryURL.toString());
+ }
+
+
+ public SVNWCClient getOurWcClient() {
+ if (ourWcClient == null)
+ ourWcClient = ourClientManager.getWCClient();
+ return ourWcClient;
+ }
+
+ public SVNClientManager getOurClientManager() {
+ return ourClientManager;
+ }
+
+ public SVNRepository getRepository() {
+ return repository;
+ }
+
+ public SVNURL getRepositoryURL() {
+ return repositoryURL;
+ }
}
Modified: trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHandler.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHandler.java 2008-04-05 20:41:33 UTC (rev 369)
+++ trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHandler.java 2008-04-05 20:43:32 UTC (rev 370)
@@ -20,17 +20,15 @@
package org.codelutin.vcs.impl.svn;
import static org.codelutin.i18n.I18n._;
-import org.codelutin.vcs.util.AbstractVCSHandler;
-import org.codelutin.vcs.VCSConfig;
+import org.codelutin.vcs.VCSConnexionConfig;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.util.VCSHelper;
-import static org.codelutin.vcs.util.VCSHelper.isFileInCheckedDir;
import org.codelutin.vcs.VCSRuntimeException;
import org.codelutin.vcs.VCSState;
import static org.codelutin.vcs.VCSState.OUT_OF_DATE;
import static org.codelutin.vcs.VCSState.OUT_OF_DATE_AND_MODIFIED;
import static org.codelutin.vcs.VCSState.UP_TO_DATE;
import org.codelutin.vcs.VCSStatus;
+import org.codelutin.vcs.util.AbstractVCSHandler;
import org.tmatesoft.svn.core.ISVNDirEntryHandler;
import org.tmatesoft.svn.core.ISVNLogEntryHandler;
import org.tmatesoft.svn.core.SVNCommitInfo;
@@ -39,21 +37,15 @@
import org.tmatesoft.svn.core.SVNLogEntry;
import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.io.SVNRepository;
-import org.tmatesoft.svn.core.wc.ISVNOptions;
-import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNStatus;
import org.tmatesoft.svn.core.wc.SVNStatusType;
import static org.tmatesoft.svn.core.wc.SVNStatusType.*;
-import org.tmatesoft.svn.core.wc.SVNWCClient;
-import org.tmatesoft.svn.core.wc.SVNWCUtil;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
@@ -65,83 +57,16 @@
* @author chemit
*/
-public final class SVNHandler extends AbstractVCSHandler {
+public final class SVNHandler extends AbstractVCSHandler<SVNConnexion> {
- protected SVNURL repositoryURL;
-
- protected SVNRepository repository;
-
- protected SVNClientManager ourClientManager;
-
- protected SVNWCClient ourWcClient;
-
- public SVNHandler(VCSConfig config) {
-
- super(config, ".svn", "entries");
-
- SVNHelper.setupLibrary();
-
- try {
-
- // construct remote repository SVNURL
-
- repositoryURL = SVNURL.parseURIEncoded(getRemoteUrl());
- log.info("repositoryURL " + repositoryURL);
-
- // instanciate runtime default options
- ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
-
- // TODO Deal with authentication
-
- if (config.isUseSshConnexion()) {
- // we use a ssh2 authentication mecanism (username /keyFile)
- // just push in System properties that's we need for this...
- System.setProperty("svnkit.ssh2.key", config.getKeyFile().getAbsolutePath());
- System.setProperty("svnkit.ssh2.username", config.getUserName());
- if (!config.isNoPassPhrase()) {
- char[] pass = getConfig().getPassphrase().toCharArray();
- if (pass != null) {
- System.setProperty("svnkit.ssh2.passphrase", Arrays.toString(pass));
- Arrays.fill(pass, '0');
- }
- }
- //System.setProperty("svnkit.ssh2.password", "");
- //System.setProperty("svnkit.ssh2.port", "22");
-
- // instanciate svn client manager
- ourClientManager = SVNClientManager.newInstance(options);
-
- } else {
- // we use a simple authentication mecanism (username/password)
- ourClientManager = SVNClientManager.newInstance(options, config.getUserName(), config.getUserName());
- }
- // instanciate repo
- repository = ourClientManager.createRepository(repositoryURL, true);
-
- // add our svn event logger TODO Remake this logger or use the
- // DebugLog from svnkit ?
- ourClientManager.setEventHandler(new SVNHelper.SVNEventLoggerHandler());
- } catch (SVNException e) {
- // TODO I18N
- throw new VCSRuntimeException("could not compute repository url ", e);
- }
+ public SVNHandler() {
+ super(".svn", "entries");
}
- public boolean hasProtocoleChanged() throws VCSException {
- File root = config.getLocalDatabasePath();
- if (!root.exists() || !isFileInCheckedDir(root, this)) {
- // local database does not exists, so no switch
- return false;
- }
- String oldProtocol = getSVNStatus(root, false).getURL().getProtocol();
- String newProtocol = repositoryURL.getProtocol();
- return !oldProtocol.equals(newProtocol);
- }
-
- public void initWorkingCopy() throws VCSException {
+ public void initWorkingCopy(SVNConnexion connexion) throws VCSException {
try {
// test connection
- repository.testConnection();
+ connexion.getRepository().testConnection();
} catch (SVNException e1) {
// connexion failed, what do we want to do ? display vcs
@@ -150,47 +75,20 @@
throw new VCSException(e1);
}
+ VCSConnexionConfig config = connexion.getConfig();
File root = config.getLocalDatabasePath();
if (!root.exists()) {
- getLocalDatabasePath().mkdirs();
+ config.getLocalDatabasePath().mkdirs();
}
- long lastRevision = checkoutOnlyTheDirectory(root, SVNRevision.HEAD);
+ long lastRevision = checkoutOnlyTheDirectory(connexion, root, SVNRevision.HEAD);
log.info(_("lutinvcs.message.copy.revision", null, lastRevision));
}
- public void testConnection() throws VCSException {
- if (getConfig().isUseSshConnexion()) {
- // try to test the ssh connection
-
- File path = getConfig().getKeyFile();
- try {
- String passphrase = getConfig().getPassphrase();
- SVNHelper.testSSHConnection(repositoryURL.toString(), getConfig().getUserName(), path == null ? null : path.getAbsolutePath(), passphrase == null ? new char[0] : passphrase.toCharArray());
- return;
- } catch (VCSException e) {
- log.warn(_("lutinvcs.error.vcs.no.ssh.connection", getConfig().getUserName(), path));
- }
- }
- // do not use ssh connection
- getConfig().setUseSshConnexion(false);
- // try to test with a anonymous connection
- SVNHelper.testAnonymousConnection(repositoryURL.toString());
- }
-
- public String getRemoteUrl() {
- StringBuilder sb = new StringBuilder();
- sb.append(config.isUseSshConnexion() ? "svn+ssh://" : "svn://");
- sb.append(config.getHostName()).append("/");
- sb.append(config.getRemotePath()).append("/");
- sb.append(config.getRemoteDatabase());
- return sb.toString();
- }
-
// TODO Delete VCSStatus and all links, use VCSState
- public VCSStatus getStatus(File file) {
+ public VCSStatus getStatus(SVNConnexion connexion, File file) {
SVNStatusType statusType;
try {
- statusType = getStatusType(file);
+ statusType = getStatusType(connexion, file);
} catch (SVNException e) {
return VCSStatus.NONE;
}
@@ -217,18 +115,18 @@
}
// tmp is used to get back the revision
- public VCSState getState(File file, Collection tmp) throws VCSException {
- return getState(file, tmp, true);
+ public VCSState getState(SVNConnexion connexion, File file, Collection tmp) throws VCSException {
+ return getState(connexion, file, tmp, true);
}
@SuppressWarnings("unchecked")
- public VCSState getState(File file, Collection tmp, boolean noremote) throws VCSException {
+ public VCSState getState(SVNConnexion connexion, File file, Collection tmp, boolean noremote) throws VCSException {
VCSState result = VCSState.UNKNOWN;
boolean exist = file.exists();
- VCSHelper.assertFileInWC(file, this);
+ assertFileInWC(file, this, connexion);
// file is in a working copy
@@ -242,7 +140,7 @@
// check if present on remote repository
try {
- stat = ourClientManager.getStatusClient().doStatus(file, true);
+ stat = connexion.getOurClientManager().getStatusClient().doStatus(file, true);
if (stat != null) {
@@ -272,7 +170,7 @@
// file is under VCS and exists
try {
- stat = ourClientManager.getStatusClient().doStatus(file, true);
+ stat = connexion.getOurClientManager().getStatusClient().doStatus(file, true);
} catch (SVNException e) {
log.warn(_("lutinvcs.error.not.find.status", file, e.getErrorMessage()));
@@ -322,35 +220,35 @@
private int prefixPath = -1;
- private int getPrefixPath() {
+ private int getPrefixPath(SVNConnexion connexion) {
if (prefixPath == -1)
- prefixPath = getLocalDatabasePath().getAbsolutePath().length() + 1;
+ prefixPath = connexion.getConfig().getLocalDatabasePath().getAbsolutePath().length() + 1;
return prefixPath;
}
- private String getRelativePath(File f) {
+ private String getRelativePath(SVNConnexion connexion, File f) {
final String path = f.getAbsolutePath();
- return path.length() <= getPrefixPath() ? path : path.substring(getPrefixPath());
+ return path.length() <= getPrefixPath(connexion) ? path : path.substring(getPrefixPath(connexion));
}
- public boolean isOnRemote(File file) {
- VCSStatus fileStatus = getStatus(file);
+ public boolean isOnRemote(SVNConnexion connexion, File file) {
+ VCSStatus fileStatus = getStatus(connexion, file);
return !(VCSStatus.UNVERSIONED == fileStatus || VCSStatus.NONE == fileStatus);
}
- public boolean isUpToDate(File file) throws VCSException {
- SVNStatus status = getSVNStatus(file);
+ public boolean isUpToDate(SVNConnexion connexion, File file) throws VCSException {
+ SVNStatus status = getSVNStatus(connexion, file);
return status.getContentsStatus() == STATUS_NORMAL && STATUS_NONE == status.getRemoteContentsStatus();
}
- public long add(List<File> files, String msg) throws VCSException {
+ public long add(SVNConnexion connexion, List<File> files, String msg) throws VCSException {
assertFilesExist(files, msg);
try {
ArrayList<File> filesTmp = new ArrayList<File>(files);
for (Iterator<File> it = filesTmp.iterator(); it.hasNext();) {
File file = it.next();
- VCSStatus status = getStatus(file);
+ VCSStatus status = getStatus(connexion, file);
if (!file.exists() || status == VCSStatus.NORMAL) {
// do not commit this file
it.remove();
@@ -358,15 +256,15 @@
}
// we must check first if file need really to be added ?
if (status == VCSStatus.UNVERSIONED) {
- getOurWcClient().doAdd(file, false, false, false, false, false);
- log.debug("mark to add '" + getRelativePath(file) + "'");
+ connexion.getOurWcClient().doAdd(file, false, false, false, false, false);
+ log.debug("mark to add '" + getRelativePath(connexion, file) + "'");
}
}
if (!filesTmp.isEmpty() && msg != null) {
// we do commit
- long rev = commit(filesTmp, msg);
+ long rev = commit(connexion, filesTmp, msg);
for (File file : filesTmp) {
- log.info("'" + getRelativePath(file) + "' at revison " + rev);
+ log.info("'" + getRelativePath(connexion, file) + "' at revison " + rev);
}
return rev;
}
@@ -376,23 +274,23 @@
return -1;
}
- public void delete(List<File> files, String msg) throws VCSException {
+ public void delete(SVNConnexion connexion, List<File> files, String msg) throws VCSException {
assertFilesExist(files, "delete");
- files.remove(getLocalDatabasePath());
- files.remove(getLocalDatabasePath().getParentFile());
+ files.remove(connexion.getConfig().getLocalDatabasePath());
+ files.remove(connexion.getConfig().getLocalDatabasePath().getParentFile());
try {
// when delete is true, after commit we have a none status
for (File file : files) {
- getOurWcClient().doDelete(file, true, msg != null, false);
- log.debug("mark to delete '" + getRelativePath(file) + "'");
+ connexion.getOurWcClient().doDelete(file, true, msg != null, false);
+ log.debug("mark to delete '" + getRelativePath(connexion, file) + "'");
}
long revision;
if (msg != null) {
// we do commit
- revision = commit(files, msg);
+ revision = commit(connexion, files, msg);
for (File file : files) {
- log.info("'" + getRelativePath(file) + "' at revison " + revision);
+ log.info("'" + getRelativePath(connexion, file) + "' at revison " + revision);
}
}
} catch (SVNException e) {
@@ -400,27 +298,27 @@
}
}
- public void revert(List<File> files) throws VCSException {
+ public void revert(SVNConnexion connexion, List<File> files) throws VCSException {
assertFilesExist(files, "revert");
try {
for (File file : files) {
// we have nothing to do for with a normal status file
- if (getStatus(file) == VCSStatus.NORMAL) {
+ if (getStatus(connexion, file) == VCSStatus.NORMAL) {
continue;
}
- getOurWcClient().doRevert(file, true);
- log.info("'" + getRelativePath(file) + "' at revison " + "TODO");
+ connexion.getOurWcClient().doRevert(file, true);
+ log.info("'" + getRelativePath(connexion, file) + "' at revison " + "TODO");
}
} catch (SVNException e) {
throw new VCSException(e);
}
}
- public long commit(List<File> files, String msg) throws VCSException {
+ public long commit(SVNConnexion connexion, List<File> files, String msg) throws VCSException {
assertFilesExist(files, "commit");
try {
- SVNCommitInfo commitInfo = ourClientManager.getCommitClient()
+ SVNCommitInfo commitInfo = connexion.getOurClientManager().getCommitClient()
.doCommit(files.toArray(new File[files.size()]), false, msg, false, true);
log.debug("to revision " + commitInfo.getNewRevision());
return commitInfo.getNewRevision();
@@ -429,8 +327,8 @@
}
}
- public void update(File file) throws VCSException {
- update(file, SVNRevision.HEAD);
+ public void update(SVNConnexion connexion, File file) throws VCSException {
+ update(connexion, file, SVNRevision.HEAD);
}
/**
@@ -439,45 +337,45 @@
* @throws VCSException if any exception while update operation (like update a
* locally modified file or a unversionned file)
*/
- public void update(File file, Object revision) throws VCSException {
+ public void update(SVNConnexion connexion, File file, Object revision) throws VCSException {
try {
- VCSStatus status = getStatus(file);
+ VCSStatus status = getStatus(connexion, file);
if (status == VCSStatus.MODIFIED)
throw new VCSException("could not update a localy modified file " + file);
if (status == VCSStatus.UNVERSIONED || status == VCSStatus.NONE)
throw new VCSException("could not update a non versionned file " + file);
- long newRev = ourClientManager.getUpdateClient().doUpdate(file, (SVNRevision) revision, true);
- log.info("'" + getRelativePath(file) + "' to revision " + newRev);
+ long newRev = connexion.getOurClientManager().getUpdateClient().doUpdate(file, (SVNRevision) revision, true);
+ log.info("'" + getRelativePath(connexion, file) + "' to revision " + newRev);
} catch (SVNException e) {
throw new VCSException(e);
}
}
- public void checkout(File destDir, String module, boolean recurse)
+ public void checkout(SVNConnexion connexion, File destDir, String module, boolean recurse)
throws VCSException {
try {
- final SVNURL urlModule = repositoryURL.appendPath(module, true);
+ final SVNURL urlModule = connexion.getRepositoryURL().appendPath(module, true);
String sep = File.separator;
// TODO Why this ?
final File modulePath = new File(destDir, module.replaceAll("/", "\\".equals(sep) ? sep + sep : sep));
- log.info(urlModule + " to path '" + getRelativePath(modulePath) + "' (module:" + module + ")");
- ourClientManager.getUpdateClient().doCheckout(urlModule, modulePath, null, SVNRevision.HEAD, recurse);
+ log.info(urlModule + " to path '" + getRelativePath(connexion, modulePath) + "' (module:" + module + ")");
+ connexion.getOurClientManager().getUpdateClient().doCheckout(urlModule, modulePath, null, SVNRevision.HEAD, recurse);
} catch (SVNException e) {
throw new VCSException(e);
}
}
- public void checkoutFile(File destDir, String module) throws VCSException {
- update(new File(destDir, module));
+ public void checkoutFile(SVNConnexion connexion, File destDir, String module) throws VCSException {
+ update(connexion, new File(destDir, module));
}
- public long checkoutOnlyTheDirectory(File root, Object revision)
+ public long checkoutOnlyTheDirectory(SVNConnexion connexion, File root, Object revision)
throws VCSException {
long lastRevision;
try {
// obtain module
- File repoRoot = getLocalDatabasePath();
+ File repoRoot = connexion.getConfig().getLocalDatabasePath();
File tmp = root;
StringBuilder sb = new StringBuilder();
while (!tmp.equals(repoRoot)) {
@@ -488,16 +386,16 @@
if (module.length() > 0)
module = module.substring(1);
- SVNURL url = repositoryURL.appendPath(module, true);
+ SVNURL url = connexion.getRepositoryURL().appendPath(module, true);
- lastRevision = ourClientManager.getUpdateClient().doCheckout(
+ lastRevision = connexion.getOurClientManager().getUpdateClient().doCheckout(
url,
root,
null,
(SVNRevision) (revision == null ? SVNRevision.HEAD
: revision), false);
- log.info(url + " to path '" + getRelativePath(root) + "' (module:" + module + ") to revision " + lastRevision);
+ log.info(url + " to path '" + getRelativePath(connexion, root) + "' (module:" + module + ") to revision " + lastRevision);
// Suppress all files from root directory of working copy
for (File file : root.listFiles())
if (file.isFile())
@@ -508,7 +406,7 @@
return lastRevision;
}
- public List<String> getRemoteStorageNames(File directory)
+ public List<String> getRemoteStorageNames(SVNConnexion connexion, File directory)
throws VCSException {
final List<String> result = new ArrayList<String>();
@@ -522,7 +420,7 @@
if (dirEntry.getKind() == SVNNodeKind.FILE) {
String s = dirEntry.getRelativePath();
- // TODO Prefer use VCSHelper.XXX method to convert names
+ // TODO Prefer use XXX method to convert names
if (s.indexOf("/") > -1) {
s = s.replaceAll("/", sep.equals("\\") ? sep + sep : sep);
}
@@ -530,8 +428,7 @@
}
}
};
- ourClientManager.getLogClient().doList(directory, SVNRevision.BASE,
- SVNRevision.HEAD, true, handler);
+ connexion.getOurClientManager().getLogClient().doList(directory, SVNRevision.BASE, SVNRevision.HEAD, true, handler);
} catch (SVNException e) {
throw new VCSException(e);
}
@@ -539,10 +436,10 @@
return result;
}
- public SVNRevision getRevision(File f) throws VCSException {
+ public SVNRevision getRevision(SVNConnexion connexion, File f) throws VCSException {
SVNStatus status;
try {
- status = ourClientManager.getStatusClient().doStatus(f, false);
+ status = connexion.getOurClientManager().getStatusClient().doStatus(f, false);
return status.getRevision();
} catch (SVNException e) {
throw new VCSException(e);
@@ -556,12 +453,12 @@
* @return la liste des r�visions en tre la startRevision et la endRevision
* @throws VCSException if nay exception while operation
*/
- public List<SVNLogEntry> getLog(Object startRevision, Object endRevision,
+ public List<SVNLogEntry> getLog(SVNConnexion connexion, Object startRevision, Object endRevision,
File file) throws VCSException {
final List<SVNLogEntry> result = new ArrayList<SVNLogEntry>();
- final long workingRevision = getRevision(file).getNumber();
+ final long workingRevision = getRevision(connexion, file).getNumber();
final long startRev = ((SVNRevision) startRevision).getNumber();
ISVNLogEntryHandler handler = new ISVNLogEntryHandler() {
@@ -573,7 +470,7 @@
};
try {
- ourClientManager.getLogClient().doLog(new File[]{file},
+ connexion.getOurClientManager().getLogClient().doLog(new File[]{file},
(SVNRevision) startRevision, (SVNRevision) endRevision,
false, false, 1024, handler);
} catch (SVNException e) {
@@ -591,13 +488,13 @@
* @return le log ou null si auncune r�vision n'a �t� fourni
* @throws VCSException if nay exception while operation
*/
- public String getChangeLog(File file) throws VCSException {
+ public String getChangeLog(SVNConnexion connexion, File file) throws VCSException {
SVNRevision startRevision = file.exists() ? SVNRevision.WORKING
: SVNRevision.create(0);
log.debug("file " + file + " init Rev " + startRevision);
- List<SVNLogEntry> logInfo = getLog(startRevision, SVNRevision.HEAD,
+ List<SVNLogEntry> logInfo = getLog(connexion, startRevision, SVNRevision.HEAD,
file);
// List<SVNLogEntry> logInfo = getLog(file.exists()?SVNRevision.WORKING:
// SVNRevision.BASE, SVNRevision.HEAD, file);
@@ -625,20 +522,20 @@
return result.substring(1);
}
- public String getDiff(File file) throws VCSException, IOException {
+ public String getDiff(SVNConnexion connexion, File file) throws VCSException, IOException {
// make diff against Head revision of file
- return getDiff(file, SVNRevision.HEAD);
+ return getDiff(connexion, file, SVNRevision.HEAD);
}
- public String getDiff(File file, Object againstRevision)
+ public String getDiff(SVNConnexion connexion, File file, Object againstRevision)
throws VCSException, IOException {
assertFileExist(file, "getDiff");
SVNRevision remoteRevision = (SVNRevision) againstRevision;
- SVNStatus status = getSVNStatus(file);
+ SVNStatus status = getSVNStatus(connexion, file);
if (status == null) {
throw new VCSException("could not found status for the file " + file);
@@ -667,7 +564,7 @@
// we know there is something to diff
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
- ourClientManager.getDiffClient().doDiff(file, localRevision, file, remoteRevision, true, false, baos);
+ connexion.getOurClientManager().getDiffClient().doDiff(file, localRevision, file, remoteRevision, true, false, baos);
return baos.toString();
} catch (Exception e) {
throw new VCSException(e);
@@ -676,16 +573,20 @@
}
}
- public String getFileContent(File file, Object revision)
+ public boolean hasProtocoleChanged(SVNConnexion connexion) throws VCSException {
+ return connexion.hasProtocoleChanged(this);
+ }
+
+ public String getFileContent(SVNConnexion connexion, File file, Object revision)
throws VCSException, IOException {
if (file == null || file.isDirectory()) {
throw new VCSRuntimeException("could not invoke getFileContent for a directory [" + file + "]");
}
String path = file.getAbsolutePath();
- int prefixRoot = getLocalDatabasePath().getAbsolutePath().length();
+ int prefixRoot = connexion.getConfig().getLocalDatabasePath().getAbsolutePath().length();
if (path.length() < prefixRoot) {
- throw new VCSException("can't get the content file for file " + file + " since it is not under the root working copy (" + getLocalDatabasePath() + ")");
+ throw new VCSException("can't get the content file for file " + file + " since it is not under the root working copy (" + connexion.getConfig().getLocalDatabasePath() + ")");
}
String sep = File.separator;
path = path.substring(prefixRoot).replaceAll("\\".equals(sep) ? "\\\\" : sep, "/");
@@ -693,9 +594,9 @@
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
- repository.setLocation(repositoryURL, false);
+ connexion.getRepository().setLocation(connexion.getRepositoryURL(), false);
- repository.getFile(path.substring(1), ((SVNRevision) revision).getNumber(), null, baos);
+ connexion.getRepository().getFile(path.substring(1), ((SVNRevision) revision).getNumber(), null, baos);
return baos.toString();
} catch (SVNException e) {
@@ -705,21 +606,21 @@
}
}
- public byte[] getBinaryFileContent(File file, Object revision) throws VCSException, IOException {
+ public byte[] getBinaryFileContent(SVNConnexion connexion, File file, Object revision) throws VCSException, IOException {
if (file == null || file.isDirectory())
throw new VCSRuntimeException("could not invoke getFileContent for a directory [" + file + "]");
String path = file.getAbsolutePath();
- int prefixRoot = getLocalDatabasePath().getAbsolutePath().length();
+ int prefixRoot = connexion.getConfig().getLocalDatabasePath().getAbsolutePath().length();
if (path.length() < prefixRoot)
- throw new VCSException("can't get the content file for file " + file + " since it is not under the root working copy (" + getLocalDatabasePath() + ")");
+ throw new VCSException("can't get the content file for file " + file + " since it is not under the root working copy (" + connexion.getConfig().getLocalDatabasePath() + ")");
String sep = File.separator;
path = path.substring(prefixRoot).replaceAll("\\".equals(sep) ? "\\\\" : sep, "/");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
- repository.setLocation(repositoryURL, false);
- repository.getFile(path.substring(1), ((SVNRevision) revision).getNumber(), null, baos);
+ connexion.getRepository().setLocation(connexion.getRepositoryURL(), false);
+ connexion.getRepository().getFile(path.substring(1), ((SVNRevision) revision).getNumber(), null, baos);
return baos.toByteArray();
} catch (SVNException e) {
throw new VCSException(e);
@@ -728,32 +629,23 @@
}
}
- public SVNURL getRepositoryURL() {
- return repositoryURL;
+ public SVNStatus getSVNStatus(SVNConnexion connexion, File file) throws VCSException {
+ return getSVNStatus(connexion, file, true);
}
- public SVNStatus getSVNStatus(File file) throws VCSException {
- return getSVNStatus(file, true);
- }
-
- protected SVNStatus getSVNStatus(File file, boolean remote) throws VCSException {
+ protected SVNStatus getSVNStatus(SVNConnexion connexion, File file, boolean remote) throws VCSException {
try {
- return ourClientManager.getStatusClient().doStatus(file, remote);
+ return connexion.getOurClientManager().getStatusClient().doStatus(file, remote);
} catch (SVNException e) {
throw new VCSException(e);
}
}
- protected SVNStatusType getStatusType(File file) throws SVNException {
- SVNStatus status = ourClientManager.getStatusClient().doStatus(file, false);
+ protected SVNStatusType getStatusType(SVNConnexion connexion, File file) throws SVNException {
+ SVNStatus status = connexion.getOurClientManager().getStatusClient().doStatus(file, false);
return status == null ? UNKNOWN : status.getContentsStatus();
}
- private SVNWCClient getOurWcClient() {
- if (ourWcClient == null)
- ourWcClient = ourClientManager.getWCClient();
- return ourWcClient;
- }
private void assertFilesExist(List<File> files, String command)
throws VCSException {
@@ -766,19 +658,19 @@
throw new VCSRuntimeException(getClass().getName() + "#" + command + "(File,...) first argument can not be null");
}
- public void makeRemoteDir(String commitMessage, String... dirNames)
+ public void makeRemoteDir(SVNConnexion connexion, String commitMessage, String... dirNames)
throws VCSException {
try {
SVNURL[] urls = new SVNURL[dirNames.length];
for (int i = 0; i < dirNames.length; i++) {
- SVNURL url = repositoryURL;
+ SVNURL url = connexion.getRepositoryURL();
for (String path : dirNames[i].split("/"))
url = url.appendPath(path, false);
urls[i] = url;
}
- SVNCommitInfo commit = ourClientManager.getCommitClient().doMkDir(
+ SVNCommitInfo commit = connexion.getOurClientManager().getCommitClient().doMkDir(
urls, commitMessage);
long rev = commit.getNewRevision();
for (String dirName : dirNames) {
@@ -789,18 +681,18 @@
}
}
- public void deleteRemoteDir(String commitMessage, String... dirNames)
+ public void deleteRemoteDir(SVNConnexion connexion, String commitMessage, String... dirNames)
throws VCSException {
try {
SVNURL[] urls = new SVNURL[dirNames.length];
for (int i = 0; i < dirNames.length; i++) {
- SVNURL url = repositoryURL;
+ SVNURL url = connexion.getRepositoryURL();
for (String path : dirNames[i].split("/"))
url = url.appendPath(path, false);
urls[i] = url;
}
- SVNCommitInfo commit = ourClientManager.getCommitClient().doDelete(
+ SVNCommitInfo commit = connexion.getOurClientManager().getCommitClient().doDelete(
urls, commitMessage);
long rev = commit.getNewRevision();
for (String dirName : dirNames) {
Modified: trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHelper.java
===================================================================
--- trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHelper.java 2008-04-05 20:41:33 UTC (rev 369)
+++ trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNHelper.java 2008-04-05 20:43:32 UTC (rev 370)
@@ -22,7 +22,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.util.VCSHelper;
+import org.codelutin.vcs.util.AbstractVCSHandler;
import org.codelutin.vcs.VCSRuntimeException;
import org.codelutin.vcs.VCSTypeRepo;
import org.tmatesoft.svn.core.SVNCancelException;
@@ -183,8 +183,8 @@
VCSTypeRepo result;
- String remotePath = VCSHelper.getRemotePath(typeRepo, uncleanRemotePath);
- String remoteDatabase = VCSHelper.getRemoteDatabase(typeRepo, databaseVersion);
+ String remotePath = AbstractVCSHandler.getRemotePath(typeRepo, uncleanRemotePath);
+ String remoteDatabase = AbstractVCSHandler.getRemoteDatabase(typeRepo, databaseVersion);
StringBuilder sb = new StringBuilder("svn://").append(hostName);
sb.append("/").append(remotePath);
String url = sb.toString();
1
0