Previously we obtained the list of MFC candidate hashes (i.e., those commits only in the "MFC from" branch), removed the already merged commits, and then printed the list sorted by commit time. This is usually the correct order, unless commits have non-monotonically-increasing commit times. Unfortunately this is true for a number of commits in our tree. This made it difficult to merge some groups of related commits.
Instead, keep the from-list and to-list in git rev-parse order, and move the matching logic to a new lua script.