diff options
author | Szymon Ptaszkiewicz | 2014-11-17 09:14:27 +0000 |
---|---|---|
committer | Szymon Ptaszkiewicz | 2014-11-17 09:14:27 +0000 |
commit | a5a6c81e13e1341b9f8ac12f72b9e864c49505d7 (patch) | |
tree | 44ee1e562f8edf3c359951c7e905c803ec188bef | |
parent | b43f5ea6e8a0543e2c17c1bf53bee62cef022399 (diff) | |
download | eclipse.platform.team-a5a6c81e13e1341b9f8ac12f72b9e864c49505d7.tar.gz eclipse.platform.team-a5a6c81e13e1341b9f8ac12f72b9e864c49505d7.tar.xz eclipse.platform.team-a5a6c81e13e1341b9f8ac12f72b9e864c49505d7.zip |
Bug 451738 - Add org.eclipse.team.cvs.core plugin to General > Tracing preference page
7 files changed, 47 insertions, 18 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/.options b/bundles/org.eclipse.team.cvs.core/.options index 24500e974..ec1445f48 100644 --- a/bundles/org.eclipse.team.cvs.core/.options +++ b/bundles/org.eclipse.team.cvs.core/.options @@ -7,7 +7,7 @@ org.eclipse.team.cvs.core/debug=false org.eclipse.team.cvs.core/metafiles=false # Shows cvs client/server protocol -org.eclipse.team.cvs.core/cvsprotocol=true +org.eclipse.team.cvs.core/cvsprotocol=false # Shows stream debugging information org.eclipse.team.cvs.core/threading=false diff --git a/bundles/org.eclipse.team.cvs.core/plugin.properties b/bundles/org.eclipse.team.cvs.core/plugin.properties index 474272831..d18e895de 100644 --- a/bundles/org.eclipse.team.cvs.core/plugin.properties +++ b/bundles/org.eclipse.team.cvs.core/plugin.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2011 IBM Corporation and others. +# Copyright (c) 2000, 2014 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -18,3 +18,5 @@ Authenticator=Authenticator ConnectionMethods=ConnectionMethods FileModificationValidator=FileModificationValidator ChangeSets=Change Sets + +TraceComponentLabel=Platform Team CVS Core diff --git a/bundles/org.eclipse.team.cvs.core/plugin.xml b/bundles/org.eclipse.team.cvs.core/plugin.xml index f5228db5a..c57577ff3 100644 --- a/bundles/org.eclipse.team.cvs.core/plugin.xml +++ b/bundles/org.eclipse.team.cvs.core/plugin.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.0"?> <!-- - Copyright (c) 2001, 2011 IBM Corporation and others. + Copyright (c) 2001, 2014 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at @@ -264,4 +264,15 @@ </supports> </importer> </extension> + <extension + point="org.eclipse.ui.trace.traceComponents"> + <component + id="org.eclipse.team.cvs.core.trace" + label="%TraceComponentLabel"> + <bundle + consumed="false" + name="org.eclipse.team.cvs.core"> + </bundle> + </component> + </extension> </plugin> 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 497d24f8c..d84deb7b8 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,6 +20,8 @@ import org.eclipse.core.runtime.*; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.jsch.core.IJSchService; +import org.eclipse.osgi.service.debug.DebugOptions; +import org.eclipse.osgi.service.debug.DebugOptionsListener; import org.eclipse.osgi.util.NLS; import org.eclipse.team.core.Team; import org.eclipse.team.core.TeamException; @@ -32,6 +34,7 @@ import org.eclipse.team.internal.ccvs.core.resources.FileModificationManager; import org.eclipse.team.internal.ccvs.core.util.*; import org.eclipse.team.internal.core.subscribers.ActiveChangeSetManager; import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; import org.osgi.util.tracker.ServiceTracker; public class CVSProviderPlugin extends Plugin { @@ -123,6 +126,7 @@ public class CVSProviderPlugin extends Plugin { private boolean useProxyAuth; private CVSActiveChangeSetCollector changeSetManager; + private ServiceRegistration debugRegistration; private ServiceTracker tracker; private static final String INFO_PROXY_USER = "org.eclipse.team.cvs.core.proxy.user"; //$NON-NLS-1$ @@ -284,6 +288,11 @@ public class CVSProviderPlugin extends Plugin { public void start(BundleContext context) throws Exception { super.start(context); + // register debug options listener + Hashtable properties = new Hashtable(2); + properties.put(DebugOptions.LISTENER_SYMBOLICNAME, ID); + debugRegistration = context.registerService(DebugOptionsListener.class, Policy.DEBUG_OPTIONS_LISTENER, properties); + // load the state which includes the known repositories loadOldState(); crash = createCrashFile(); @@ -311,6 +320,10 @@ public class CVSProviderPlugin extends Plugin { */ public void stop(BundleContext context) throws Exception { try { + // unregister debug options listener + debugRegistration.unregister(); + debugRegistration = null; + savePluginPreferences(); // remove listeners diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java index f6bb234b8..2806474be 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -15,28 +15,31 @@ import java.io.PrintStream; import java.lang.reflect.Field; import org.eclipse.core.runtime.*; +import org.eclipse.osgi.service.debug.DebugOptions; +import org.eclipse.osgi.service.debug.DebugOptionsListener; import org.eclipse.team.internal.core.InfiniteSubProgressMonitor; public class Policy { public static PrintStream recorder; //debug constants + public static boolean DEBUG = false; public static boolean DEBUG_METAFILE_CHANGES = false; public static boolean DEBUG_CVS_PROTOCOL = false; public static boolean DEBUG_THREADING = false; public static boolean DEBUG_DIRTY_CACHING = false; public static boolean DEBUG_SYNC_CHANGE_EVENTS = false; - static { - //init debug options - if (CVSProviderPlugin.getPlugin().isDebugging()) { - DEBUG_METAFILE_CHANGES = "true".equalsIgnoreCase(Platform.getDebugOption(CVSProviderPlugin.ID + "/metafiles"));//$NON-NLS-1$ //$NON-NLS-2$ - DEBUG_CVS_PROTOCOL = "true".equalsIgnoreCase(Platform.getDebugOption(CVSProviderPlugin.ID + "/cvsprotocol"));//$NON-NLS-1$ //$NON-NLS-2$ - DEBUG_THREADING = "true".equalsIgnoreCase(Platform.getDebugOption(CVSProviderPlugin.ID + "/threading"));//$NON-NLS-1$ //$NON-NLS-2$ - DEBUG_DIRTY_CACHING = "true".equalsIgnoreCase(Platform.getDebugOption(CVSProviderPlugin.ID + "/dirtycaching"));//$NON-NLS-1$ //$NON-NLS-2$ - DEBUG_SYNC_CHANGE_EVENTS = "true".equalsIgnoreCase(Platform.getDebugOption(CVSProviderPlugin.ID + "/syncchangeevents"));//$NON-NLS-1$ //$NON-NLS-2$ + static final DebugOptionsListener DEBUG_OPTIONS_LISTENER = new DebugOptionsListener() { + public void optionsChanged(DebugOptions options) { + DEBUG = options.getBooleanOption(CVSProviderPlugin.ID + "/debug", false); //$NON-NLS-1$ + DEBUG_METAFILE_CHANGES = DEBUG && options.getBooleanOption(CVSProviderPlugin.ID + "/metafiles", false); //$NON-NLS-1$ + DEBUG_CVS_PROTOCOL = DEBUG && options.getBooleanOption(CVSProviderPlugin.ID + "/cvsprotocol", false); //$NON-NLS-1$ + DEBUG_THREADING = DEBUG && options.getBooleanOption(CVSProviderPlugin.ID + "/threading", false); //$NON-NLS-1$ + DEBUG_DIRTY_CACHING = DEBUG && options.getBooleanOption(CVSProviderPlugin.ID + "/dirtycaching", false); //$NON-NLS-1$ + DEBUG_SYNC_CHANGE_EVENTS = DEBUG && options.getBooleanOption(CVSProviderPlugin.ID + "/syncchangeevents", false); //$NON-NLS-1$ } - } + }; /** * Progress monitor helpers diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java index 20ec349b3..4fd6e6654 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -275,7 +275,7 @@ public class UpdateListener extends CommandOutputListener { } catch (StringIndexOutOfBoundsException e) { // Something went wrong in the parsing of the message. // Return a status indicating the problem - if (CVSProviderPlugin.getPlugin().isDebugging()) { + if (Policy.DEBUG) { System.out.println("Error parsing E line: " + line); //$NON-NLS-1$ } return new CVSStatus(IStatus.ERROR, CVSStatus.ERROR_LINE_PARSE_FAILURE, line, commandRoot); diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/Connection.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/Connection.java index cf1caefc7..7c2e9f508 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/Connection.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/Connection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -72,7 +72,7 @@ public class Connection { } catch (IOException ex) { // Generally, errors on close are of no interest. // However, log them if debugging is on - if (CVSProviderPlugin.getPlugin().isDebugging()) { + if (Policy.DEBUG) { CVSProviderPlugin.log(new CVSCommunicationException(CVSMessages.Connection_cannotClose, fCVSRoot, ex)); } } finally { |