performance: speedup computation of hidden revisions
In their current state, revset calls can be very costlys, as we
test predicates on the entire repository. The hidden filter is very
widely used, and needs to be very fast.
This change drops revset calls in favor of direct revision manipulation.
Performance test on my Mercurial checkout
- 19857 total changesets,
- 1584 obsolete changesets,
- 13310 obsolescence markers.
Before:
! hidden
! wall 0.077553
After this changes:
! hidden
! wall 0.011230
Performance test on a Mozilla central checkout:
- 117293 total changesets,
- 1 obsolete changeset,
- 1 obsolescence marker.
Before:
! hidden
! wall 0.389472
After:
! hidden
! wall 0.000079
$ hg init
$ touch unknown
$ touch a
$ hg add a
$ hg ci -m "1"
$ touch b
$ hg add b
$ hg ci -m "2"
Should show unknown
$ hg status
? unknown
$ hg revert -r 0 --all
removing b
Should show unknown and b removed
$ hg status
R b
? unknown
Should show a and unknown
$ ls
a
unknown