Skip to content

Commit

Permalink
check if workspace is empty if so do a full populate (#53)
Browse files Browse the repository at this point in the history
fixes JENKINS-43457 JENKINS-43657 JENKINS-43695
  • Loading branch information
jetersen committed Apr 19, 2017
1 parent 73cb1e5 commit 1e64bc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Expand Up @@ -278,19 +278,19 @@ private void setStreamColor() throws IOException {
}
}

protected boolean populate(Run<?, ?> build, boolean populateRequired) throws IOException {
protected boolean populate(Run<?, ?> build, boolean populateRequired) throws IOException, InterruptedException {
if (populateRequired) {
String stream = getPopulateStream();
int lastTransaction = NumberUtils.toInt(getLastBuildTransaction(build), 0);
PopulateCmd pop = new PopulateCmd();
if (lastTransaction == 0) {
if (lastTransaction == 0 || accurevWorkingSpace.list("*", ".accurev").length == 0) {
if (pop.populate(scm, launcher, listener, server, stream, true, getPopulateFromMessage(), accurevWorkingSpace, accurevEnv,
null))
startDateOfPopulate = pop.get_startDateOfPopulate();
else
return false;
} else {
String filePath = getFileRevisionsTobePopulated(build, lastTransaction, stream);
String filePath = getFileRevisionsTobePopulated(build, lastTransaction, getChangeLogStream());
logger.info("populate file path " + filePath);
if (filePath != null) {
if (pop.populate(scm, launcher, listener, server, stream, true, getPopulateFromMessage(), accurevWorkingSpace,
Expand All @@ -310,7 +310,7 @@ protected boolean populate(Run<?, ?> build, boolean populateRequired) throws IOE
return true;
}

protected boolean populate(Run<?, ?> build) throws IOException {
protected boolean populate(Run<?, ?> build) throws IOException, InterruptedException {
return populate(build, isPopulateRequired());
}

Expand Down
Expand Up @@ -166,11 +166,6 @@ protected String getChangeLogStream() {
return scm.getWorkspace();
}

@Override
protected String getPopulateStream() {
return scm.getWorkspace();
}

@Override
protected void buildEnvVarsCustom(AbstractBuild<?, ?> build, Map<String, String> env) {
env.put("ACCUREV_WORKSPACE", scm.getWorkspace());
Expand Down

0 comments on commit 1e64bc1

Please sign in to comment.