First attempt at fixing the bug, fortunately the bug report exhibits an
even more complex case than the naive approach would not have
addressed. Namely, relying on merge depth is not robust enough as some
unwanted children may still appear at an higher merge depth, so we need
to whitelist the acceptable revids and their parents incrementally.
* bzrlib/branch.py:
(Branch.iter_merge_sorted_revisions): We also need to filter the
non-ancestors revisions.
(Branch._filter_non_ancestors): First attempt at fixing bug
474807, we are down from 60281 to 58018 but still not at 57800.