diff src/org/tmatesoft/hg/internal/NewlineFilter.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 6e1373b54e9b
children a37ce7145c3f
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/NewlineFilter.java	Wed Sep 14 04:41:57 2011 +0200
+++ b/src/org/tmatesoft/hg/internal/NewlineFilter.java	Fri Sep 16 05:35:32 2011 +0200
@@ -23,10 +23,12 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Map;
 
+import org.tmatesoft.hg.repo.HgInternals;
 import org.tmatesoft.hg.repo.HgRepository;
 import org.tmatesoft.hg.util.Path;
 
@@ -177,7 +179,11 @@
 //			}
 			// XXX perhaps, add HgDataFile.hasWorkingCopy and workingCopyContent()?
 			ConfigFile hgeol = new ConfigFile();
-			hgeol.addLocation(cfgFile);
+			try {
+				hgeol.addLocation(cfgFile);
+			} catch (IOException ex) {
+				HgInternals.getContext(hgRepo).getLog().warn(getClass(), ex, null);
+			}
 			nativeRepoFormat = hgeol.getSection("repository").get("native");
 			if (nativeRepoFormat == null) {
 				nativeRepoFormat = "LF";
@@ -199,7 +205,7 @@
 				} else if ("BIN".equals(e.getValue())) {
 					binPatterns.add(e.getKey());
 				} else {
-					System.out.printf("Can't recognize .hgeol entry: %s for %s", e.getValue(), e.getKey()); // FIXME log warning
+					HgInternals.getContext(hgRepo).getLog().warn(getClass(), "Can't recognize .hgeol entry: %s for %s", e.getValue(), e.getKey());
 				}
 			}
 			if (!crlfPatterns.isEmpty()) {