Deduplicate logic for determining map of accessible repos
Created by: eseliger
I found this logic has been sitting at many different places, so I figured we can extract it into a single place. Also, the deduplication of repo IDs will bring us some performance benefits when a campaign has lot's of changesets in the same repository.
Stacked on top of #12794