Index: src/main/java/hudson/plugins/starteam/StarTeamSCM.java
===================================================================
--- src/main/java/hudson/plugins/starteam/StarTeamSCM.java (revision 32596)
+++ src/main/java/hudson/plugins/starteam/StarTeamSCM.java (working copy)
@@ -6,6 +6,7 @@
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
+import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.scm.ChangeLogParser;
import hudson.scm.SCM;
@@ -15,9 +16,11 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Date;
import net.sf.json.JSONObject;
+import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;
@@ -47,6 +50,7 @@
*
* @stapler-constructor
*/
+ @DataBoundConstructor
public StarTeamSCM(String hostname, int port, String projectname,
String viewname, String foldername, String username, String password) {
this.hostname = hostname;
@@ -67,10 +71,15 @@
FilePath workspace, BuildListener listener, File changelogFile)
throws IOException, InterruptedException {
boolean status = false;
+
+ Date sinceDate = new Date();
+ if ( build != null) {
+ sinceDate= build.getTimestamp().getTime();
+ }
+
// Create an actor to do the checkout, possibly on a remote machine
StarTeamCheckoutActor co_actor = new StarTeamCheckoutActor(hostname,
- port, user, passwd, projectname, viewname, foldername, build
- .getTimestamp().getTime(), changelogFile, listener);
+ port, user, passwd, projectname, viewname, foldername, sinceDate, changelogFile, listener);
if (workspace.act(co_actor)) {
// TODO: truly create changelog
status = createEmptyChangeLog(changelogFile, listener, "log");
@@ -113,10 +122,15 @@
final TaskListener listener) throws IOException,
InterruptedException {
boolean status = false;
+ Run run = proj.getLastBuild();
+ Date sinceDate = new Date();
+ if ( run != null) {
+ sinceDate= run.getTimestamp().getTime();
+ }
// Create an actor to do the polling, possibly on a remote machine
StarTeamPollingActor p_actor = new StarTeamPollingActor(hostname, port,
user, passwd, projectname, viewname, foldername,
- proj.getLastBuild().getTimestamp().getTime(),
+ sinceDate,
listener);
if (workspace.act(p_actor)) {
status = true;
Index: src/main/java/hudson/plugins/starteam/StarTeamPollingActor.java
===================================================================
--- src/main/java/hudson/plugins/starteam/StarTeamPollingActor.java (revision 32596)
+++ src/main/java/hudson/plugins/starteam/StarTeamPollingActor.java (working copy)
@@ -9,6 +9,7 @@
import java.io.File;
import java.io.IOException;
+import java.io.PrintStream;
import java.util.Date;
/**
@@ -77,7 +78,13 @@
connection.close();
return false;
}
- if (connection.findChangedFiles(f, listener.getLogger(), sinceDate)
+ PrintStream logger;
+ if (listener != null ) {
+ logger = listener.getLogger();
+ } else {
+ logger = System.out;
+ }
+ if (connection.findChangedFiles(f, logger, sinceDate)
.isEmpty()) {
connection.close();
return false;
Index: pom.xml
===================================================================
--- pom.xml (revision 32596)
+++ pom.xml (working copy)
@@ -5,7 +5,7 @@
org.jvnet.hudson.plugins
plugin
- 1.318
+ 1.345
../pom.xml
@@ -72,6 +72,12 @@
provided
+ com.rsa
+ jsafe
+ 3.5
+ provided
+
+
junit
junit
4.4
@@ -126,4 +132,34 @@
+
+
+
+ org.codehaus.mojo
+ cobertura-maven-plugin
+ 2.4
+
+
+ org.apache.maven.plugins
+ maven-pmd-plugin
+ 2.3
+
+
+ org.apache.maven.plugins
+ maven-jxr-plugin
+ 2.2
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.7
+
+
+ org.apache.maven.plugins
+ maven-surefire-report-plugin
+ 2.5
+
+
+
+