merge method

updated replacing the sets it names, everything else kept.

A narrowed export writes one listing or one locale, and the sets it did not touch are still on disk and still true. Replacing the whole file would make export --listing=play erase the panel's knowledge of the App Store half. On disk the same rule holds: an export replaces exactly what it produced.

Implementation

StoreShotsReport merge(Iterable<StoreShotsSet> updated) {
  var byKey = {for (var set in sets) set.key: set};
  for (var set in updated) {
    byKey[set.key] = set;
  }
  var merged = byKey.values.toList()..sort((a, b) => a.key.compareTo(b.key));
  return StoreShotsReport(sets: merged);
}