Commit c2ebbc86 authored by agurov's avatar agurov

Reduce I/O amount produced by FileReplaceListener (bug 473193)

https://bugs.eclipse.org/bugs/show_bug.cgi?id=473193

git-svn-id: https://dev.eclipse.org/svnroot/technology/org.eclipse.subversive/trunk@21497 ee007c2a-0a25-0410-9ab9-bf268980928c
parent 8adc3561
......@@ -54,6 +54,8 @@ import org.eclipse.team.svn.core.utility.ProgressMonitorUtility;
public class FileReplaceListener implements IResourceChangeListener {
public void resourceChanged(IResourceChangeEvent event) {
// TODO (requires API change) SVNTeamPreferences.getDecorationBoolean(SVNTeamUIPlugin.instance().getPreferenceStore(), SVNTeamPreferences.DECORATION_ENABLE_PERSISTENT_SSH_NAME);
// SVNTeamPlugin.instance().getOptionProvider().isFileReplaceListenerEnabled()
if (event.getType() == IResourceChangeEvent.POST_CHANGE || event.getType() == IResourceChangeEvent.PRE_BUILD) {
try {
final List<IFile> added = new ArrayList<IFile>();
......
......@@ -985,6 +985,7 @@ public class SVNUIMessages extends BaseMessages {
public static String PerformancePreferencePage_computeDeep;
public static String PerformancePreferencePage_enableCache;
public static String PerformancePreferencePage_enablePersistentSSHConnection;
public static String PerformancePreferencePage_enableFileReplacementAutoundo;
public static String PerformancePreferencePage_optionsDesc;
public static String PerformancePreferencePage_preciseEnablements;
public static String PreferencePage_demoAscendant;
......
......@@ -1655,7 +1655,8 @@ PerformancePreferencePage_optionsDesc =The performance options allow you to set
PerformancePreferencePage_computeDeep =&Compute deep outgoing state (disabling this will improve performance)
PerformancePreferencePage_preciseEnablements =Calculate &precise Team Menu enablements (disabling this will improve speed of response)
PerformancePreferencePage_enableCache =&Enable SVN statuses cache (disabling this will save lots of memory)
PerformancePreferencePage_enablePersistentSSHConnection =&Enable persistent SSH connections (disable this to avoid running multiple svnserve instances)
PerformancePreferencePage_enablePersistentSSHConnection =Enable persistent &SSH connections (disable this to avoid running multiple svnserve instances)
PerformancePreferencePage_enableFileReplacementAutoundo = Enable automatic undo of file &replacement in case there are no actual changes (could take a lot of time for a very big file)
CommentTemplatesPreferencePage_LogTemplates =Include 'tsvn:&logtemplate' property value in commit log templates
CommentTemplatesPreferencePage_UserTemplates =Include &user defined templates in commit log templates
CommentTemplatesPreferencePage_EditHint = &Create, edit or remove comment templates:
......
......@@ -35,11 +35,13 @@ public class SVNTeamPerformancePage extends AbstractSVNTeamPreferencesPage {
protected Button preciseEnablementsButton;
protected Button enableCacheButton;
protected Button enablePersistentSSHConnectionButton;
// protected Button enableFileReplacementAutoundoButton;
protected boolean computeDeep;
protected boolean preciseEnablements;
protected boolean enableCache;
protected boolean enablePersistentSSHConnection;
// protected boolean enableFileReplacementAutoundo;
public SVNTeamPerformancePage() {
super();
......@@ -54,6 +56,7 @@ public class SVNTeamPerformancePage extends AbstractSVNTeamPreferencesPage {
SVNTeamPreferences.setDecorationBoolean(store, SVNTeamPreferences.DECORATION_PRECISE_ENABLEMENTS_NAME, this.preciseEnablements);
SVNTeamPreferences.setDecorationBoolean(store, SVNTeamPreferences.DECORATION_ENABLE_CACHE_NAME, this.computeDeep | this.enableCache);
SVNTeamPreferences.setDecorationBoolean(store, SVNTeamPreferences.DECORATION_ENABLE_PERSISTENT_SSH_NAME, this.enablePersistentSSHConnection);
// SVNTeamPreferences.setDecorationBoolean(store, SVNTeamPreferences.DECORATION_ENABLE_FILE_REPLACEMENT_AUTOUNDO_NAME, this.enableFileReplacementAutoundo);
}
protected void loadDefaultValues(IPreferenceStore store) {
......@@ -61,6 +64,7 @@ public class SVNTeamPerformancePage extends AbstractSVNTeamPreferencesPage {
this.preciseEnablements = SVNTeamPreferences.DECORATION_PRECISE_ENABLEMENTS_DEFAULT;
this.enableCache = SVNTeamPreferences.DECORATION_ENABLE_CACHE_DEFAULT;
this.enablePersistentSSHConnection = SVNTeamPreferences.DECORATION_ENABLE_PERSISTENT_SSH_DEFAULT;
// this.enableFileReplacementAutoundo = SVNTeamPreferences.DECORATION_ENABLE_FILE_REPLACEMENT_AUTOUNDO_DEFAULT;
}
protected void loadValues(IPreferenceStore store) {
......@@ -68,6 +72,7 @@ public class SVNTeamPerformancePage extends AbstractSVNTeamPreferencesPage {
this.preciseEnablements = SVNTeamPreferences.getDecorationBoolean(store, SVNTeamPreferences.DECORATION_PRECISE_ENABLEMENTS_NAME);
this.enableCache = SVNTeamPreferences.getDecorationBoolean(store, SVNTeamPreferences.DECORATION_ENABLE_CACHE_NAME);
this.enablePersistentSSHConnection = SVNTeamPreferences.getDecorationBoolean(store, SVNTeamPreferences.DECORATION_ENABLE_PERSISTENT_SSH_NAME);
// this.enableFileReplacementAutoundo = SVNTeamPreferences.getDecorationBoolean(store, SVNTeamPreferences.DECORATION_ENABLE_FILE_REPLACEMENT_AUTOUNDO_NAME);
}
protected void initializeControls() {
......@@ -75,6 +80,7 @@ public class SVNTeamPerformancePage extends AbstractSVNTeamPreferencesPage {
this.preciseEnablementsButton.setSelection(this.preciseEnablements);
this.enableCacheButton.setSelection(this.enableCache);
this.enablePersistentSSHConnectionButton.setSelection(this.enablePersistentSSHConnection);
// this.enableFileReplacementAutoundoButton.setSelection(this.enableFileReplacementAutoundo);
if (this.computeDeep || this.preciseEnablements) {
this.enableCacheButton.setEnabled(false);
}
......@@ -143,6 +149,15 @@ public class SVNTeamPerformancePage extends AbstractSVNTeamPreferencesPage {
}
});
// this.enableFileReplacementAutoundoButton = new Button(composite, SWT.CHECK);
// this.enableFileReplacementAutoundoButton.setLayoutData(new GridData());
// this.enableFileReplacementAutoundoButton.setText(SVNUIMessages.PerformancePreferencePage_enableFileReplacementAutoundo);
// this.enableFileReplacementAutoundoButton.addListener(SWT.Selection, new Listener() {
// public void handleEvent (Event event) {
// SVNTeamPerformancePage.this.enableFileReplacementAutoundo = SVNTeamPerformancePage.this.enableFileReplacementAutoundoButton.getSelection();
// }
// });
// Setting context help
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "org.eclipse.team.svn.help.performancePreferencesContext"); //$NON-NLS-1$
......
......@@ -250,11 +250,13 @@ public final class SVNTeamPreferences {
public static final String DECORATION_PRECISE_ENABLEMENTS_NAME = "precise.enablements"; //$NON-NLS-1$
public static final String DECORATION_ENABLE_CACHE_NAME = "enable.cache"; //$NON-NLS-1$
public static final String DECORATION_ENABLE_PERSISTENT_SSH_NAME = "enable.persistent.ssh"; //$NON-NLS-1$
public static final String DECORATION_ENABLE_FILE_REPLACEMENT_AUTOUNDO_NAME = "enable.replacement.autoundo"; //$NON-NLS-1$
public static final boolean DECORATION_COMPUTE_DEEP_DEFAULT = true;
public static final boolean DECORATION_PRECISE_ENABLEMENTS_DEFAULT = false;
public static final boolean DECORATION_ENABLE_CACHE_DEFAULT = true;
public static final boolean DECORATION_ENABLE_PERSISTENT_SSH_DEFAULT = true;
public static final boolean DECORATION_ENABLE_FILE_REPLACEMENT_AUTOUNDO_DEFAULT = true;
public static final String DECORATION_USE_FONT_COLORS_DECOR_NAME = "use.fontdecor"; //$NON-NLS-1$
public static final boolean DECORATION_USE_FONT_COLORS_DECOR_DEFAULT = false;
......@@ -468,6 +470,7 @@ public final class SVNTeamPreferences {
store.setDefault(SVNTeamPreferences.fullDecorationName(SVNTeamPreferences.DECORATION_PRECISE_ENABLEMENTS_NAME), SVNTeamPreferences.DECORATION_PRECISE_ENABLEMENTS_DEFAULT);
store.setDefault(SVNTeamPreferences.fullDecorationName(SVNTeamPreferences.DECORATION_ENABLE_CACHE_NAME), SVNTeamPreferences.DECORATION_ENABLE_CACHE_DEFAULT);
store.setDefault(SVNTeamPreferences.fullDecorationName(SVNTeamPreferences.DECORATION_ENABLE_PERSISTENT_SSH_NAME), SVNTeamPreferences.DECORATION_ENABLE_PERSISTENT_SSH_DEFAULT);
store.setDefault(SVNTeamPreferences.fullDecorationName(SVNTeamPreferences.DECORATION_ENABLE_FILE_REPLACEMENT_AUTOUNDO_NAME), SVNTeamPreferences.DECORATION_ENABLE_FILE_REPLACEMENT_AUTOUNDO_DEFAULT);
}
public static void setDefaultMailReporterValues(IPreferenceStore store) {
......@@ -620,6 +623,7 @@ public final class SVNTeamPreferences {
store.setValue(SVNTeamPreferences.fullDecorationName(SVNTeamPreferences.DECORATION_PRECISE_ENABLEMENTS_NAME), SVNTeamPreferences.DECORATION_PRECISE_ENABLEMENTS_DEFAULT);
store.setValue(SVNTeamPreferences.fullDecorationName(SVNTeamPreferences.DECORATION_ENABLE_CACHE_NAME), SVNTeamPreferences.DECORATION_ENABLE_CACHE_DEFAULT);
store.setValue(SVNTeamPreferences.fullDecorationName(SVNTeamPreferences.DECORATION_ENABLE_PERSISTENT_SSH_NAME), SVNTeamPreferences.DECORATION_ENABLE_PERSISTENT_SSH_DEFAULT);
store.setValue(SVNTeamPreferences.fullDecorationName(SVNTeamPreferences.DECORATION_ENABLE_FILE_REPLACEMENT_AUTOUNDO_NAME), SVNTeamPreferences.DECORATION_ENABLE_FILE_REPLACEMENT_AUTOUNDO_DEFAULT);
}
public static void resetToDefaultCommentTemplatesValues(IPreferenceStore store) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment