use of com.google.gerrit.server.query.change.ChangeIsVisibleToPredicate in project gerrit by GerritCodeReview.
the class LocalMergeSuperSetComputation method byCommitsOnBranchNotMerged.
@UsedAt(UsedAt.Project.GOOGLE)
public ChangeSet byCommitsOnBranchNotMerged(OpenRepo or, BranchNameKey branch, Set<String> visibleHashes, Set<String> nonVisibleHashes, CurrentUser user) throws IOException {
List<ChangeData> potentiallyVisibleChanges = byCommitsOnBranchNotMerged(or, branch, visibleHashes);
List<ChangeData> invisibleChanges = new ArrayList<>(byCommitsOnBranchNotMerged(or, branch, nonVisibleHashes));
List<ChangeData> visibleChanges = new ArrayList<>(potentiallyVisibleChanges.size());
ChangeIsVisibleToPredicate changeIsVisibleToPredicate = changeIsVisibleToPredicateFactory.forUser(user);
for (ChangeData cd : potentiallyVisibleChanges) {
// permissions (except for private changes).
if (!cd.change().isPrivate() || changeIsVisibleToPredicate.match(cd)) {
visibleChanges.add(cd);
} else {
invisibleChanges.add(cd);
}
}
return new ChangeSet(visibleChanges, invisibleChanges);
}
Aggregations