diff src/org/tmatesoft/hg/internal/Internals.java @ 295:981f9f50bb6c

Issue 11: Error log facility. SessionContext to share common facilities
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 16 Sep 2011 05:35:32 +0200
parents a415fe296a50
children a37ce7145c3f
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/Internals.java	Wed Sep 14 04:41:57 2011 +0200
+++ b/src/org/tmatesoft/hg/internal/Internals.java	Fri Sep 16 05:35:32 2011 +0200
@@ -24,6 +24,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.tmatesoft.hg.repo.HgInternals;
 import org.tmatesoft.hg.repo.HgRepository;
 import org.tmatesoft.hg.util.PathRewrite;
 
@@ -41,6 +42,15 @@
 
 	public Internals() {
 	}
+	
+	public void parseRequires(HgRepository hgRepo, File requiresFile) {
+		try {
+			new RequiresFile().parse(this, requiresFile);
+		} catch (IOException ex) {
+			// FIXME not quite sure error reading requires file shall be silently logged only.
+			HgInternals.getContext(hgRepo).getLog().error(getClass(), ex, null);
+		}
+	}
 
 	public/*for tests, otherwise pkg*/ void setStorageConfig(int version, int flags) {
 		requiresFlags = flags;
@@ -63,10 +73,6 @@
 		}
 	}
 
-	public ConfigFile newConfigFile() {
-		return new ConfigFile();
-	}
-
 	public List<Filter.Factory> getFilters(HgRepository hgRepo, ConfigFile cfg) {
 		if (filterFactories == null) {
 			filterFactories = new ArrayList<Filter.Factory>();