Don't include the same change twice in GetRelated.

If the order of commits was modified, while keeping the same change
number, GetRelated would return both the new patch set and the old patch
set. Instead of walking the children first, walk the parents first and
exclude the changes from which the parents came. The changes are still
used for generating the children queue, since there could be new
children on top of the excluded ones.

+ Add test for listing related revisions.

Change-Id: I297aef2cd966c3ea38501fc3d560d6776f58c09f
6 files changed