Revert "Use uniq in histories"

This reverts commit 665f8621885db3ad30396a584d23b79b8dbabf70.