Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implement getKind() to match normal value when using a homogeneous SC…

…M set.

This allows clients (e.g. NetBeans IDE) to parse the changelog with knowledge of that SCM.
If using a heterogeneous SCM set, parsing will be hard, but at least give a more diagnostic string.
  • Loading branch information...
commit 11af4d09b124249fb12a3721bae808b6ef4dbeb4 1 parent 8958fa1
Jesse Glick authored
View
15 src/main/java/org/jenkinsci/plugins/multiplescms/MultiSCMChangeLogSet.java
@@ -7,17 +7,20 @@
import java.util.List;
import hudson.model.AbstractBuild;
-import hudson.model.User;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;
+import java.util.HashSet;
+import java.util.Set;
public class MultiSCMChangeLogSet extends ChangeLogSet<Entry> {
private final HashMap<String, ChangeLogSetWrapper> changes;
+ private final Set<String> kinds;
protected MultiSCMChangeLogSet(AbstractBuild<?, ?> build) {
super(build);
changes = new HashMap<String, ChangeLogSetWrapper>();
+ kinds = new HashSet<String>();
}
public static class ChangeLogSetWrapper {
@@ -104,9 +107,19 @@ public void add(String scmClass, String scmFriendlyName, ChangeLogSet<? extends
}
wrapper.addChanges(cls);
}
+ kinds.add(cls.getKind());
}
public Collection<ChangeLogSetWrapper> getChangeLogSetWrappers() {
return changes.values();
}
+
+ @Override public String getKind() {
+ if (kinds.size() == 1) {
+ return kinds.iterator().next();
+ } else {
+ return "Multi" + kinds;
+ }
+ }
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.