Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
Fixed inverted logic and added more debug info.
Browse files Browse the repository at this point in the history
  • Loading branch information
parautenbach committed Mar 25, 2014
1 parent f989b55 commit 551e586
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Random;

import org.apache.log4j.Logger;
Expand All @@ -32,6 +33,7 @@
import jetbrains.buildServer.serverSide.SRunningBuild;
import jetbrains.buildServer.users.SUser;
import jetbrains.buildServer.users.UserSet;
import jetbrains.buildServer.vcs.SVcsModification;
import jetbrains.buildServer.vcs.SelectPrevBuildPolicy;

public class HipChatServerExtension extends BuildServerAdapter {
Expand Down Expand Up @@ -216,8 +218,12 @@ private String createHtmlBuildEventMessage(SRunningBuild build, TeamCityEvent bu
String fullNameATag = String.format("<a href=\"%s\">%s</a>", projectUrl, build.getBuildType().getFullName());

// Contributors (committers)
try {
List<SVcsModification> changes = build.getChanges(SelectPrevBuildPolicy.SINCE_LAST_BUILD, true);
logger.debug(String.format("Number of changes: %s", changes.size()));
} catch (Exception e) {}
UserSet<SUser> users = build.getCommitters(SelectPrevBuildPolicy.SINCE_LAST_BUILD);
logger.debug(String.format("Initial contributors: %s", users.getUsers().isEmpty()));
logger.debug(String.format("Initial contributors: %s, %s", !users.getUsers().isEmpty(), users != UserSet.EMPTY));
Collection<String> userCollection = new ArrayList<String>();
for (SUser user : users.getUsers()) {
userCollection.add(user.getName());
Expand Down

0 comments on commit 551e586

Please sign in to comment.