[JGIT PATCH] Make the Eclipse plugin resource locking more friendly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Rob Clevenger <r...@xxxxxxxxxx>

Using the default rule factory instead of the pessimistic one
makes it less likely that the UI will freeze in a modal dialog
while Eclipse goes off and does builds.

Signed-off-by: Rob Clevenger <r...@xxxxxxxxxx>
Signed-off-by: Shawn O. Pearce <sop@xxxxxxxxxx>
---
 .../src/org/spearce/egit/core/GitProvider.java     |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java b/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java
index a16aca9..c7baf65 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/GitProvider.java
@@ -8,7 +8,9 @@
  *******************************************************************************/
 package org.spearce.egit.core;
 
+import org.eclipse.core.resources.IResourceRuleFactory;
 import org.eclipse.core.resources.team.IMoveDeleteHook;
+import org.eclipse.core.resources.team.ResourceRuleFactory;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.team.core.RepositoryProvider;
 import org.eclipse.team.core.history.IFileHistoryProvider;
@@ -25,6 +27,8 @@
 
 	private GitFileHistoryProvider historyProvider;
 
+	private final IResourceRuleFactory resourceRuleFactory = new GitResourceRuleFactory();
+
 	public String getID() {
 		return getClass().getName();
 	}
@@ -70,4 +74,14 @@ public synchronized IFileHistoryProvider getFileHistoryProvider() {
 		}
 		return historyProvider;
 	}
+
+	@Override
+	public IResourceRuleFactory getRuleFactory() {
+		return resourceRuleFactory;
+	}
+
+	private static class GitResourceRuleFactory extends ResourceRuleFactory {
+		// Use the default rule factory instead of the
+		// pessimistic one by default.
+	}
 }
-- 
1.6.2.rc0.204.gf6b427

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux