Check length for parents before usage

Review Request #9679 — Created Feb. 20, 2018 and submitted — Latest diff uploaded

Information

Review Board
release-2.5.x
bb290e0...

Reviewers

The first changeset cannot have a parent so this would be an empty list.
That should be checked.

Sometimes mercurial uses "0000000000000000000000000000000000000000"
to indicate that the parent is the "null" changeset. Sometimes the
array is empty.

Used a repo with a few changesets. Saw
that it will result into an error if first
changeset will be fetched with cmdline or hgweb.

Added this change and saw that cmdline and hgweb
won't get an error.