Mercurial > hg4j
comparison 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 |
comparison
equal
deleted
inserted
replaced
294:32890bab7209 | 295:981f9f50bb6c |
---|---|
21 import static org.tmatesoft.hg.internal.KeywordFilter.copySlice; | 21 import static org.tmatesoft.hg.internal.KeywordFilter.copySlice; |
22 | 22 |
23 import java.io.File; | 23 import java.io.File; |
24 import java.io.FileInputStream; | 24 import java.io.FileInputStream; |
25 import java.io.FileOutputStream; | 25 import java.io.FileOutputStream; |
26 import java.io.IOException; | |
26 import java.nio.ByteBuffer; | 27 import java.nio.ByteBuffer; |
27 import java.util.ArrayList; | 28 import java.util.ArrayList; |
28 import java.util.Map; | 29 import java.util.Map; |
29 | 30 |
31 import org.tmatesoft.hg.repo.HgInternals; | |
30 import org.tmatesoft.hg.repo.HgRepository; | 32 import org.tmatesoft.hg.repo.HgRepository; |
31 import org.tmatesoft.hg.util.Path; | 33 import org.tmatesoft.hg.util.Path; |
32 | 34 |
33 /** | 35 /** |
34 * | 36 * |
175 // if (!cfgFileNode.exists()) { | 177 // if (!cfgFileNode.exists()) { |
176 // return; | 178 // return; |
177 // } | 179 // } |
178 // XXX perhaps, add HgDataFile.hasWorkingCopy and workingCopyContent()? | 180 // XXX perhaps, add HgDataFile.hasWorkingCopy and workingCopyContent()? |
179 ConfigFile hgeol = new ConfigFile(); | 181 ConfigFile hgeol = new ConfigFile(); |
180 hgeol.addLocation(cfgFile); | 182 try { |
183 hgeol.addLocation(cfgFile); | |
184 } catch (IOException ex) { | |
185 HgInternals.getContext(hgRepo).getLog().warn(getClass(), ex, null); | |
186 } | |
181 nativeRepoFormat = hgeol.getSection("repository").get("native"); | 187 nativeRepoFormat = hgeol.getSection("repository").get("native"); |
182 if (nativeRepoFormat == null) { | 188 if (nativeRepoFormat == null) { |
183 nativeRepoFormat = "LF"; | 189 nativeRepoFormat = "LF"; |
184 } | 190 } |
185 final String os = System.getProperty("os.name"); // XXX need centralized set of properties | 191 final String os = System.getProperty("os.name"); // XXX need centralized set of properties |
197 } else if ("native".equals(e.getValue())) { | 203 } else if ("native".equals(e.getValue())) { |
198 nativePatterns.add(e.getKey()); | 204 nativePatterns.add(e.getKey()); |
199 } else if ("BIN".equals(e.getValue())) { | 205 } else if ("BIN".equals(e.getValue())) { |
200 binPatterns.add(e.getKey()); | 206 binPatterns.add(e.getKey()); |
201 } else { | 207 } else { |
202 System.out.printf("Can't recognize .hgeol entry: %s for %s", e.getValue(), e.getKey()); // FIXME log warning | 208 HgInternals.getContext(hgRepo).getLog().warn(getClass(), "Can't recognize .hgeol entry: %s for %s", e.getValue(), e.getKey()); |
203 } | 209 } |
204 } | 210 } |
205 if (!crlfPatterns.isEmpty()) { | 211 if (!crlfPatterns.isEmpty()) { |
206 crlfMatcher = new PathGlobMatcher(crlfPatterns.toArray(new String[crlfPatterns.size()])); | 212 crlfMatcher = new PathGlobMatcher(crlfPatterns.toArray(new String[crlfPatterns.size()])); |
207 } | 213 } |