From 6b7718b35fe5506a51c3283365e19a0e504076d4 Mon Sep 17 00:00:00 2001 From: Michael Valenta Date: Mon, 25 Feb 2002 22:25:32 +0000 Subject: Added optional fetching of absent directories --- .../team/internal/ccvs/core/CVSProviderPlugin.java | 34 +++++++++++++++++----- .../team/internal/ccvs/core/client/Update.java | 6 ++-- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java index 9d5b81572..7c1d05b3c 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java @@ -38,6 +38,8 @@ public class CVSProviderPlugin extends Plugin { public static final String DEFAULT_CVS_SERVER = "cvs"; //$NON-NLS-1$ // determines if empty directories received from the server should be pruned. public static final boolean DEFAULT_PRUNE = true; + // determines if new directories should be discovered during update. + public static final boolean DEFAULT_FETCH = true; // communication timeout with the server public static final int DEFAULT_TIMEOUT = 60; @@ -49,6 +51,7 @@ public class CVSProviderPlugin extends Plugin { private QuietOption quietness; private int communicationsTimeout = DEFAULT_TIMEOUT; private boolean pruneEmptyDirectories = DEFAULT_PRUNE; + private boolean fetchAbsentDirectories = DEFAULT_FETCH; private String cvsRshCommand = DEFAULT_CVS_RSH; private String cvsServer = DEFAULT_CVS_SERVER; @@ -116,6 +119,13 @@ public class CVSProviderPlugin extends Plugin { pruneEmptyDirectories = prune; } + /** + * Get the communications timeout value in seconds + */ + public int getTimeout() { + return communicationsTimeout; + } + /** * Set the timeout value for communications to a value in seconds. * The value must be greater than or equal 0. If is it 0, there is no timeout. @@ -123,13 +133,6 @@ public class CVSProviderPlugin extends Plugin { public void setTimeout(int timeout) { this.communicationsTimeout = Math.max(0, timeout); } - - /** - * Get the communications timeout value in seconds - */ - public int getTimeout() { - return communicationsTimeout; - } /** * Set the quietness option to use with cvs commands. @@ -251,5 +254,22 @@ public class CVSProviderPlugin extends Plugin { public void setCvsServer(String cvsServer) { this.cvsServer = cvsServer; } + + /** + * Gets the etchAbsentDirectories. + * @return Returns a boolean + */ + public boolean getFetchAbsentDirectories() { + return fetchAbsentDirectories; + } + + /** + * Sets the etchAbsentDirectories. + * @param etchAbsentDirectories The etchAbsentDirectories to set + */ + public void setFetchAbsentDirectories(boolean fetchAbsentDirectories) { + this.fetchAbsentDirectories = fetchAbsentDirectories; + } + } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java index 0f20c88bb..9b874367c 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java @@ -98,13 +98,13 @@ public class Update extends Command { protected LocalOption[] getDefaultLocalOptions(GlobalOption[] globalOptions, LocalOption[] localOptions) { List newOptions = new ArrayList(5); - // Always look for absent directories for now - if(!RETRIEVE_ABSENT_DIRECTORIES.isElementOf(localOptions)) { + // Look for absent directories if enabled and the option is not already included + if (CVSProviderPlugin.getPlugin().getFetchAbsentDirectories() && ! RETRIEVE_ABSENT_DIRECTORIES.isElementOf(localOptions)) { newOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES); } // Prune empty directories if pruning is enabled and the command in not being run in non-update mode - if (CVSProviderPlugin.getPlugin().getPruneEmptyDirectories() && !PRUNE_EMPTY_DIRECTORIES.isElementOf(localOptions)) { + if (CVSProviderPlugin.getPlugin().getPruneEmptyDirectories() && ! PRUNE_EMPTY_DIRECTORIES.isElementOf(localOptions)) { if(!Command.DO_NOT_CHANGE.isElementOf(globalOptions)) { newOptions.add(Update.PRUNE_EMPTY_DIRECTORIES); } -- cgit v1.2.3