Lines 28-39
Link Here
|
28 |
import java.util.Enumeration; |
28 |
import java.util.Enumeration; |
29 |
import java.util.Properties; |
29 |
import java.util.Properties; |
30 |
import java.util.Vector; |
30 |
import java.util.Vector; |
|
|
31 |
|
31 |
import org.apache.tools.ant.BuildException; |
32 |
import org.apache.tools.ant.BuildException; |
32 |
import org.apache.tools.ant.DirectoryScanner; |
33 |
import org.apache.tools.ant.DirectoryScanner; |
33 |
import org.apache.tools.ant.Project; |
34 |
import org.apache.tools.ant.Project; |
34 |
import org.apache.tools.ant.taskdefs.Execute; |
|
|
35 |
import org.apache.tools.ant.taskdefs.AbstractCvsTask; |
35 |
import org.apache.tools.ant.taskdefs.AbstractCvsTask; |
36 |
import org.apache.tools.ant.types.Commandline; |
|
|
37 |
import org.apache.tools.ant.types.FileSet; |
36 |
import org.apache.tools.ant.types.FileSet; |
38 |
|
37 |
|
39 |
/** |
38 |
/** |
Lines 85-90
Link Here
|
85 |
|
84 |
|
86 |
/** The latest date at which to stop processing entries. */ |
85 |
/** The latest date at which to stop processing entries. */ |
87 |
private Date m_stop; |
86 |
private Date m_stop; |
|
|
87 |
|
88 |
/** The tag at which to start processing revisions */ |
89 |
private String m_startTag; |
90 |
|
91 |
/** The tag at which to stop processing revisions */ |
92 |
private String m_endTag; |
93 |
|
94 |
/** Determines whether log (false) or rlog (true) is used */ |
95 |
private boolean m_remote = false; |
88 |
|
96 |
|
89 |
/** |
97 |
/** |
90 |
* Filesets containing list of files against which the cvs log will be |
98 |
* Filesets containing list of files against which the cvs log will be |
Lines 152-159
Link Here
|
152 |
public void setEnd(final Date stop) { |
160 |
public void setEnd(final Date stop) { |
153 |
m_stop = stop; |
161 |
m_stop = stop; |
154 |
} |
162 |
} |
|
|
163 |
|
164 |
/** |
165 |
* Set the tag at which the changelog should start. |
166 |
* |
167 |
* @param startTag The tag at which the changelog should start. |
168 |
*/ |
169 |
public void setStartTag(final String startTag) { |
170 |
m_startTag = startTag; |
171 |
} |
172 |
|
173 |
/** |
174 |
* Set the tag at which the changelog should end. |
175 |
* |
176 |
* @param endTag The tag at which the changelog should end. |
177 |
*/ |
178 |
public void setEndTag(final String endTag) { |
179 |
m_endTag = endTag; |
180 |
} |
155 |
|
181 |
|
156 |
|
182 |
|
|
|
183 |
public void setRemote(final boolean remote) { |
184 |
m_remote = remote; |
185 |
} |
186 |
|
157 |
/** |
187 |
/** |
158 |
* Set the number of days worth of log entries to process. |
188 |
* Set the number of days worth of log entries to process. |
159 |
* |
189 |
* |
Lines 201-223
Link Here
|
201 |
userList.put(user.getUserID(), user.getDisplayname()); |
231 |
userList.put(user.getUserID(), user.getDisplayname()); |
202 |
} |
232 |
} |
203 |
|
233 |
|
204 |
|
234 |
if (m_remote) { |
205 |
setCommand("log"); |
235 |
// supply 'rlog' as argument instead of command |
206 |
|
236 |
setCommand(""); |
207 |
if (getTag() != null) { |
237 |
addCommandArgument("rlog"); |
208 |
CvsVersion myCvsVersion = new CvsVersion(); |
238 |
// Do not print name/header if no revisions selected. This is quicker: less output to parse. |
209 |
myCvsVersion.setProject(getProject()); |
239 |
addCommandArgument("-S"); |
210 |
myCvsVersion.setTaskName("cvsversion"); |
240 |
// Do not list tags. This is quicker: less output to parse. |
211 |
myCvsVersion.setCvsRoot(getCvsRoot()); |
241 |
addCommandArgument("-N"); |
212 |
myCvsVersion.setCvsRsh(getCvsRsh()); |
242 |
} |
213 |
myCvsVersion.setPassfile(getPassFile()); |
243 |
else { |
214 |
myCvsVersion.setDest(m_dir); |
244 |
setCommand("log"); |
215 |
myCvsVersion.execute(); |
245 |
|
216 |
if (myCvsVersion.supportsCvsLogWithSOption()) { |
246 |
if (getTag() != null) { |
217 |
addCommandArgument("-S"); |
247 |
CvsVersion myCvsVersion = new CvsVersion(); |
218 |
} |
248 |
myCvsVersion.setProject(getProject()); |
219 |
} |
249 |
myCvsVersion.setTaskName("cvsversion"); |
220 |
if (null != m_start) { |
250 |
myCvsVersion.setCvsRoot(getCvsRoot()); |
|
|
251 |
myCvsVersion.setCvsRsh(getCvsRsh()); |
252 |
myCvsVersion.setPassfile(getPassFile()); |
253 |
myCvsVersion.setDest(m_dir); |
254 |
myCvsVersion.execute(); |
255 |
if (myCvsVersion.supportsCvsLogWithSOption()) { |
256 |
addCommandArgument("-S"); |
257 |
} |
258 |
} |
259 |
} |
260 |
|
261 |
if (null != m_startTag || null != m_endTag) { |
262 |
String tempStartTag = (m_startTag == null ? "" : m_startTag); |
263 |
String tempEndTag = (m_endTag == null ? "" : m_endTag); |
264 |
|
265 |
addCommandArgument("-r" + tempStartTag + "::" + tempEndTag); |
266 |
} |
267 |
else if (null != m_start) { |
221 |
final SimpleDateFormat outputDate = |
268 |
final SimpleDateFormat outputDate = |
222 |
new SimpleDateFormat("yyyy-MM-dd"); |
269 |
new SimpleDateFormat("yyyy-MM-dd"); |
223 |
|
270 |
|
Lines 245-251
Link Here
|
245 |
} |
292 |
} |
246 |
} |
293 |
} |
247 |
|
294 |
|
248 |
final ChangeLogParser parser = new ChangeLogParser(); |
295 |
ChangeLogParser parser = null; |
|
|
296 |
|
297 |
if (m_remote) { |
298 |
parser = new ChangeLogParser(m_remote, getPackage()); |
299 |
} |
300 |
else { |
301 |
parser = new ChangeLogParser(); |
302 |
} |
303 |
|
249 |
final RedirectingStreamHandler handler = |
304 |
final RedirectingStreamHandler handler = |
250 |
new RedirectingStreamHandler(parser); |
305 |
new RedirectingStreamHandler(parser); |
251 |
|
306 |
|
Lines 299-304
Link Here
|
299 |
|
354 |
|
300 |
throw new BuildException(message); |
355 |
throw new BuildException(message); |
301 |
} |
356 |
} |
|
|
357 |
if ((null != m_startTag || null != m_endTag) && (null != m_start || null != m_stop)) { |
358 |
final String message = "Specify either a tag or date range, not both"; |
359 |
|
360 |
throw new BuildException(message); |
361 |
} |
362 |
if ((null != m_startTag || null != m_endTag) && null == getPackage()) { |
363 |
final String message = "Package must be specified when selecting a tag range"; |
364 |
|
365 |
throw new BuildException(message); |
366 |
} |
302 |
} |
367 |
} |
303 |
|
368 |
|
304 |
/** |
369 |
/** |