comparison src/org/tmatesoft/hg/repo/HgTags.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 b2cfbe46f9b6
children 168f1994de7e
comparison
equal deleted inserted replaced
294:32890bab7209 295:981f9f50bb6c
105 line = line.trim(); 105 line = line.trim();
106 if (line.length() == 0) { 106 if (line.length() == 0) {
107 continue; 107 continue;
108 } 108 }
109 if (line.length() < 40+2 /*nodeid, space and at least single-char tagname*/) { 109 if (line.length() < 40+2 /*nodeid, space and at least single-char tagname*/) {
110 System.out.println("Bad tags line:" + line); // FIXME log or otherwise report (IStatus analog?) 110 repo.getContext().getLog().warn(getClass(), "Bad tags line: %s", line);
111 continue; 111 continue;
112 } 112 }
113 int spacePos = line.indexOf(' '); 113 int spacePos = line.indexOf(' ');
114 if (spacePos != -1) { 114 if (spacePos != -1) {
115 assert spacePos == 40; 115 assert spacePos == 40;
149 // !contains because we don't care about order of the tags per revision 149 // !contains because we don't care about order of the tags per revision
150 revTags.add(tagName); 150 revTags.add(tagName);
151 } 151 }
152 152
153 } else { 153 } else {
154 System.out.println("Bad tags line:" + line); // FIXME see above 154 repo.getContext().getLog().warn(getClass(), "Bad tags line: %s", line);
155 } 155 }
156 } 156 }
157 } 157 }
158 158
159 public List<String> tags(Nodeid nid) { 159 public List<String> tags(Nodeid nid) {