Fix bug #474807 but performance suffers.
* bzrlib/branch.py:
(Branch._filter_non_ancestors): Register interesting revids and
filter the others. This gives the expected 57800 revisions but
degrade the performances, most probably because we keep
registering when we don't need to anymore.