rank: compute property incrementally
This replaces the naive rank computation with a more efficient incremental
method, avoiding computing the whole ancestor set when possible.
Differential Revision: https://phab.mercurial-scm.org/D12143
ERROR: FIXME: This is a known failure of filelog.size for data starting with \1\nOK.