Treat first parent traversals as 1 and higher parents as MERGE_COST, to match git name-rev. Allow overriding the merge cost during tests to avoid creating 2^16 commits on the fly. Change-Id: I0175e0c3ab1abe6722e4241abe2f106d1fe92a69