Mercurial > jhg
comparison 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 |
comparison
equal
deleted
inserted
replaced
294:32890bab7209 | 295:981f9f50bb6c |
---|---|
22 import java.io.FileOutputStream; | 22 import java.io.FileOutputStream; |
23 import java.io.IOException; | 23 import java.io.IOException; |
24 import java.util.ArrayList; | 24 import java.util.ArrayList; |
25 import java.util.List; | 25 import java.util.List; |
26 | 26 |
27 import org.tmatesoft.hg.repo.HgInternals; | |
27 import org.tmatesoft.hg.repo.HgRepository; | 28 import org.tmatesoft.hg.repo.HgRepository; |
28 import org.tmatesoft.hg.util.PathRewrite; | 29 import org.tmatesoft.hg.util.PathRewrite; |
29 | 30 |
30 /** | 31 /** |
31 * Fields/members that shall not be visible | 32 * Fields/members that shall not be visible |
38 private int requiresFlags = 0; | 39 private int requiresFlags = 0; |
39 private List<Filter.Factory> filterFactories; | 40 private List<Filter.Factory> filterFactories; |
40 | 41 |
41 | 42 |
42 public Internals() { | 43 public Internals() { |
44 } | |
45 | |
46 public void parseRequires(HgRepository hgRepo, File requiresFile) { | |
47 try { | |
48 new RequiresFile().parse(this, requiresFile); | |
49 } catch (IOException ex) { | |
50 // FIXME not quite sure error reading requires file shall be silently logged only. | |
51 HgInternals.getContext(hgRepo).getLog().error(getClass(), ex, null); | |
52 } | |
43 } | 53 } |
44 | 54 |
45 public/*for tests, otherwise pkg*/ void setStorageConfig(int version, int flags) { | 55 public/*for tests, otherwise pkg*/ void setStorageConfig(int version, int flags) { |
46 requiresFlags = flags; | 56 requiresFlags = flags; |
47 } | 57 } |
59 } | 69 } |
60 }; | 70 }; |
61 } else { | 71 } else { |
62 return new PathRewrite.Empty(); | 72 return new PathRewrite.Empty(); |
63 } | 73 } |
64 } | |
65 | |
66 public ConfigFile newConfigFile() { | |
67 return new ConfigFile(); | |
68 } | 74 } |
69 | 75 |
70 public List<Filter.Factory> getFilters(HgRepository hgRepo, ConfigFile cfg) { | 76 public List<Filter.Factory> getFilters(HgRepository hgRepo, ConfigFile cfg) { |
71 if (filterFactories == null) { | 77 if (filterFactories == null) { |
72 filterFactories = new ArrayList<Filter.Factory>(); | 78 filterFactories = new ArrayList<Filter.Factory>(); |