CommittedChangeList (@NotNull RepositoryLocationGroup group, @NotNull List<? extends CommittedChangeList> lists) { if (lists.size() == 1) { return lists.get(0); } final CommittedChangeList victim = ReceivedChangeList.unwrap(lists.get(0)); final ReceivedChangeList result = new ReceivedChangeList(victim); result.setForcePartial(false); final Set<Change> baseChanges = new HashSet<>(); for (CommittedChangeList list : lists) { baseChanges.addAll(ReceivedChangeList.unwrap(list).getChanges()); final Collection<Change> changes = list.getChanges(); for (Change change : changes) { if (! result.getChanges().contains(change)) { result.addChange(change); } } } result.setForcePartial(baseChanges.size() != result.getChanges().size()); return result; }