revset: optimized sort method in lazyset class
We are taking advantage of the smartset classes sort method when it exists and
converting the set to a baseset otherwise.
revset: improve head revset performance
Previously the head() revset would iterate over every item in the subset and
check if it was a head. Since the subset is often the entire repo, this was
slow on large repos. Now we iterate over each item in the head list and check if
it's in the subset, which results in much less work.
hg log -r 'head()' on a large repo:
Before: 0.95s
After: 0.28s
revset: added ascending attribute to addset class
In case both collections are in an ascending/descending order then we will be
able to iterate them lazily while keeping the order.
revset: added set method to addset to duck type generatorset
Since this class is only going to be used inside revset.py (it does not duck
type baseset) it needs to duck type only a few more methods for the next
patches.
revsets: backout
d04aac468bf4 due to performance regressions
revset: made addset a private class
This class is not supposed to be used outside revset.py since it only
wraps content that is used by baseset typed classes.
It only gets created by revset operations or private methods.