Instead of gathering every linkrevs from the files below a given folder, which can be very slow for big repositories, we rather scan the changelog information backward, looking for the most recent change that affected the directory.
This closes #7746.