diff src/org/tmatesoft/hg/repo/HgRepository.java @ 504:bf352ce2b97f

Allow to override lock timeout from within Hg4J
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 30 Nov 2012 21:58:00 +0100
parents d2f6ab541330
children 2f9ed6bcefa2
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgRepository.java	Wed Oct 31 15:17:21 2012 +0100
+++ b/src/org/tmatesoft/hg/repo/HgRepository.java	Fri Nov 30 21:58:00 2012 +0100
@@ -37,6 +37,7 @@
 import org.tmatesoft.hg.internal.Experimental;
 import org.tmatesoft.hg.internal.Filter;
 import org.tmatesoft.hg.internal.Internals;
+import org.tmatesoft.hg.internal.PropertyMarshal;
 import org.tmatesoft.hg.internal.RevlogStream;
 import org.tmatesoft.hg.internal.SubrepoManager;
 import org.tmatesoft.hg.repo.ext.HgExtensionsManager;
@@ -558,6 +559,10 @@
 	}
 
 	private int getLockTimeout() {
-		return getConfiguration().getIntegerValue("ui", "timeout", 600);
+		int cfgValue = getConfiguration().getIntegerValue("ui", "timeout", 600);
+		if (getSessionContext().getConfigurationProperty(Internals.CFG_PROPERTY_FS_LOCK_TIMEOUT, null) != null) {
+			return new PropertyMarshal(sessionContext).getInt(Internals.CFG_PROPERTY_FS_LOCK_TIMEOUT, cfgValue);
+		}
+		return cfgValue;
 	}
 }