strip: make tree stripping O(changes) instead of O(repo)
The old tree stripping logic iterated over every tree revlog in the repo looking
for commits that had revs to be stripped. That's very inefficient in large
repos. Instead, let's look at what files are touched by the strip and only
inspect those revlogs.
I don't have actual perf numbers, since internally we don't use a true
treemanifest, but simply iterating over hundreds of thousands of revlogs takes
many, many seconds, so this should help tremendously when stripping only a few
commits.
strip: move tree strip logic to it's own function
This will allow external extensions to modify tree strip behavior more
precisely.
manifest: remove unused property _oldmanifest
The last use seems to have gone away in
7c7d845f8b64 (manifest: make
manifestlog use it's own cache, 2016-11-10).