Returns all commits up to the given revision.