This does not do the right thing. There are outgoing and incoming commits which were created before both srcRev and dstRev.

What you want is to get all commits between the common base and srcRev and all commits between common base and dstRev, right?

You have already determined the base commit in GitBaseResourceVariantTree, so why not have two RevWalks, one from base to srcRev  and one from base to dstRev?