commit 9d1e6e1f64b549116e824ab3c686533428d59fcc Author: Karsten Loesing karsten.loesing@gmx.net Date: Sun Jul 1 16:04:29 2012 +0200
Print out diffs of recommended version sets.
Implements #6261 as suggested by rransom. --- src/org/torproject/doctor/Checker.java | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/src/org/torproject/doctor/Checker.java b/src/org/torproject/doctor/Checker.java index ec3c020..b562e57 100644 --- a/src/org/torproject/doctor/Checker.java +++ b/src/org/torproject/doctor/Checker.java @@ -205,8 +205,19 @@ public class Checker { vote.getRecommendedClientVersions())) { StringBuilder message = new StringBuilder(); message.append(vote.getNickname()); - for (String version : vote.getRecommendedClientVersions()) { - message.append(" " + version); + SortedSet<String> addedVersions = new TreeSet<String>( + vote.getRecommendedClientVersions()); + addedVersions.removeAll( + downloadedConsensus.getRecommendedClientVersions()); + for (String version : addedVersions) { + message.append(" +" + version); + } + SortedSet<String> removedVersions = new TreeSet<String>( + downloadedConsensus.getRecommendedClientVersions()); + removedVersions.removeAll( + vote.getRecommendedClientVersions()); + for (String version : removedVersions) { + message.append(" -" + version); } unrecommendedClientVersions.add(message.toString()); } @@ -215,8 +226,19 @@ public class Checker { vote.getRecommendedServerVersions())) { StringBuilder message = new StringBuilder(); message.append(vote.getNickname()); - for (String version : vote.getRecommendedServerVersions()) { - message.append(" " + version); + SortedSet<String> addedVersions = new TreeSet<String>( + vote.getRecommendedServerVersions()); + addedVersions.removeAll( + downloadedConsensus.getRecommendedServerVersions()); + for (String version : addedVersions) { + message.append(" +" + version); + } + SortedSet<String> removedVersions = new TreeSet<String>( + downloadedConsensus.getRecommendedServerVersions()); + removedVersions.removeAll( + vote.getRecommendedServerVersions()); + for (String version : removedVersions) { + message.append(" -" + version); } unrecommendedServerVersions.add(message.toString()); }
tor-commits@lists.torproject.org