Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgTags.java @ 456:909306e412e2
Refactor LogFacility and SessionContext, better API for both
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 18 Jun 2012 16:54:00 +0200 |
parents | 6437d261048a |
children | b3c16d1aede0 |
comparison
equal
deleted
inserted
replaced
454:36fd1fd06492 | 456:909306e412e2 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011 TMate Software Ltd | 2 * Copyright (c) 2011-2012 TMate Software Ltd |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
5 * it under the terms of the GNU General Public License as published by | 5 * it under the terms of the GNU General Public License as published by |
6 * the Free Software Foundation; version 2 of the License. | 6 * the Free Software Foundation; version 2 of the License. |
7 * | 7 * |
14 * the terms of a license other than GNU General Public License | 14 * the terms of a license other than GNU General Public License |
15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com |
16 */ | 16 */ |
17 package org.tmatesoft.hg.repo; | 17 package org.tmatesoft.hg.repo; |
18 | 18 |
19 import static org.tmatesoft.hg.util.LogFacility.Severity.Warn; | |
20 | |
19 import java.io.BufferedReader; | 21 import java.io.BufferedReader; |
20 import java.io.File; | 22 import java.io.File; |
21 import java.io.FileReader; | 23 import java.io.FileReader; |
22 import java.io.IOException; | 24 import java.io.IOException; |
23 import java.io.Reader; | 25 import java.io.Reader; |
105 line = line.trim(); | 107 line = line.trim(); |
106 if (line.length() == 0) { | 108 if (line.length() == 0) { |
107 continue; | 109 continue; |
108 } | 110 } |
109 if (line.length() < 40+2 /*nodeid, space and at least single-char tagname*/) { | 111 if (line.length() < 40+2 /*nodeid, space and at least single-char tagname*/) { |
110 repo.getContext().getLog().warn(getClass(), "Bad tags line: %s", line); | 112 repo.getContext().getLog().dump(getClass(), Warn, "Bad tags line: %s", line); |
111 continue; | 113 continue; |
112 } | 114 } |
113 int spacePos = line.indexOf(' '); | 115 int spacePos = line.indexOf(' '); |
114 if (spacePos != -1) { | 116 if (spacePos != -1) { |
115 assert spacePos == 40; | 117 assert spacePos == 40; |
149 // !contains because we don't care about order of the tags per revision | 151 // !contains because we don't care about order of the tags per revision |
150 revTags.add(tagName); | 152 revTags.add(tagName); |
151 } | 153 } |
152 | 154 |
153 } else { | 155 } else { |
154 repo.getContext().getLog().warn(getClass(), "Bad tags line: %s", line); | 156 repo.getContext().getLog().dump(getClass(), Warn, "Bad tags line: %s", line); |
155 } | 157 } |
156 } | 158 } |
157 } | 159 } |
158 | 160 |
159 public List<String> tags(Nodeid nid) { | 161 public List<String> tags(Nodeid nid) { |